cprover
jdiff_main.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: JDIFF Main Module
4 
5 Author: Peter Schrammel
6 
7 \*******************************************************************/
8 
11 
12 #include "jdiff_parse_options.h"
13 
14 #include <util/unicode.h>
15 
16 #ifdef IREP_HASH_STATS
17 #include <iostream>
18 #endif
19 
20 #ifdef IREP_HASH_STATS
21 extern unsigned long long irep_hash_cnt;
22 extern unsigned long long irep_cmp_cnt;
23 extern unsigned long long irep_cmp_ne_cnt;
24 #endif
25 
26 #ifdef _MSC_VER
27 int wmain(int argc, const wchar_t **argv_wide)
28 {
29  auto vec = narrow_argv(argc, argv_wide);
30  auto narrow = to_c_str_array(std::begin(vec), std::end(vec));
31  auto argv = narrow.data();
32 #else
33 int main(int argc, const char **argv)
34 {
35 #endif
36  jdiff_parse_optionst parse_options(argc, argv);
37 
38  int res = parse_options.main();
39 
40 #ifdef IREP_HASH_STATS
41  std::cout << "IREP_HASH_CNT=" << irep_hash_cnt << '\n';
42  std::cout << "IREP_CMP_CNT=" << irep_cmp_cnt << '\n';
43  std::cout << "IREP_CMP_NE_CNT=" << irep_cmp_ne_cnt << '\n';
44 #endif
45 
46  return res;
47 }
jdiff_parse_optionst
Definition: jdiff_parse_options.h:44
main
int main(int argc, const char **argv)
Definition: jdiff_main.cpp:33
jdiff_parse_options.h
JDIFF Command Line Option Processing.
to_c_str_array
std::vector< const char * > to_c_str_array(It b, It e)
Definition: unicode.h:59
parse_options_baset::main
virtual int main()
Definition: parse_options.cpp:76
narrow
output_type narrow(input_type input)
Run-time checked narrowing cast.
Definition: narrow.h:34
unicode.h
narrow_argv
std::vector< std::string > narrow_argv(int argc, const wchar_t **argv_wide)
Definition: unicode.cpp:150