PhoenixMock  1.8.7
Tools to split/merge/print mock used in Phoenix
main_info.cpp File Reference
#include "string_utils.h"
#include "convertToString.h"
#include "OptionParser.h"
#include "phoenix_mock.h"
+ Include dependency graph for main_info.cpp:

Go to the source code of this file.

Functions

OptionParser createOptionParser ()
 Create the OptionParser of this program. More...
 
bool infoMock (const std::vector< std::string > &vecInputFile)
 Merge mock files. More...
 
int main (int argc, char **argv)
 

Function Documentation

◆ createOptionParser()

OptionParser createOptionParser ( )

Create the OptionParser of this program.

Returns
OptionParser of this program

Definition at line 16 of file main_info.cpp.

16  {
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 }

References OptionType::FILENAME, and createReleaseCurl::parser.

Referenced by main().

+ Here is the caller graph for this function:

◆ infoMock()

bool infoMock ( const std::vector< std::string > &  vecInputFile)

Merge mock files.

Parameters
vecInputFile: vector of input files to print the info
Returns
true on success, false otherwise

Definition at line 29 of file main_info.cpp.

29  {
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 }

References data_load().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 43 of file main_info.cpp.

43  {
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 }

References createOptionParser(), OptionMode::getValue(), infoMock(), and createReleaseCurl::parser.

+ Here is the call graph for this function:
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
createReleaseCurl.parser
parser
Definition: createReleaseCurl.py:123
OptionParser
Parse the options passed to a program.
Definition: OptionParser.h:15
data_load
bool data_load(FILE *iter, T &data)
Load data from a message.
Definition: data_file.h:39
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