PhoenixInkscape  2.0.0
Generate multiple png files with svg inkscape files
main.cpp File Reference
#include "phoenix_assert.h"
#include "phoenix_check.h"
#include "ArgParser.h"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 
void testArgParser ()
 Test the ArgParser. More...
 
bool testArgParserArg (int argc, char **argv)
 Test the ArgParser. More...
 
bool testConstGetCurrentOption (const ArgParser &arg)
 Test the ArgParser. More...
 
void testRemaningArgument (int argc, char **argv)
 Test of getRemainingArgument. More...
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 62 of file main.cpp.

62  {
63  testArgParser();
64  phoenix_assert(testArgParserArg(argc, argv));
66  testRemaningArgument(argc, argv);
67  return 0;
68 }
#define phoenix_assert(isOk)
void testRemaningArgument(int argc, char **argv)
Test of getRemainingArgument.
Definition: main.cpp:57
void testArgParser()
Test the ArgParser.
Definition: main.cpp:13
bool testArgParserArg(int argc, char **argv)
Test the ArgParser.
Definition: main.cpp:35

References phoenix_assert, testArgParser(), testArgParserArg(), and testRemaningArgument().

+ Here is the call graph for this function:

◆ testArgParser()

void testArgParser ( )

Test the ArgParser.

Definition at line 13 of file main.cpp.

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

References ArgParser::getNbArgument(), phoenix_assert, ArgParser::print(), and ArgParser::rewind().

Referenced by main().

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

◆ testArgParserArg()

bool testArgParserArg ( int  argc,
char **  argv 
)

Test the ArgParser.

Returns
true on success, false otherwise

Definition at line 35 of file main.cpp.

35  {
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 }
bool testConstGetCurrentOption(const ArgParser &arg)
Test the ArgParser.
Definition: main.cpp:28

References ArgParser::getCurrentOption(), ArgParser::getNbArgument(), ArgParser::print(), ArgParser::rewind(), and testConstGetCurrentOption().

Referenced by main().

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

◆ testConstGetCurrentOption()

bool testConstGetCurrentOption ( const ArgParser arg)

Test the ArgParser.

Parameters
arg: constant ArgParser to be tested
Returns
true on success, false otherwise

Definition at line 28 of file main.cpp.

28  {
29  return arg.getCurrentOption() != "";
30 }
const PString & getCurrentOption() const
Get the current option.
Definition: ArgParser.cpp:91

References ArgParser::getCurrentOption().

Referenced by testArgParserArg().

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

◆ testRemaningArgument()

void testRemaningArgument ( int  argc,
char **  argv 
)

Test of getRemainingArgument.

Definition at line 57 of file main.cpp.

57  {
58  ArgParser arg(argc, argv);
59  phoenix_assert(arg.getRemainingArgument() == "--option=val");
60 }

References ArgParser::getRemainingArgument(), and phoenix_assert.

Referenced by main().

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