55{
58
59 try {
60 for (int i = 1; i < argc; i++) {
61 const char* cp = argv[i];
62
63 if (!strcmp(cp, "-h") || !strcmp(cp, "--help")) {
65 return EXIT_SUCCESS;
66 } else {
68 Oks::error_msg(
"oks_dump") <<
"\tCan not load file \"" << cp <<
"\", exiting...\n";
69 return EXIT_FAILURE;
70 }
71 }
72 }
73
75 Oks::error_msg(
"oks_dump") <<
"\tAt least one oks file have to be provided, exiting...\n";
76 return EXIT_FAILURE;
77 }
78 } catch (oks::exception& ex) {
79 std::cerr << "Caught oks exception:\n" << ex << std::endl;
80 return EXIT_FAILURE;
81 } catch (std::exception& e) {
82 std::cerr << "Caught standard C++ exception: " << e.what() << std::endl;
83 return EXIT_FAILURE;
84 } catch (...) {
85 std::cerr << "Caught unknown exception" << std::endl;
86 return EXIT_FAILURE;
87 }
88
89 std::cout << "Processed schema files:\n";
91 std::cout << i.second->get_short_file_name() << std::endl;
92
93 for (
const auto i : kernel.
classes()) {
94 bool printed(false);
95
96 if (i.second->get_description().empty()) {
98 printed = true;
99 }
100
101 if (const std::list<OksAttribute*>* attrs = i.second->direct_attributes())
102 for (const auto& j : *attrs)
103
104 if (j->get_description().empty()) {
105 if (!printed) {
107 printed = true;
108 }
109 std::cout << " - attribute \"" << j->get_name() << "\" has no description\n";
110 }
111
112 if (const std::list<OksRelationship*>* rels = i.second->direct_relationships())
113 for (const auto& j : *rels)
114 if (j->get_description().empty()) {
115 if (!printed) {
117 printed = true;
118 }
119 std::cout << " - relationship \"" << j->get_name() << "\" has no description\n";
120 }
121 }
122
123 return EXIT_SUCCESS;
124}
Provides interface to the OKS kernel.
OksFile * load_file(const std::string &name, bool bind=true)
Load OKS database file.
const OksClass::Map & classes() const
Get classes.
void set_silence_mode(const bool b)
Set status of silence mode. To switch 'On'/'Off' use the method's parameter:
const OksFile::Map & schema_files() const
Get all schema files.
static std::ostream & error_msg(const char *)
static void report_class(const OksClass *c, bool no_description)
static void printUsage(std::ostream &s)