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