Directory: | ./ |
---|---|
File: | tmp_project/PhoenixFileParser/src/parse_generic_string.cpp |
Date: | 2025-03-14 11:45:13 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 11 | 11 | 100.0% |
Branches: | 24 | 24 | 100.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /*************************************** | ||
2 | Auteur : Pierre Aubert | ||
3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
4 | Licence : CeCILL-C | ||
5 | ****************************************/ | ||
6 | |||
7 | #include "parse_generic_string.h" | ||
8 | |||
9 | ///Parse string value | ||
10 | /** @param[out] str : parsed string value | ||
11 | * @param[out] parser : PFileParser to be used | ||
12 | * @return true on success, false otherwise | ||
13 | */ | ||
14 | 5 | bool parse_generic_string(PString & str, PFileParser & parser){ | |
15 |
3/3✓ Branch 2 taken 5 times.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 4 times.
|
5 | if(parser.isMatch("\"\"\"")){ |
16 |
3/3✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
|
1 | str = "\"\"\"" + parser.getUntilKey("\"\"\""); |
17 |
3/3✓ Branch 2 taken 4 times.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 3 times.
|
4 | }else if(parser.isMatch("\"")){ |
18 |
3/3✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
|
1 | str = "\"" + parser.getUntilKey("\""); |
19 |
3/3✓ Branch 2 taken 3 times.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 2 times.
|
3 | }else if(parser.isMatch("'''")){ |
20 |
3/3✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
|
1 | str = "'''" + parser.getUntilKey("'''"); |
21 |
3/3✓ Branch 2 taken 2 times.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 1 times.
|
2 | }else if(parser.isMatch("'")){ |
22 |
3/3✓ Branch 2 taken 1 times.
✓ Branch 5 taken 1 times.
✓ Branch 8 taken 1 times.
|
1 | str = "'" + parser.getUntilKey("'"); |
23 | }else{ | ||
24 | 1 | return false; | |
25 | } | ||
26 | 4 | return true; | |
27 | } | ||
28 | |||
29 | |||
30 | |||
31 |