Directory: | ./ |
---|---|
File: | tmp_project/PhoenixTex2Html/src/PTimeTable/pspeaker_tex.cpp |
Date: | 2025-03-24 18:12:43 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 36 | 36 | 100.0% |
Branches: | 60 | 63 | 95.2% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /*************************************** | ||
2 | Auteur : Pierre Aubert | ||
3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
4 | Licence : CeCILL-C | ||
5 | ****************************************/ | ||
6 | |||
7 | #include "platexobj_create.h" | ||
8 | #include "platexobj_parse.h" | ||
9 | #include "platexobj_utils.h" | ||
10 | #include "pspeaker_tex.h" | ||
11 | |||
12 | |||
13 | ///Save all speakers of the given PLatexSpeaker into a vector of PLatexObj | ||
14 | /** @param[out] vecContent : vector of PLatexObj to be completed | ||
15 | * @param speaker : PLatexSpeaker to be used | ||
16 | */ | ||
17 | 39 | void pspeaker_texSpeaker(std::vector<PLatexObj> & vecContent, const PLatexSpeaker & speaker){ | |
18 |
4/4✓ Branch 3 taken 39 times.
✓ Branch 6 taken 39 times.
✓ Branch 9 taken 39 times.
✓ Branch 12 taken 39 times.
|
39 | vecContent.push_back(platexobj_createSection(PLatexType::SECTION, speaker.getName(), "speaker_"+speaker.getLabel())); |
19 |
3/3✓ Branch 2 taken 39 times.
✓ Branch 5 taken 39 times.
✓ Branch 8 taken 39 times.
|
39 | vecContent.push_back(platexobj_createTextBf("Speaker : ", "")); |
20 |
2/2✓ Branch 3 taken 30 times.
✓ Branch 4 taken 9 times.
|
39 | if(speaker.getTitle().getVecContent().size() != 0lu){ |
21 | 30 | appendVecContent(vecContent, speaker.getTitle().getVecContent()); | |
22 |
3/3✓ Branch 2 taken 30 times.
✓ Branch 5 taken 30 times.
✓ Branch 8 taken 30 times.
|
30 | vecContent.push_back(platexobj_createText(" ", "")); |
23 | } | ||
24 | 39 | appendVecContent(vecContent, speaker.getName().getVecContent()); | |
25 |
1/2✓ Branch 3 taken 39 times.
✗ Branch 4 not taken.
|
39 | if(speaker.getAffiliation().getVecContent().size() != 0lu){ |
26 |
1/1✓ Branch 2 taken 39 times.
|
39 | vecContent.push_back(platexobj_createNewLine()); |
27 |
3/3✓ Branch 2 taken 39 times.
✓ Branch 5 taken 39 times.
✓ Branch 8 taken 39 times.
|
39 | vecContent.push_back(platexobj_createTextBf("Affiliation : ", "")); |
28 |
3/3✓ Branch 2 taken 39 times.
✓ Branch 5 taken 39 times.
✓ Branch 8 taken 39 times.
|
39 | vecContent.push_back(platexobj_createText(" (", "")); |
29 | 39 | appendVecContent(vecContent, speaker.getAffiliation().getVecContent()); | |
30 |
3/3✓ Branch 2 taken 39 times.
✓ Branch 5 taken 39 times.
✓ Branch 8 taken 39 times.
|
39 | vecContent.push_back(platexobj_createText(") ", "")); |
31 | } | ||
32 |
1/2✓ Branch 3 taken 39 times.
✗ Branch 4 not taken.
|
39 | if(speaker.getJob().getVecContent().size() != 0lu){ |
33 |
1/1✓ Branch 2 taken 39 times.
|
39 | vecContent.push_back(platexobj_createNewLine()); |
34 |
3/3✓ Branch 2 taken 39 times.
✓ Branch 5 taken 39 times.
✓ Branch 8 taken 39 times.
|
39 | vecContent.push_back(platexobj_createTextBf("Function : ", "")); |
35 | 39 | appendVecContent(vecContent, speaker.getJob().getVecContent()); | |
36 | } | ||
37 |
2/2✓ Branch 3 taken 3 times.
✓ Branch 4 taken 36 times.
|
39 | if(speaker.getDescription().getVecContent().size() != 0lu){ |
38 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | vecContent.push_back(platexobj_createNewLine()); |
39 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
6 | PLatexObj bio(platexobj_createParagraph("", "")); |
40 |
5/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 3 times.
|
3 | bio.getVecContent().push_back(platexobj_createTextBf("Bio : ", "")); |
41 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | bio.getVecContent().push_back(platexobj_createNewLine()); |
42 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | appendVecContent(bio.getVecContent(), speaker.getDescription().getVecContent()); |
43 |
1/1✓ Branch 1 taken 3 times.
|
3 | vecContent.push_back(bio); |
44 | 3 | } | |
45 | 39 | } | |
46 | |||
47 | |||
48 | ///Save all speakers of the given PTimeTable into a vector of PLatexObj | ||
49 | /** @param[out] vecContent : vector of PLatexObj to be completed | ||
50 | * @param vecSpeaker : vector of PLatexSpeaker to be saved | ||
51 | * @param sectionLabel : label of the created Chapter section | ||
52 | */ | ||
53 | 3 | void pspeaker_tex(std::vector<PLatexObj> & vecContent, const std::vector<PLatexSpeaker> & vecSpeaker, const PString & sectionLabel){ | |
54 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
3 | if(vecSpeaker.size() == 0lu){return;} //If there is not speakers we do not create chapter for that |
55 |
3/3✓ Branch 2 taken 3 times.
✓ Branch 5 taken 3 times.
✓ Branch 8 taken 3 times.
|
3 | vecContent.push_back(platexobj_createSection(PLatexType::CHAPTER, platexobj_parseStr("Speakers"), sectionLabel)); |
56 |
3/3✓ Branch 2 taken 3 times.
✓ Branch 5 taken 3 times.
✓ Branch 8 taken 3 times.
|
3 | vecContent.push_back(platexobj_createText("Here you can find all speakers of the timetable.", "")); |
57 |
2/2✓ Branch 4 taken 39 times.
✓ Branch 5 taken 3 times.
|
42 | for(std::vector<PLatexSpeaker>::const_iterator it(vecSpeaker.begin()); it != vecSpeaker.end(); ++it){ |
58 |
1/1✓ Branch 2 taken 39 times.
|
39 | pspeaker_texSpeaker(vecContent, *it); |
59 | } | ||
60 | } | ||
61 | |||
62 | ///Save all speakers of the given PTimeTable into a vector of PLatexObj | ||
63 | /** @param[out] vecContent : vector of PLatexObj to be completed | ||
64 | * @param timetable : PTimeTable to be used | ||
65 | */ | ||
66 | 2 | void pspeaker_tex(std::vector<PLatexObj> & vecContent, const PTimeTable & timetable){ | |
67 | 2 | const std::vector<PLatexSpeaker> & vecSpeaker = timetable.getVecSpeaker(); | |
68 |
2/2✓ Branch 3 taken 2 times.
✓ Branch 6 taken 2 times.
|
2 | pspeaker_tex(vecContent, vecSpeaker, "sec_speaker_"+timetable.getInvitation()); |
69 | 2 | } | |
70 | |||
71 |