PhoenixPresentation
2.0.0
Set of cmake function to automate presentation generation
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
14
void
checkPMultiFileParser
(){
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){
44
checkPMultiFileParser
();
45
return
0;
46
}
47
48
ConfigParser.h
main
int main(int argc, char **argv)
Definition:
main.cpp:228
checkPMultiFileParser
void checkPMultiFileParser()
Check the openFileStream.
Definition:
main.cpp:14
ConfigParser
Parse the configuration a create the vector of sources.
Definition:
ConfigParser.h:13
ConfigParser::getDocString
const std::string & getDocString() const
Get the last doc string.
Definition:
ConfigParser.cpp:22
PMultiFileParser::setFileContent
void setFileContent(const PString &fileContent)
Set the file content to be parsed.
Definition:
PMultiFileParser.cpp:43
PMultiFileParser::load
bool load(const PPath &configFile)
Load the PMultiFileParser with the configFile.
Definition:
PMultiFileParser.cpp:27
PMultiFileParser::fullParsing
bool fullParsing()
Perform the full parsing pf data.
Definition:
PMultiFileParser.cpp:57
PPath
Path of a directory or a file.
Definition:
PPath.h:17
PPath::saveFileContent
bool saveFileContent(const PString &content) const
Save a PString in a file.
Definition:
PPath.cpp:395
phoenix_assert.h
phoenix_assert
#define phoenix_assert(isOk)
Definition:
phoenix_assert.h:19
phoenix_check.h
tmp_project
PhoenixInkscape
tmp_project
PhoenixFileParser
TESTS
TEST_MULTI_FILE_PARSER
main.cpp
Generated on Fri Mar 14 2025 15:50:10 for PhoenixPresentation by
1.9.1