131{
132 std::vector<std::string> files;
133 std::string class_name;
134 bool verbose(false);
135
136 try {
137 po::options_description desc("This program is loading OKS data files and searching for equal object.\nUsage: oks_report_equal_objects [options] [-f] file+ ");
138
139 desc.add_options()
140 ("class,c" , po::value<std::string>(&class_name) , "If defined, only compare objects of this class")
141 ("files,f" , po::value<std::vector<std::string> >(&files) , "Names of input OKS files")
142 ("verbose,v" , "Run in verbose mode")
143 ("help,h" , "Print help message")
144 ;
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")) { std::cout << desc << std::endl; return EXIT_SUCCESS; }
154 if(vm.count("verbose")) { verbose = true; }
155
156 if(files.empty()) { throw std::runtime_error("Missing application name" ); }
157 }
158 catch(std::exception& ex) {
159 std::cerr << "ERROR: " << ex.what() << std::endl;
160 return EXIT_FAILURE;
161 }
162
163 try {
167
168 for(std::vector<std::string>::const_iterator i = files.begin(); i != files.end(); ++i) {
170 }
171
172 if(!class_name.empty()) {
175 return 0;
176 }
177 else {
178 std::cerr << "ERROR: cannot find class \'" << class_name << '\'' << std::endl;
179 return EXIT_FAILURE;
180 }
181 }
182
183 for(OksClass::Map::const_iterator i = kernel.
classes().begin(); i != kernel.
classes().end(); ++i) {
185 }
186 }
187 catch(oks::exception& ex) {
188 std::cerr << "ERROR: " << ex.what() << std::endl;
189 return EXIT_FAILURE;
190 }
191
192 return 0;
193}
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)