mbxmlutils  1.3.0
Multi-Body XML Utils
MBXMLUtils::Preprocess Class Reference
Inheritance diagram for MBXMLUtils::Preprocess:
[legend]

Public Types

using ParamSet = std::map< std::string, Eval::Value >
 

Public Member Functions

 Preprocess (const boost::filesystem::path &inputFile, std::variant< std::shared_ptr< MBXMLUtils::DOMParser >, xercesc::DOMElement *, boost::filesystem::path > parserVariant, bool trackDependencies)
 
 Preprocess (std::istream &inputStream, std::variant< std::shared_ptr< MBXMLUtils::DOMParser >, xercesc::DOMElement *, boost::filesystem::path > parserVariant, bool trackDependencies)
 
 Preprocess (const std::shared_ptr< xercesc::DOMDocument > &inputDoc, bool trackDependencies)
 
void setCheckInterruptFunction (const std::function< void()> &func)
 
void setParam (const std::shared_ptr< ParamSet > &param_)
 Set top level parameters to overwrite before processAndGetDocument is called.
 
std::shared_ptr< ParamSet > getParam () const
 Get available top level parameters after processAndGetDocument is called.
 
std::shared_ptr< EvalgetEvaluator () const
 Get the evaluator.
 
const std::vector< boost::filesystem::path > & getDependencies () const
 Get all dependencies found during processAndGetDocument.
 
std::shared_ptr< xercesc::DOMDocument > processAndGetDocument ()
 Start preprocessing and return the preprocessed DOMDocument.
 
std::shared_ptr< xercesc::DOMDocument > getDOMDocument ()
 

Private Member Functions

void checkInterrupt ()
 
std::shared_ptr< DOMParserinitDependenciesAndParser (std::variant< std::shared_ptr< MBXMLUtils::DOMParser >, xercesc::DOMElement *, boost::filesystem::path > parserVariant, bool trackDependencies)
 
std::shared_ptr< xercesc::DOMDocument > parseCached (const std::shared_ptr< DOMParser > &parser, const boost::filesystem::path &inputFile, const std::string &msg, bool allowUnknownRootElement=false)
 
std::shared_ptr< xercesc::DOMDocument > parseCached (const std::shared_ptr< DOMParser > &parser, std::istream &inputStream, const std::string &msg, bool allowUnknownRootElement=false)
 
void extractEvaluator ()
 
bool preprocess (xercesc::DOMElement *&e, int &nrElementsEmbeded, const std::shared_ptr< ParamSet > &param=std::shared_ptr< ParamSet >(), int embedXPathCount=1)
 

Private Attributes

std::shared_ptr< xercesc::DOMDocument > document
 
std::unique_ptr< std::vector< boost::filesystem::path > > dependencies
 
std::shared_ptr< Evaleval
 
std::shared_ptr< ParamSet > param
 
std::shared_ptr< DOMParsernoneValidatingParser
 
std::function< void()> checkInterruptFunc
 
bool preprocessed { false }
 
std::map< boost::filesystem::path, std::shared_ptr< xercesc::DOMDocument > > parsedFiles
 
std::map< size_t, std::shared_ptr< xercesc::DOMDocument > > parsedStream
 

Static Private Attributes

static const FQN embedFileNotFound = PV%"NoneExistentEmbedHref"
 

Constructor & Destructor Documentation

◆ Preprocess() [1/3]

MBXMLUtils::Preprocess::Preprocess ( const boost::filesystem::path &  inputFile,
std::variant< std::shared_ptr< MBXMLUtils::DOMParser >, xercesc::DOMElement *, boost::filesystem::path >  parserVariant,
bool  trackDependencies 
)

Instantiate a preprocessor using a inputFile and a parser. The inputFile is read and validated.

◆ Preprocess() [2/3]

MBXMLUtils::Preprocess::Preprocess ( std::istream &  inputStream,
std::variant< std::shared_ptr< MBXMLUtils::DOMParser >, xercesc::DOMElement *, boost::filesystem::path >  parserVariant,
bool  trackDependencies 
)

Instantiate a preprocessor using a input stream and a parser. The input stream is read and validated.

◆ Preprocess() [3/3]

MBXMLUtils::Preprocess::Preprocess ( const std::shared_ptr< xercesc::DOMDocument > &  inputDoc,
bool  trackDependencies 
)

Instantiate a preprocessor using a already parsed DOMDocument The inputDoc is validated.

Member Function Documentation

◆ getDOMDocument()

std::shared_ptr< xercesc::DOMDocument > MBXMLUtils::Preprocess::getDOMDocument ( )
inline

Get the DOMDocument. This may be the unprocessed DOMDocument if called before processAndGetDocument or the processed DOMDocument if called after processAndGetDocument.


The documentation for this class was generated from the following files: