1 /*
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2015 - Scilab Enterprises - Calixte DENIZET
4 *
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
10 *
11 */
12
13 #include "config/cnes/AnalysisConfigurationType.hxx"
14 #include "XMLtools.hxx"
15
16 namespace slint
17 {
18
19 namespace CNES
20 {
21
createFromXmlNode(xmlNode * node)22 AnalysisConfigurationType AnalysisConfigurationType::createFromXmlNode(xmlNode * node)
23 {
24 std::string id;
25 std::string name;
26 std::string toolConfigurationId;
27 std::string projectDevLevel;
28
29 slint::XMLtools::getString(node, "analysisConfigurationId", id);
30 slint::XMLtools::getString(node, "analysisConfigurationName", name);
31 slint::XMLtools::getString(node, "toolConfigurationId", toolConfigurationId);
32 slint::XMLtools::getString(node, "projectDevLevel", projectDevLevel);
33
34 AnalysisConfigurationType act(id, name, toolConfigurationId, projectDevLevel);
35 for (xmlNode * child = node->children; child; child = child->next)
36 {
37 std::string name((const char *)child->name);
38 if (name == "excludedProjectFile")
39 {
40 act.add(ExcludedProjectFileType::createFromXmlNode(child));
41 }
42 else if (name == "analysisRule")
43 {
44 act.add(AnalysisRuleType::createFromXmlNode(child));
45 }
46 }
47
48 return act;
49 }
50
51 } // namespace CNES
52
53 } // namespace slint
54