PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
main.cpp File Reference
#include "phoenix_assert.h"
#include "phoenix_check.h"
#include "OptionParser.h"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

OptionParser createOptionParser ()
 Create the OptionParser of this program. 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 15 of file main.cpp.

15  {
16  OptionParser parser(true, "1.0.0");
17  parser.addOption("input", "i", OptionType::FILENAME, true, "Required option");
18  return parser;
19 }
Parse the options passed to a program.
Definition: OptionParser.h:15

References OptionParser::addOption(), and OptionType::FILENAME.

+ Here is the call graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 21 of file main.cpp.

21  {
23  parser.parseArgument(argc, argv);
24 
25  const OptionMode & defaultMode = parser.getDefaultMode();
26  std::vector<std::string> listInputFile;
27  defaultMode.getValue(listInputFile, "input");
28 // std::cout << "input = {" << std::endl;
29 // for(std::vector<std::string>::iterator it(listInputFile.begin()); it != listInputFile.end(); ++it){
30 // std::cout << "\t'" << *it << "'" << std::endl;
31 // }
32 // std::cout << "}" << std::endl;
33  std::vector<std::string> listReference;
34  listReference.push_back("fileName1.txt");
35  listReference.push_back("fileName2.txt");
36  listReference.push_back("fileName3.txt");
37  phoenix_assert(phoenix_check("Check list input", listInputFile, listReference));
38  return 0;
39 }
OptionParser createOptionParser()
Create the OptionParser of this program.
Definition: main.cpp:17
Describe a mode in the program arguments.
Definition: OptionMode.h:13
bool getValue(T &value, const PString &optionName) const
Get the value of the option.
void parseArgument(int argc, char **argv)
Parse the arguments passed to the program.
const OptionMode & getDefaultMode() const
Get default mode.
#define phoenix_assert(isOk)
bool phoenix_check(const std::string &testName, const std::string &val, const std::string &reference)
Check two string.

References createOptionParser(), OptionParser::getDefaultMode(), OptionMode::getValue(), OptionParser::parseArgument(), phoenix_assert, and phoenix_check().

+ Here is the call graph for this function: