PhoenixLecture
2.0.0
Set of tools to make lectures
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 "
dico_replace_var.h
"
11
13
void
checkVarReplaceStr
(){
14
PMapKnownVar
mapKeyVariable;
15
mapKeyVariable[
"${varA}"
] =
"someStr"
;
16
mapKeyVariable[
"${varB}"
] =
"otherStr"
;
17
18
phoenix_assert
(
phoenix_check
(
"base empty var begin end"
,
dico_replace_var_str
(
"input"
, mapKeyVariable,
""
,
""
),
"input"
));
19
phoenix_assert
(
phoenix_check
(
"base empty var begin"
,
dico_replace_var_str
(
"input"
, mapKeyVariable,
""
,
"}"
),
"input"
));
20
phoenix_assert
(
phoenix_check
(
"base empty var end"
,
dico_replace_var_str
(
"input"
, mapKeyVariable,
"${"
,
""
),
"input"
));
21
phoenix_assert
(
phoenix_check
(
"base empty no replace"
,
dico_replace_var_str
(
"input"
, mapKeyVariable,
"${"
,
"}"
),
"input"
));
22
phoenix_assert
(
phoenix_check
(
"base empty replace A"
,
dico_replace_var_str
(
"input ${varA}"
, mapKeyVariable,
"${"
,
"}"
),
"input someStr"
));
23
phoenix_assert
(
phoenix_check
(
"base empty replace A B"
,
dico_replace_var_str
(
"input ${varA}${varB}"
, mapKeyVariable,
"${"
,
"}"
),
"input someStrotherStr"
));
24
phoenix_assert
(
phoenix_check
(
"base empty replace unexisting C"
,
dico_replace_var_str
(
"input ${varC}"
, mapKeyVariable,
"${"
,
"}"
),
"input ${varC}"
));
25
}
26
27
28
int
main
(
int
argc,
char
** argv){
29
checkVarReplaceStr
();
30
return
0;
31
}
32
33
main
int main(int argc, char **argv)
Definition:
main.cpp:228
checkVarReplaceStr
void checkVarReplaceStr()
Check the replace of var in str.
Definition:
main.cpp:13
dico_replace_var_str
PString dico_replace_var_str(const PString &baseStr, const PMapKnownVar &mapKeyVariable, const PString &varBegin, const PString &varEnd)
Update the suffix of the file.
Definition:
dico_replace_var.cpp:72
dico_replace_var.h
PMapKnownVar
std::map< PString, PString > PMapKnownVar
Map of known variables.
Definition:
dico_replace_var.h:14
phoenix_assert.h
phoenix_assert
#define phoenix_assert(isOk)
Definition:
phoenix_assert.h:19
phoenix_check
bool phoenix_check(const std::string &testName, const std::string &val, const std::string &reference)
Check two string.
Definition:
phoenix_check.cpp:16
phoenix_check.h
tmp_project
PhoenixPresentation
tmp_project
PhoenixInkscape
tmp_project
PhoenixFileParser
TESTS
TEST_DICO_REPLACE_VAR_STR
main.cpp
Generated on Mon Mar 24 2025 18:10:09 for PhoenixLecture by
1.9.1