Blame view

src/expressionParser/ParserToolbox.cc 1.83 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"
ea6be348   Benjamin Renard   Support arguments...
13
#include "FunctionsArgsListParser.hh"
93f280a8   Benjamin Renard   Implements templa...
14
#include "TemplateParamsParser.hh"
d6222ff6   Benjamin Renard   Parser: get list ...
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

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...
30
std::map<std::string, std::string> ParserToolbox::getConstants(AMDA::helpers::Properties& lProperties) {
d6222ff6   Benjamin Renard   Parser: get list ...
31
32
33
34
	AMDA::parser::ConstantsParser parser(lProperties["app.ihmConstants.xsd"].c_str());
	return parser.parse(lProperties["app.ihmConstants.xml"]);
}

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

ea6be348   Benjamin Renard   Support arguments...
40
41
42
43
44
ArgListInfoMap ParserToolbox::getArgsLists(AMDA::helpers::Properties& lProperties) {
	AMDA::parser::FunctionsArgsListParser parser(lProperties["app.ihmFunctionsArgsList.xsd"].c_str());
	return parser.parse(lProperties["app.ihmFunctionsArgsList.xml"]);
}

93f280a8   Benjamin Renard   Implements templa...
45
46
47
48
49
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 ...
50
51
} /* namespace parser */
} /* namespace AMDA */