55 |
string pathDir(outDir); |
string pathDir(outDir); |
56 |
|
|
57 |
string pathLog = nomeFileLog; |
string pathLog = nomeFileLog; |
58 |
|
bool ANALIZE = false; |
59 |
//---------------- Log4cxx configuration----------------------------------------------- |
//---------------- Log4cxx configuration----------------------------------------------- |
60 |
//Define the configuration file to be used on log4cxx |
//Define the configuration file to be used on log4cxx |
61 |
PropertyConfigurator::configure(pathDir + "/log4cxx.conf"); |
PropertyConfigurator::configure(pathDir + "/log4cxx.conf"); |
82 |
if (argc < 2){ |
if (argc < 2){ |
83 |
//logger->info(_T("You have forgotten the file name.")); |
//logger->info(_T("You have forgotten the file name.")); |
84 |
cout << "You have forgotten the file name. \n"; |
cout << "You have forgotten the file name. \n"; |
85 |
cout << "Try '-help' for more information. \n"; |
cout << "Try '--help' for more information. \n"; |
86 |
exit(1); |
exit(1); |
87 |
} |
} |
88 |
|
|
89 |
if (!strcmp(argv[1], "-help")){ |
if (!strcmp(argv[1], "--help")){ |
90 |
cout << "Usage: yoda FILE [OPTION] \n"; |
cout << "Usage: yoda FILE [OPTION] \n"; |
91 |
cout << "\t -help print this help and exit \n"; |
cout << "\t --help print this help and exit \n"; |
92 |
cout << "\t -p maximum number of packets to process [default all] \n"; |
cout << "\t -p maximum number of packets to process [default all] \n"; |
93 |
|
cout << "\t -analize generate pre-defined analisys files (gif/text) inside the unpacking directory\n"; |
94 |
exit(1); |
exit(1); |
95 |
} |
} |
96 |
|
|
|
if (!strcmp(argv[1], "-version")){ |
|
|
cout << GetVersionInfo() << "\n"; |
|
|
exit(1); |
|
|
} |
|
|
|
|
97 |
ifstream from (argv[1]); |
ifstream from (argv[1]); |
98 |
if (!from) { |
if (!from) { |
99 |
//logger->info(_T("The file does not exist.")); |
//logger->info(_T("The file does not exist.")); |
105 |
if (!strcmp(argv[i], "-p")){ |
if (!strcmp(argv[i], "-p")){ |
106 |
if (++i >= argc){ |
if (++i >= argc){ |
107 |
cerr << "-p needs arguments. \n"; |
cerr << "-p needs arguments. \n"; |
108 |
cout << "Try '-help' for more information. \n"; |
cout << "Try '--help' for more information. \n"; |
109 |
exit(1); |
exit(1); |
110 |
} |
} |
111 |
if (isdigit(*argv[i])) { |
if (isdigit(*argv[i])) { |
113 |
} else { |
} else { |
114 |
//logger->info(_T("The file does not exist.")); |
//logger->info(_T("The file does not exist.")); |
115 |
cerr << "-p needs a integer value. \n"; |
cerr << "-p needs a integer value. \n"; |
116 |
cout << "Try '-help' for more information. \n"; |
cout << "Try '--help' for more information. \n"; |
117 |
exit(1); |
exit(1); |
118 |
} |
} |
119 |
} |
} |
120 |
|
|
121 |
if (!maxPackets){ |
if (!maxPackets){ |
122 |
cout << "Try '-help' for more information. \n"; |
cout << "Try '--help' for more information. \n"; |
123 |
exit(1); |
exit(1); |
124 |
} |
} |
125 |
|
|
126 |
|
if (!strcmp(argv[i], "-analize")) ANALIZE = true; |
127 |
|
|
128 |
} |
} |
129 |
|
|
130 |
|
|
167 |
//Momentarly suspended the save |
//Momentarly suspended the save |
168 |
//system(command.c_str()); |
//system(command.c_str()); |
169 |
} |
} |
|
|
|
|
/** |
|
|
* Get a string with the version info of the algorithm. |
|
|
*/ |
|
|
const char* GetVersionInfo(void) const { |
|
|
return "$Revision$"; |
|
|
} |
|