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

Go to the source code of this file.

Functions

void checkPMultiFileParser ()
 Check the openFileStream. More...
 
int main (int argc, char **argv)
 

Function Documentation

◆ checkPMultiFileParser()

void checkPMultiFileParser ( )

Check the openFileStream.

Definition at line 14 of file main.cpp.

14  {
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 }
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
#define phoenix_assert(isOk)

References PMultiFileParser::fullParsing(), ConfigParser::getDocString(), PMultiFileParser::load(), phoenix_assert, PPath::saveFileContent(), and PMultiFileParser::setFileContent().

Referenced by main().

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

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 43 of file main.cpp.

43  {
45  return 0;
46 }
void checkPMultiFileParser()
Check the openFileStream.
Definition: main.cpp:14

References checkPMultiFileParser().

+ Here is the call graph for this function: