Blame view

src/expressionParser/ParserToolbox.cc 1.55 KB
d6222ff6   Benjamin Renard   Parser: get list ...
1
2
3
4
5
6
7
8
9
10
11
/*
 * ParserToolbox.cc
 *
 *  Created on: Mar 18, 2019
 *      Author: AKKA
 */

#include "ParserToolbox.hh"

#include "Helper.hh"
#include "ConstantsParser.hh"
0d5a1aa5   Benjamin Renard   Parser: add a fun...
12
#include "FunctionsParser.hh"
93f280a8   Benjamin Renard   Implements templa...
13
#include "TemplateParamsParser.hh"
d6222ff6   Benjamin Renard   Parser: get list ...
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

namespace AMDA {
namespace parser {

std::vector<std::string> ParserToolbox::getParameters(AMDA::helpers::Properties& lProperties) {
	std::vector<std::string> files = std::vector<std::string>();
	AMDA::Helpers::Helper::getMatchFiles(lProperties["app.param.path"].c_str(), files, ".*.xml$");
	std::vector<std::string> parameters = std::vector<std::string>();
	for (std::vector<std::string>::iterator it = files.begin(); it != files.end(); ++it) {
		size_t lastindex = (*it).find_last_of("."); 
		parameters.push_back((*it).substr(0, lastindex));
	}
	return parameters;
}

e58d7be4   Benjamin Renard   Parser: Add const...
29
std::map<std::string, std::string> ParserToolbox::getConstants(AMDA::helpers::Properties& lProperties) {
d6222ff6   Benjamin Renard   Parser: get list ...
30
31
32
33
	AMDA::parser::ConstantsParser parser(lProperties["app.ihmConstants.xsd"].c_str());
	return parser.parse(lProperties["app.ihmConstants.xml"]);
}

0d5a1aa5   Benjamin Renard   Parser: add a fun...
34
35
36
37
38
FunctionInfoMap ParserToolbox::getFunctions(AMDA::helpers::Properties& lProperties) {
	AMDA::parser::FunctionsParser parser(lProperties["app.ihmFunctions.xsd"].c_str());
	return parser.parse(lProperties["app.ihmFunctions.xml"]);
}

93f280a8   Benjamin Renard   Implements templa...
39
40
41
42
43
TemplateParamsList ParserToolbox::getTemplateParams(AMDA::helpers::Properties& lProperties) {
	AMDA::parser::TemplateParamsParser parser(lProperties["app.ihmTemplateParams.xsd"].c_str());
	return parser.parse(lProperties["app.ihmTemplateParams.xml"]);
}

d6222ff6   Benjamin Renard   Parser: get list ...
44
45
} /* namespace parser */
} /* namespace AMDA */