55{
58
59 try
60 {
61 for (int i = 1; i < argc; i++)
62 {
63 const char *cp = argv[i];
64
65 if (!strcmp(cp, "-h") || !strcmp(cp, "--help"))
66 {
68 return EXIT_SUCCESS;
69 }
70 else
71 {
73 {
74 Oks::error_msg(
"oks_dump") <<
"\tCan not load file \"" << cp <<
"\", exiting...\n";
75 return EXIT_FAILURE;
76 }
77 }
78 }
79
81 {
82 Oks::error_msg(
"oks_dump") <<
"\tAt least one oks file have to be provided, exiting...\n";
83 return EXIT_FAILURE;
84 }
85 }
86 catch (oks::exception &ex)
87 {
88 std::cerr << "Caught oks exception:\n" << ex << std::endl;
89 return EXIT_FAILURE;
90 }
91 catch (std::exception &e)
92 {
93 std::cerr << "Caught standard C++ exception: " << e.what() << std::endl;
94 return EXIT_FAILURE;
95 }
96 catch (...)
97 {
98 std::cerr << "Caught unknown exception" << std::endl;
99 return EXIT_FAILURE;
100 }
101
102 std::cout << "Processed schema files:\n";
104 std::cout << i.second->get_short_file_name() << std::endl;
105
106 for (
const auto i : kernel.
classes())
107 {
108 bool printed(false);
109
110 if (i.second->get_description().empty())
111 {
113 printed = true;
114 }
115
116 if (const std::list<OksAttribute*> *attrs = i.second->direct_attributes())
117 for (const auto &j : *attrs)
118
119 if (j->get_description().empty())
120 {
121 if (!printed)
122 {
124 printed = true;
125 }
126 std::cout << " - attribute \"" << j->get_name() << "\" has no description\n";
127 }
128
129 if (const std::list<OksRelationship*> *rels = i.second->direct_relationships())
130 for (const auto &j : *rels)
131 if (j->get_description().empty())
132 {
133 if (!printed)
134 {
136 printed = true;
137 }
138 std::cout << " - relationship \"" << j->get_name() << "\" has no description\n";
139 }
140 }
141
142 return EXIT_SUCCESS;
143}
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)