PhoenixLecture  2.0.0
Set of tools to make lectures
PGenericParser.cpp File Reference
#include "data_all.h"
#include "pxml_utils.h"
#include "PConfigParser.h"
#include "PLatexObj/platexobj_text.h"
#include "PGenericParser.h"
+ Include dependency graph for PGenericParser.cpp:

Go to the source code of this file.

Functions

PVecString getBeginSeqEnv (const PString &envName)
 Get the sequence of the begining of an environement. More...
 
PVecString getEndSeqEnv (const PString &envName)
 Get the sequence of the ending of an environement. More...
 
void setBoolFromAttr (bool &isAllowComment, const PXml &xml, const PString &name)
 Get a boolean from xml attribute. More...
 
bool wgetFile (const PString &url)
 Do a wget of a file. More...
 

Function Documentation

◆ getBeginSeqEnv()

PVecString getBeginSeqEnv ( const PString envName)

Get the sequence of the begining of an environement.

Parameters
envName: name of the environement
Returns
corresponding sequence

Definition at line 27 of file PGenericParser.cpp.

27  {
28  PVecString vecEndPatern;
29  vecEndPatern.push_back("\\begin");
30  vecEndPatern.push_back("{");
31  vecEndPatern.push_back(envName);
32  vecEndPatern.push_back("}");
33  return vecEndPatern;
34 }
std::vector< PString > PVecString
Definition: PString.h:96

Referenced by PConfigParser::parseEnvironement(), PConfigParser::parserDetails(), PConfigParser::parserQuote(), and PConfigParser::parseTabular().

+ Here is the caller graph for this function:

◆ getEndSeqEnv()

PVecString getEndSeqEnv ( const PString envName)

Get the sequence of the ending of an environement.

Parameters
envName: name of the environement
Returns
corresponding sequence

Definition at line 40 of file PGenericParser.cpp.

40  {
41  PVecString vecEndPatern;
42  vecEndPatern.push_back("\\end");
43  vecEndPatern.push_back("{");
44  vecEndPatern.push_back(envName);
45  vecEndPatern.push_back("}");
46  return vecEndPatern;
47 }

Referenced by PConfigParser::parseEnvironementContent(), PConfigParser::parserDetails(), PConfigParser::parserQuote(), and PConfigParser::parseTabular().

+ Here is the caller graph for this function:

◆ setBoolFromAttr()

void setBoolFromAttr ( bool &  isAllowComment,
const PXml xml,
const PString name 
)

Get a boolean from xml attribute.

Parameters
[out]isAllowComment: boolean to be set
xml: main balise
name: name of the attribute

Definition at line 561 of file PGenericParser.cpp.

561  {
562  PXmlAttr attr;
563  if(pxml_getAttrIfExist(attr, xml, name)){
564  PString value = attr.getValue().toLower();
565  isAllowComment = value == "yes" || value == "1" || value == "y";
566  }
567 }
Extends the std::string.
Definition: PString.h:16
PString toLower() const
Convert PString in lower case.
Definition: PString.cpp:598
Attribute from xml.
Definition: PXml.h:30
const PString & getValue() const
Get the variable p_value.
Definition: PXml.cpp:82
bool pxml_getAttrIfExist(PXmlAttr &attr, const PXml &xml, const PString &attrName)
Get the attribute with given name if exist.
Definition: pxml_utils.cpp:251

References PXmlAttr::getValue(), pxml_getAttrIfExist(), and PString::toLower().

Referenced by PGenericParser::loadDirExtraEnvironementFile().

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

◆ wgetFile()

bool wgetFile ( const PString url)

Do a wget of a file.

Parameters
url: url to be used
Returns
true on success, false otherwise

Definition at line 18 of file PGenericParser.cpp.

18  {
19  PString command("wget \""+url+"\"");
20  return system(command.c_str()) != 0;
21 }

Referenced by PConfigParser::loadInclude().

+ Here is the caller graph for this function: