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 <iostream>
9 #include "phoenix_assert.h"
10 #include "phoenix_check.h"
11 #include "ConfigParser.h"
12 
15  PPath fileName("configFile.txt");
16  phoenix_assert(fileName.saveFileContent("//some comment\n///Some documentation\n\n"));
17 
18  ConfigParser parser;
19 
20  phoenix_assert(!parser.fullParsing()); //Cannot parse because nothing is initialised
21  phoenix_assert(!parser.load(PPath()));
22  phoenix_assert(!parser.load(PPath("unexistingFile.txt")));
23 
24  phoenix_assert(parser.load(fileName));
25  std::string docString(parser.getDocString());
26 // std::cout << "checkPMultiFileParser : docString = '" << docString << "' ('Some documentation' expected)" << std::endl;
27  phoenix_assert(docString == "Some documentation");
28  parser.setFileContent("//some comment\n///Some documentation\n\n");
29 
30  ConfigParser parser2;
31  parser2.setFileContent("//some comment\n///Some documentation\n\n");
32  phoenix_assert(parser2.fullParsing());
33  std::string docString2(parser2.getDocString());
34 // std::cout << "checkPMultiFileParser : parser2 docString2 = '" << docString2 << "' ('Some documentation' expected)" << std::endl;
35  phoenix_assert(docString2 == "Some documentation");
36 
37  PPath fileNameFail("configFileFail.txt");
38  phoenix_assert(fileNameFail.saveFileContent("\n\nsome unexpected string\n///Some documentation\n\n"));
39  phoenix_assert(!parser.load(fileNameFail));
40 }
41 
42 
43 int main(int argc, char** argv){
45  return 0;
46 }
47 
48 
Parse the configuration a create the vector of sources.
Definition: ConfigParser.h:13
const std::string & getDocString() const
Get the last doc string.
void setFileContent(const PString &fileContent)
Set the file content to be parsed.
bool load(const PPath &configFile)
Load the PMultiFileParser with the configFile.
bool fullParsing()
Perform the full parsing pf data.
Path of a directory or a file.
Definition: PPath.h:17
bool saveFileContent(const PString &content) const
Save a PString in a file.
Definition: PPath.cpp:395
#define phoenix_assert(isOk)
int main(int argc, char **argv)
Definition: main.cpp:290
void checkPMultiFileParser()
Check the openFileStream.
Definition: main.cpp:14