132{
133 std::vector<std::string> files;
134 std::string class_name;
135 bool verbose(false);
136
137 try {
138 po::options_description desc("This program is loading OKS data files and searching for equal object.\nUsage: "
139 "oks_report_equal_objects [options] [-f] file+ ");
140
141 desc.add_options()(
142 "class,c", po::value<std::string>(&class_name), "If defined, only compare objects of this class")(
143 "files,f", po::value<std::vector<std::string>>(&files), "Names of input OKS files")(
144 "verbose,v", "Run in verbose mode")("help,h", "Print help message");
145
146 po::positional_options_description p;
147 p.add("files", -1);
148
149 po::variables_map vm;
150 po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm);
151 po::notify(vm);
152
153 if (vm.count("help")) {
154 std::cout << desc << std::endl;
155 return EXIT_SUCCESS;
156 }
157 if (vm.count("verbose")) {
158 verbose = true;
159 }
160
161 if (files.empty()) {
162 throw std::runtime_error("Missing application name");
163 }
164 } catch (std::exception& ex) {
165 std::cerr << "ERROR: " << ex.what() << std::endl;
166 return EXIT_FAILURE;
167 }
168
169 try {
173
174 for (std::vector<std::string>::const_iterator i = files.begin(); i != files.end(); ++i) {
176 }
177
178 if (!class_name.empty()) {
181 return 0;
182 } else {
183 std::cerr << "ERROR: cannot find class \'" << class_name << '\'' << std::endl;
184 return EXIT_FAILURE;
185 }
186 }
187
188 for (OksClass::Map::const_iterator i = kernel.
classes().begin(); i != kernel.
classes().end(); ++i) {
190 }
191 } catch (oks::exception& ex) {
192 std::cerr << "ERROR: " << ex.what() << std::endl;
193 return EXIT_FAILURE;
194 }
195
196 return 0;
197}
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:
void set_test_duplicated_objects_via_inheritance_mode(const bool b)
Set status of test inherited duplicated objects mode. To switch 'On'/'Off' use the method's parameter...
OksClass * find_class(const std::string &class_name) const
Find class by name (C++ string).
static void process_class(const OksClass *c, bool verbose)