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 "ArgParser.h"
11 
14  ArgParser arg;
15  ArgParser arg2(arg);
16  ArgParser arg3;
17  arg3 = arg;
18 
19  arg.print();
20  phoenix_assert(arg.getNbArgument() == 0lu);
21  arg.rewind();
22 }
23 
25 
29  return arg.getCurrentOption() != "";
30 }
31 
33 
35 bool testArgParserArg(int argc, char** argv){
36  bool b(true);
37 
38  ArgParser arg(argc, argv);
39  ArgParser arg2(arg);
40  ArgParser arg3;
41  arg3 = arg;
42 
43  arg.print();
44  b &= arg.getNbArgument() != 0lu;
45 
46  if(arg.getNbArgument() != 0lu){
47  arg.print();
48  b &= arg.getCurrentOption() != "";
49  b &= testConstGetCurrentOption(arg);
50  }
51 
52  arg.rewind();
53  return b;
54 }
55 
57 void testRemaningArgument(int argc, char** argv){
58  ArgParser arg(argc, argv);
59  phoenix_assert(arg.getRemainingArgument() == "--option=val");
60 }
61 
62 int main(int argc, char** argv){
63  testArgParser();
64  phoenix_assert(testArgParserArg(argc, argv));
66  testRemaningArgument(argc, argv);
67  return 0;
68 }
69 
70 
Parse the list of arguments passed to a program.
Definition: ArgParser.h:13
void print() const
Print all the input option.
Definition: ArgParser.cpp:65
const PString & getCurrentOption() const
Get the current option.
Definition: ArgParser.cpp:91
void rewind()
Go bask to the first argument.
Definition: ArgParser.cpp:72
size_t getNbArgument() const
Get the number of arguments passed to the program.
Definition: ArgParser.cpp:105
PString getRemainingArgument()
Get all remaining arguments of the ArgParser.
Definition: ArgParser.cpp:133
#define phoenix_assert(isOk)
int main(int argc, char **argv)
Definition: main.cpp:290
void testRemaningArgument(int argc, char **argv)
Test of getRemainingArgument.
Definition: main.cpp:57
bool testConstGetCurrentOption(const ArgParser &arg)
Test the ArgParser.
Definition: main.cpp:28
void testArgParser()
Test the ArgParser.
Definition: main.cpp:13
bool testArgParserArg(int argc, char **argv)
Test the ArgParser.
Definition: main.cpp:35