PhoenixInkscape  2.0.0
Generate multiple png files with svg inkscape files
main.cpp
Go to the documentation of this file.
1 
2 /***************************************
3  Auteur : Pierre Aubert
4  Mail : pierre.aubert@lapp.in2p3.fr
5  Licence : CeCILL-C
6 ****************************************/
7 
8 #include "phoenix_assert.h"
9 #include "phoenix_check.h"
10 #include "OptionParser.h"
11 
13 
16  OptionParser parser(true, "1.0.0");
17  parser.addOption("input", "i", OptionType::FILENAME, true, "Required option");
18  return parser;
19 }
20 
21 int main(int argc, char** argv){
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 }
40 
41 
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.
Parse the options passed to a program.
Definition: OptionParser.h:15
void parseArgument(int argc, char **argv)
Parse the arguments passed to the program.
void addOption(const PString &longOption, const PString &shortOption, OptionType::OptionType optionType, bool isRequired, const PString &docString)
Add an option in the OptionParser.
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.
int main(int argc, char **argv)
Definition: main.cpp:290
OptionParser createOptionParser()
Create the OptionParser of this program.
Definition: main.cpp:17