12 using ParamSet = std::map<std::string, Eval::Value>;
18 std::shared_ptr<MBXMLUtils::DOMParser>,
20 boost::filesystem::path
22 bool trackDependencies);
27 std::shared_ptr<MBXMLUtils::DOMParser>,
29 boost::filesystem::path
31 bool trackDependencies);
34 Preprocess(
const std::shared_ptr<xercesc::DOMDocument> &inputDoc,
bool trackDependencies);
38 void setCheckInterruptFunction(
const std::function<
void()> &func) {
39 checkInterruptFunc=func;
43 void setParam(
const std::shared_ptr<ParamSet>& param_);
45 std::shared_ptr<ParamSet>
getParam()
const;
62 std::shared_ptr<xercesc::DOMDocument> document;
63 std::unique_ptr<std::vector<boost::filesystem::path>> dependencies;
64 std::shared_ptr<Eval> eval;
65 std::shared_ptr<ParamSet> param;
66 std::shared_ptr<DOMParser> noneValidatingParser;
67 static const FQN embedFileNotFound;
69 std::function<void()> checkInterruptFunc;
70 void checkInterrupt() {
71 if(checkInterruptFunc)
75 bool preprocessed {
false };
77 std::shared_ptr<DOMParser> initDependenciesAndParser(std::variant<
78 std::shared_ptr<MBXMLUtils::DOMParser>,
80 boost::filesystem::path
82 bool trackDependencies);
84 std::map<boost::filesystem::path, std::shared_ptr<xercesc::DOMDocument>> parsedFiles;
85 std::shared_ptr<xercesc::DOMDocument> parseCached(
const std::shared_ptr<DOMParser> &parser,
86 const boost::filesystem::path &inputFile,
87 const std::string &msg,
bool allowUnknownRootElement=
false);
89 std::map<size_t, std::shared_ptr<xercesc::DOMDocument>> parsedStream;
90 std::shared_ptr<xercesc::DOMDocument> parseCached(
const std::shared_ptr<DOMParser> &parser,
91 std::istream &inputStream,
92 const std::string &msg,
bool allowUnknownRootElement=
false);
94 void extractEvaluator();
97 xercesc::DOMElement *&e,
99 int &nrElementsEmbeded,
101 const std::shared_ptr<ParamSet>& param=std::shared_ptr<ParamSet>(),
104 int embedXPathCount=1
Preprocess(const boost::filesystem::path &inputFile, std::variant< std::shared_ptr< MBXMLUtils::DOMParser >, xercesc::DOMElement *, boost::filesystem::path > parserVariant, bool trackDependencies)
std::shared_ptr< ParamSet > getParam() const
Get available top level parameters after processAndGetDocument is called.
Definition preprocess.cc:108
Preprocess(std::istream &inputStream, std::variant< std::shared_ptr< MBXMLUtils::DOMParser >, xercesc::DOMElement *, boost::filesystem::path > parserVariant, bool trackDependencies)
void setParam(const std::shared_ptr< ParamSet > ¶m_)
Set top level parameters to overwrite before processAndGetDocument is called.
Definition preprocess.cc:104