PhoenixLecture  2.0.0
Set of tools to make lectures
platexobj_parse.cpp
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 #include "platexobj_parse.h"
8 
10 
14 bool platexobj_parseStr(PLatexObj & obj, const PString & latexStr){
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 }
25 
27 
31  PLatexObj obj;
32  platexobj_parseStr(obj, latexStr);
33  return obj;
34 }
35 
Parse the pdata confguration file.
Definition: PConfigParser.h:13
const PLatexObj & getSource() const
Get the current source.
Describe a latex object.
Definition: PLatexObj.h:40
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.
Extends the std::string.
Definition: PString.h:16
bool platexobj_parseStr(PLatexObj &obj, const PString &latexStr)
Parse a str and convert it into a PLatexObj.