PhoenixLecture  2.0.0
Set of tools to make lectures
platexobj_updateFileName.cpp File Reference
+ Include dependency graph for platexobj_updateFileName.cpp:

Go to the source code of this file.

Functions

void platexobj_updateFileName (PLatexObj &obj)
 Update the fileName of the PLatexObj part,chapter,section,subsection,subsubsection. More...
 
void platexobj_updateLink (PLatexObj &obj)
 Update the html link. More...
 
void platexobj_updateLink (PLatexObj &obj, const PPath &htmlFile)
 Update the html link. More...
 

Function Documentation

◆ platexobj_updateFileName()

void platexobj_updateFileName ( PLatexObj obj)

Update the fileName of the PLatexObj part,chapter,section,subsection,subsubsection.

Parameters
[out]obj: PLatexObj to be updated

Definition at line 14 of file platexobj_updateFileName.cpp.

14  {
15  if(!isSection(obj) && obj.getType() != PLatexType::FILE){return;}
16 
17  if(obj.getType() != PLatexType::FILE){
18  PString fileName("");
19  PVecNumber & vecNumber = obj.getVecSecNumber();
20  for(PVecNumber::iterator it(vecNumber.begin()); it != vecNumber.end(); ++it){
21  fileName += valueToString(*it) + "-";
22  }
23  fileName += valueToString(obj.getId());
24  fileName += ".html";
25  obj.setLink(fileName);
26  }
27  PVecLatexObj & vecContent = obj.getVecContent();
28  if(vecContent.size() != 0lu){
29  for(PVecLatexObj::iterator it(vecContent.begin()); it != vecContent.end(); ++it){
31  }
32  }
33 }
void setLink(const PString &link)
Sets the link of the PLatexObj.
Definition: PLatexObj.cpp:165
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
Definition: PLatexObj.cpp:410
const PLatexType::PLatexType & getType() const
Gets the type of the PLatexObj.
Definition: PLatexObj.cpp:298
const std::vector< long unsigned int > & getVecSecNumber() const
Gets the vecSecNumber of the PLatexObj.
Definition: PLatexObj.cpp:438
long unsigned int getId() const
Gets the id of the PLatexObj.
Definition: PLatexObj.cpp:284
Extends the std::string.
Definition: PString.h:16
std::string valueToString(const T &val)
Convert a type into a string.
void platexobj_updateFileName(PLatexObj &obj)
Update the fileName of the PLatexObj part,chapter,section,subsection,subsubsection.
bool isSection(const PLatexObj &obj)
Say if the PLatexObj is a part, charpter, section, subsection or subsubsection.
std::vector< long unsigned int > PVecNumber
Vector of section number.
std::vector< PLatexObj > PVecLatexObj
Vector of obj.

References PLatexType::FILE, PLatexObj::getId(), PLatexObj::getType(), PLatexObj::getVecContent(), PLatexObj::getVecSecNumber(), isSection(), PLatexObj::setLink(), and valueToString().

Referenced by processAllFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ platexobj_updateLink() [1/2]

void platexobj_updateLink ( PLatexObj obj)

Update the html link.

Parameters
[out]obj: PLatexObj to be updated

Definition at line 59 of file platexobj_updateFileName.cpp.

59  {
60  PPath tmp("index.html");
61  platexobj_updateLink(obj, tmp);
62 }
Path of a directory or a file.
Definition: PPath.h:17
void platexobj_updateLink(PLatexObj &obj, const PPath &htmlFile)
Update the html link.

References platexobj_updateLink().

+ Here is the call graph for this function:

◆ platexobj_updateLink() [2/2]

void platexobj_updateLink ( PLatexObj obj,
const PPath htmlFile 
)

Update the html link.

Parameters
[out]obj: PLatexObj to be updated
htmlFile: link of the current file

Definition at line 39 of file platexobj_updateFileName.cpp.

39  {
40  if(isSection(obj)){
41  PVecLatexObj & vecObj = obj.getVecContent();
42  for(PVecLatexObj::iterator it(vecObj.begin()); it != vecObj.end(); ++it){
43  platexobj_updateLink(*it, obj.getLink());
44  }
45  }else{
46  if(obj.getType() != PLatexType::FILE){
47  obj.setLink(htmlFile + PPath("#" + valueToString(obj.getId())));
48  }
49  PVecLatexObj & vecObj = obj.getVecContent();
50  for(PVecLatexObj::iterator it(vecObj.begin()); it != vecObj.end(); ++it){
51  platexobj_updateLink(*it, htmlFile);
52  }
53  }
54 }
const PString & getLink() const
Gets the link of the PLatexObj.
Definition: PLatexObj.cpp:368

References PLatexType::FILE, PLatexObj::getId(), PLatexObj::getLink(), PLatexObj::getType(), PLatexObj::getVecContent(), isSection(), PLatexObj::setLink(), and valueToString().

Referenced by platexobj_updateLink(), and processAllFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: