PhoenixLecture  2.0.0
Set of tools to make lectures
platexobj_updateNumber.h File Reference
#include "platexobj_utils.h"
+ Include dependency graph for platexobj_updateNumber.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void platexobj_updateNumber (PLatexObj &obj)
 Update the vector number of the PLatexObj. More...
 
void platexobj_updateNumber (PLatexObj &obj, PVecNumber &vecNumber)
 Update the vector number of the PLatexObj. More...
 

Function Documentation

◆ platexobj_updateNumber() [1/2]

void platexobj_updateNumber ( PLatexObj obj)

Update the vector number of the PLatexObj.

Parameters
[out]obj: PLatexObj to be updated

Definition at line 54 of file platexobj_updateNumber.cpp.

54  {
55  PVecNumber vecNumber;
56  vecNumber.push_back(0lu);
57  platexobj_updateNumber(obj, vecNumber);
58 }
void platexobj_updateNumber(PLatexObj &obj, PVecNumber &vecNumber)
Update the vector number of the PLatexObj.
std::vector< long unsigned int > PVecNumber
Vector of section number.

References platexobj_updateNumber().

+ Here is the call graph for this function:

◆ platexobj_updateNumber() [2/2]

void platexobj_updateNumber ( PLatexObj obj,
PVecNumber vecNumber 
)

Update the vector number of the PLatexObj.

Parameters
[out]obj: PLatexObj to be updated
[out]vecNumber: vector of the section number

Definition at line 37 of file platexobj_updateNumber.cpp.

37  {
38  PVecLatexObj & vecContent = obj.getVecContent();
39  for(PVecLatexObj::iterator it(vecContent.begin()); it != vecContent.end(); ++it){
40  if(!isSection(*it)){continue;}
41  PLatexType::PLatexType type(it->getType());
42  if(type == PLatexType::PART){it->getVecSecNumber() = copyAddVecNumber(vecNumber, 0lu);}
43  else if(type == PLatexType::CHAPTER){it->getVecSecNumber() = copyAddVecNumber(vecNumber, 1lu);}
44  else if(type == PLatexType::SECTION){it->getVecSecNumber() = copyAddVecNumber(vecNumber, 2lu);}
45  else if(type == PLatexType::SUBSECTION){it->getVecSecNumber() = copyAddVecNumber(vecNumber, 3lu);}
46  else if(type == PLatexType::SUBSUBSECTION){it->getVecSecNumber() = copyAddVecNumber(vecNumber, 4lu);}
47  platexobj_updateNumber(*it, vecNumber);
48  }
49 }
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
Definition: PLatexObj.cpp:410
PLatexType
Type of the PLatexObj.
Definition: PLatexType.h:12
@ SUBSUBSECTION
Definition: PLatexType.h:54
PVecNumber copyAddVecNumber(PVecNumber &vecNumber, long unsigned int numberIndex)
Update the vecNumber and return the proper vector.
bool isSection(const PLatexObj &obj)
Say if the PLatexObj is a part, charpter, section, subsection or subsubsection.
std::vector< PLatexObj > PVecLatexObj
Vector of obj.

References PLatexType::CHAPTER, copyAddVecNumber(), PLatexObj::getVecContent(), isSection(), PLatexType::PART, PLatexType::SECTION, PLatexType::SUBSECTION, and PLatexType::SUBSUBSECTION.

Referenced by platexobj_updateNumber(), and processAllFile().

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