25 s <<
"Usage: oks_report_bad_classes [--help] database-file [database-file(s)]\n"
28 " -h | --help print this text\n"
31 " Report classes, attributes and relationships without description.\n"
38 std::cout <<
" * class \"" << c->get_name() <<
'\"';
41 std::cout <<
" has no description";
43 std::cout <<
" (from \"" << c->get_file()->get_short_file_name() <<
"\")\n";
54 for (
int i = 1; i < argc; i++)
56 const char *cp = argv[i];
58 if (!strcmp(cp,
"-h") || !strcmp(cp,
"--help"))
67 Oks::error_msg(
"oks_dump") <<
"\tCan not load file \"" << cp <<
"\", exiting...\n";
75 Oks::error_msg(
"oks_dump") <<
"\tAt least one oks file have to be provided, exiting...\n";
81 std::cerr <<
"Caught oks exception:\n" << ex << std::endl;
84 catch (std::exception &e)
86 std::cerr <<
"Caught standard C++ exception: " << e.what() << std::endl;
91 std::cerr <<
"Caught unknown exception" << std::endl;
95 std::cout <<
"Processed schema files:\n";
97 std::cout << i.second->get_short_file_name() << std::endl;
99 for (
const auto i : kernel.
classes())
103 if (i.second->get_description().empty())
109 if (
const std::list<OksAttribute*> *attrs = i.second->direct_attributes())
110 for (
const auto &j : *attrs)
112 if (j->get_description().empty())
119 std::cout <<
" - attribute \"" << j->get_name() <<
"\" has no description\n";
122 if (
const std::list<OksRelationship*> *rels = i.second->direct_relationships())
123 for (
const auto &j : *rels)
124 if (j->get_description().empty())
131 std::cout <<
" - relationship \"" << j->get_name() <<
"\" has no description\n";
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 *)
int main(int argc, char **argv)
static void report_class(const OksClass *c, bool no_description)
static void printUsage(std::ostream &s)