PhoenixLecture  2.0.0
Set of tools to make lectures
platexobj_text.cpp File Reference
#include "platexobj_html.h"
#include "platexobj_text.h"
+ Include dependency graph for platexobj_text.cpp:

Go to the source code of this file.

Functions

PString platexobj_htmlStrImage (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_text (const PLatexObj &obj)
 Convert a PLatexObj in text. More...
 
PString platexobj_text (const std::vector< PLatexObj > &vecObj)
 Convert a PLatexObj in text. More...
 
PString platexobj_textExtraFunction (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_textFile (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_textHref (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 

Function Documentation

◆ platexobj_htmlStrImage()

PString platexobj_htmlStrImage ( const PLatexObj obj)

Convert a PLatexObj into a string.

Parameters
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 53 of file platexobj_text.cpp.

53  {
54  PString body("");
55 // option(obj.getText());
56  body += "<img id=\""+valueToString(obj.getId())+"\" src=\"" + obj.getName() + "\"";
57 // if(option != ""){ //Not a good idea for now, because firefox does not like this style property
58 // body += " style=\""+replaceCharInStr(option, '=', ':')+"%\"";
59 // }
60  body += " alt=\"nothing\" />" + platexobj_createLabelSearchLink(obj.getLabelName());
61  return body;
62 }
const PString & getLabelName() const
Gets the labelName of the PLatexObj.
Definition: PLatexObj.cpp:354
const PString & getName() const
Gets the name of the PLatexObj.
Definition: PLatexObj.cpp:326
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.
PString platexobj_createLabelSearchLink(const PString &labelName)
Create the link to the label of the current PLatexObj if it exist.

References PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getName(), platexobj_createLabelSearchLink(), and valueToString().

Referenced by platexobj_text().

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

◆ platexobj_text() [1/2]

PString platexobj_text ( const PLatexObj obj)

Convert a PLatexObj in text.

Parameters
obj: PLatexObj
Returns
corresponding text

Definition at line 81 of file platexobj_text.cpp.

81  {
82  PString body("");
83  PLatexType::PLatexType type(obj.getType());
84  if(type == PLatexType::TEXT){body = platexobj_htmlStrText(obj);}
85  else if(type == PLatexType::URL){body = platexobj_htmlStrUrl(obj);}
86  else if(type == PLatexType::GETENV){body = platexobj_htmlStrGetEnv(obj);}
87  else if(type == PLatexType::PERCENT){body += "%";}
88  else if(type == PLatexType::REF){body = platexobj_htmlStrRef(obj);}
89 
90  else if(type == PLatexType::HREF){body = platexobj_textHref(obj);}
91  else if(type == PLatexType::TEXTBF){body = platexobj_htmlStrTextBf(obj);}
92  else if(type == PLatexType::TEXTIT){body = platexobj_htmlStrTextIt(obj);}
93  else if(type == PLatexType::DEBUG){body = platexobj_htmlStrTextDebug(obj);}
94  else if(type == PLatexType::FUNCTION){body = platexobj_textExtraFunction(obj);}
95  else if(type == PLatexType::IMAGE){body = platexobj_htmlStrImage(obj);}
96  else if(type == PLatexType::FILE){body = platexobj_textFile(obj);}
97  return body;
98 }
const PLatexType::PLatexType & getType() const
Gets the type of the PLatexObj.
Definition: PLatexObj.cpp:298
PLatexType
Type of the PLatexObj.
Definition: PLatexType.h:12
PString platexobj_htmlStrUrl(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrTextDebug(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrTextBf(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrText(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrGetEnv(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrRef(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrTextIt(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_textFile(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_textHref(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_textExtraFunction(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrImage(const PLatexObj &obj)
Convert a PLatexObj into a string.

References PLatexType::DEBUG, PLatexType::FILE, PLatexType::FUNCTION, PLatexType::GETENV, PLatexObj::getType(), PLatexType::HREF, PLatexType::IMAGE, PLatexType::PERCENT, platexobj_htmlStrGetEnv(), platexobj_htmlStrImage(), platexobj_htmlStrRef(), platexobj_htmlStrText(), platexobj_htmlStrTextBf(), platexobj_htmlStrTextDebug(), platexobj_htmlStrTextIt(), platexobj_htmlStrUrl(), platexobj_textExtraFunction(), platexobj_textFile(), platexobj_textHref(), PLatexType::REF, PLatexType::TEXT, PLatexType::TEXTBF, PLatexType::TEXTIT, and PLatexType::URL.

+ Here is the call graph for this function:

◆ platexobj_text() [2/2]

PString platexobj_text ( const std::vector< PLatexObj > &  vecObj)

Convert a PLatexObj in text.

Parameters
vecObj: vector of PLatexObj
Returns
corresponding text

Definition at line 41 of file platexobj_text.cpp.

41  {
42  PString body("");
43  for(std::vector<PLatexObj>::const_iterator it(vecObj.begin()); it != vecObj.end(); ++it){
44  body += platexobj_text(*it);
45  }
46  return body;
47 }
PString platexobj_text(const std::vector< PLatexObj > &vecObj)
Convert a PLatexObj in text.

Referenced by PGenericParser::executeLatexCommand(), platexobj_htmlStrRef(), platexobj_textExtraFunction(), platexobj_textFile(), platexobj_textHref(), platexobj_toMenu(), and platexobj_toMenuAll().

+ Here is the caller graph for this function:

◆ platexobj_textExtraFunction()

PString platexobj_textExtraFunction ( const PLatexObj obj)

Convert a PLatexObj into a string.

Parameters
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 29 of file platexobj_text.cpp.

29  {
30  PString body("");
31  body += "<"+obj.getBalise()+" id=\""+valueToString(obj.getId())+"\" class=\"" + obj.getName() + "Style\">";
33  body += "</"+obj.getBalise()+">";
34  return body;
35 }
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
Definition: PLatexObj.cpp:410
const PString & getBalise() const
Gets the balise of the PLatexObj.
Definition: PLatexObj.cpp:382

References PLatexObj::getBalise(), PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getName(), PLatexObj::getVecContent(), platexobj_createLabelSearchLink(), platexobj_text(), and valueToString().

Referenced by platexobj_text().

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

◆ platexobj_textFile()

PString platexobj_textFile ( const PLatexObj obj)

Convert a PLatexObj into a string.

Parameters
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 68 of file platexobj_text.cpp.

68  {
69  PString body("");
70  const PVecLatexObj & vecObj = obj.getVecContent();
71  for(PVecLatexObj::const_iterator it(vecObj.begin()); it != vecObj.end(); ++it){
72  body += platexobj_text(*it);
73  }
74  return body;
75 }
std::vector< PLatexObj > PVecLatexObj
Vector of obj.

References PLatexObj::getVecContent(), and platexobj_text().

Referenced by platexobj_text().

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

◆ platexobj_textHref()

PString platexobj_textHref ( const PLatexObj obj)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 17 of file platexobj_text.cpp.

17  {
18  PString body("");
19  body += "<a id=\""+valueToString(obj.getId())+"\" href=\"" + obj.getName() + "\">";
20  body += platexobj_text(obj.getVecContent());
21  body += "</a>";
22  return body;
23 }

References PLatexObj::getId(), PLatexObj::getName(), PLatexObj::getVecContent(), platexobj_text(), and valueToString().

Referenced by platexobj_text().

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