PhoenixMock
1.3.3
Tools to split/merge/print mock
Toggle main menu visibility
Loading...
Searching...
No Matches
main_info.cpp
Go to the documentation of this file.
1
/***************************************
2
Auteur : Pierre Aubert
3
Mail : pierre.aubert@lapp.in2p3.fr
4
Licence : CeCILL-C
5
****************************************/
6
7
#include "OptionParser.h"
8
9
#include "
phoenix_mock.h
"
10
12
14
OptionParser
createOptionParser
(){
15
OptionParser parser(
true
, __PROGRAM_VERSION__);
16
parser.setExampleLongOption(
"phoenix_mock_info --input=file.pmock"
);
17
parser.setExampleShortOption(
"phoenix_mock_info -i file2.mock file2.pmock"
);
18
19
parser.addOption(
"input"
,
"i"
, OptionType::FILENAME,
true
,
"List of input mock to get the info"
);
20
return
parser;
21
}
22
24
27
bool
infoMock
(
const
std::vector<PString> & vecInputFile){
28
bool
b(
true
);
29
for
(std::vector<PString>::const_iterator itFile(vecInputFile.begin()); itFile != vecInputFile.end() && b; ++itFile){
30
std::vector<std::vector<char> > vecTmpFile;
31
if
(data_load(*itFile, vecTmpFile)){
32
size_t
nbMessageIn(vecTmpFile.size());
33
std::cout <<
"Mock '"
<<(*itFile)<<
"' : nbMessage = "
<< nbMessageIn << std::endl;
34
}
else
{
35
b =
false
;
36
}
37
}
38
return
b;
39
}
40
41
int
main
(
int
argc,
char
** argv){
42
OptionParser parser =
createOptionParser
();
43
parser.parseArgument(argc, argv);
44
const
OptionMode & defaultMode = parser.getDefaultMode();
45
std::vector<PString> vecInputFile;
46
defaultMode.getValue(vecInputFile,
"input"
);
47
return
infoMock
(vecInputFile) - 1;
48
}
49
50
infoMock
bool infoMock(const std::vector< PString > &vecInputFile)
Merge mock files.
Definition
main_info.cpp:27
main
int main(int argc, char **argv)
Definition
main_info.cpp:41
createOptionParser
OptionParser createOptionParser()
Create the OptionParser of this program.
Definition
main_info.cpp:14
phoenix_mock.h
program
main_info.cpp
Generated by
1.17.0