PhoenixMock
1.8.7
Tools to split/merge/print mock used in Phoenix
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 "
string_utils.h
"
8
#include "
convertToString.h
"
9
#include "
OptionParser.h
"
10
11
#include "
phoenix_mock.h
"
12
14
16
OptionParser
createOptionParser
(){
17
OptionParser
parser
(
true
, __PROGRAM_VERSION__);
18
parser
.setExampleLongOption(
"phoenix_mock_info --input=file.pmock"
);
19
parser
.setExampleShortOption(
"phoenix_mock_info -i file2.mock file2.pmock"
);
20
21
parser
.addOption(
"input"
,
"i"
,
OptionType::FILENAME
,
true
,
"List of input mock to get the info"
);
22
return
parser
;
23
}
24
26
29
bool
infoMock
(
const
std::vector<std::string> & vecInputFile){
30
bool
b(
true
);
31
for
(std::vector<std::string>::const_iterator itFile(vecInputFile.begin()); itFile != vecInputFile.end() && b; ++itFile){
32
std::vector<std::vector<char> > vecTmpFile;
33
if
(
data_load
(*itFile, vecTmpFile)){
34
size_t
nbMessageIn(vecTmpFile.size());
35
std::cout <<
"Mock '"
<<(*itFile)<<
"' : nbMessage = "
<< nbMessageIn << std::endl;
36
}
else
{
37
b =
false
;
38
}
39
}
40
return
b;
41
}
42
43
int
main
(
int
argc,
char
** argv){
44
OptionParser
parser
=
createOptionParser
();
45
parser
.parseArgument(argc, argv);
46
const
OptionMode
& defaultMode =
parser
.getDefaultMode();
47
std::vector<std::string> vecInputFile;
48
defaultMode.
getValue
(vecInputFile,
"input"
);
49
return
infoMock
(vecInputFile) - 1;
50
}
51
52
string_utils.h
createOptionParser
OptionParser createOptionParser()
Create the OptionParser of this program.
Definition:
main_info.cpp:16
OptionMode::getValue
bool getValue(T &value, const std::string &optionName) const
Get the value of the option.
Definition:
OptionMode_impl.h:18
main
int main(int argc, char **argv)
Definition:
main_info.cpp:43
createReleaseCurl.parser
parser
Definition:
createReleaseCurl.py:123
OptionParser
Parse the options passed to a program.
Definition:
OptionParser.h:15
convertToString.h
data_load
bool data_load(FILE *iter, T &data)
Load data from a message.
Definition:
data_file.h:39
phoenix_mock.h
OptionParser.h
infoMock
bool infoMock(const std::vector< std::string > &vecInputFile)
Merge mock files.
Definition:
main_info.cpp:29
OptionMode
Describe a mode in the program arguments.
Definition:
OptionMode.h:13
OptionType::FILENAME
@ FILENAME
Definition:
OptionType.h:26
program
main_info.cpp
Generated on Mon Dec 9 2024 15:33:41 for PhoenixMock by
1.8.17