/* * ParserToolbox.cc * * Created on: Mar 18, 2019 * Author: AKKA */ #include "ParserToolbox.hh" #include "Helper.hh" #include "ConstantsParser.hh" #include "FunctionsParser.hh" #include "TemplateParamsParser.hh" namespace AMDA { namespace parser { std::vector ParserToolbox::getParameters(AMDA::helpers::Properties& lProperties) { std::vector files = std::vector(); AMDA::Helpers::Helper::getMatchFiles(lProperties["app.param.path"].c_str(), files, ".*.xml$"); std::vector parameters = std::vector(); for (std::vector::iterator it = files.begin(); it != files.end(); ++it) { size_t lastindex = (*it).find_last_of("."); parameters.push_back((*it).substr(0, lastindex)); } return parameters; } std::map ParserToolbox::getConstants(AMDA::helpers::Properties& lProperties) { AMDA::parser::ConstantsParser parser(lProperties["app.ihmConstants.xsd"].c_str()); return parser.parse(lProperties["app.ihmConstants.xml"]); } FunctionInfoMap ParserToolbox::getFunctions(AMDA::helpers::Properties& lProperties) { AMDA::parser::FunctionsParser parser(lProperties["app.ihmFunctions.xsd"].c_str()); return parser.parse(lProperties["app.ihmFunctions.xml"]); } TemplateParamsList ParserToolbox::getTemplateParams(AMDA::helpers::Properties& lProperties) { AMDA::parser::TemplateParamsParser parser(lProperties["app.ihmTemplateParams.xsd"].c_str()); return parser.parse(lProperties["app.ihmTemplateParams.xml"]); } } /* namespace parser */ } /* namespace AMDA */