Directory: | ./ |
---|---|
File: | tmp_project/PhoenixFileParser/src/parse_generic_string.cpp |
Date: | 2025-04-25 19:10:50 |
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 | 65 | bool parse_generic_string(PString & str, PFileParser & parser){ | |
15 |
3/3✓ Branch 2 taken 65 times.
✓ Branch 5 taken 2 times.
✓ Branch 6 taken 63 times.
|
65 | if(parser.isMatch("\"\"\"")){ |
16 |
3/3✓ Branch 2 taken 2 times.
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
|
2 | str = "\"\"\"" + parser.getUntilKey("\"\"\""); |
17 |
3/3✓ Branch 2 taken 63 times.
✓ Branch 5 taken 37 times.
✓ Branch 6 taken 26 times.
|
63 | }else if(parser.isMatch("\"")){ |
18 |
3/3✓ Branch 2 taken 37 times.
✓ Branch 5 taken 37 times.
✓ Branch 8 taken 37 times.
|
37 | str = "\"" + parser.getUntilKey("\""); |
19 |
3/3✓ Branch 2 taken 26 times.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 25 times.
|
26 | }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 25 times.
✓ Branch 5 taken 3 times.
✓ Branch 6 taken 22 times.
|
25 | }else if(parser.isMatch("'")){ |
22 |
3/3✓ Branch 2 taken 3 times.
✓ Branch 5 taken 3 times.
✓ Branch 8 taken 3 times.
|
3 | str = "'" + parser.getUntilKey("'"); |
23 | }else{ | ||
24 | 22 | return false; | |
25 | } | ||
26 | 43 | return true; | |
27 | } | ||
28 | |||
29 | |||
30 | |||
31 |