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

Go to the source code of this file.

Functions

PLatexObj platexobj_parseStr (const PString &latexStr)
 Parse a str and convert it into a PLatexObj. More...
 
bool platexobj_parseStr (PLatexObj &obj, const PString &latexStr)
 Parse a str and convert it into a PLatexObj. More...
 

Function Documentation

◆ platexobj_parseStr() [1/2]

PLatexObj platexobj_parseStr ( const PString latexStr)

Parse a str and convert it into a PLatexObj.

Parameters
latexStr: string to be parsed
Returns
PLatexObj of parsed string

Definition at line 30 of file platexobj_parse.cpp.

30  {
31  PLatexObj obj;
32  platexobj_parseStr(obj, latexStr);
33  return obj;
34 }
Describe a latex object.
Definition: PLatexObj.h:40
bool platexobj_parseStr(PLatexObj &obj, const PString &latexStr)
Parse a str and convert it into a PLatexObj.

References platexobj_parseStr().

+ Here is the call graph for this function:

◆ platexobj_parseStr() [2/2]

bool platexobj_parseStr ( PLatexObj obj,
const PString latexStr 
)

Parse a str and convert it into a PLatexObj.

Parameters
[out]obj: PLatexObj of parsed string
latexStr: string to be parsed
Returns
true on success, false otherwise

Definition at line 14 of file platexobj_parse.cpp.

14  {
15  PConfigParser parser;
16  parser.setFileContent(latexStr + "\n");
17  if(!parser.fullParsing()){
18  std::cerr << "platexobj_parseStr : cannot parse string '"<<latexStr<<"'" << std::endl;
19  return false;
20  }
21  obj = parser.getSource();
23  return true;
24 }
Parse the pdata confguration file.
Definition: PConfigParser.h:13
const PLatexObj & getSource() const
Get the current source.
void setType(const PLatexType::PLatexType &type)
Sets the type of the PLatexObj.
Definition: PLatexObj.cpp:130
void setFileContent(const PString &fileContent)
Set the file content to be parsed.
bool fullParsing()
Perform the full parsing pf data.

References PMultiFileParser::fullParsing(), PGenericParser::getSource(), PLatexType::NONE, PMultiFileParser::setFileContent(), and PLatexObj::setType().

Referenced by platexobj_parseStr(), pspeaker_tex(), and ptimetable_parseLatexAttribute().

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