SHAPER  9.12.0
Config_Common.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef CONFIG_COMMON_H_
21 #define CONFIG_COMMON_H_
22 
23 #include "Config_def.h"
24 
25 #include <string>
26 #include <list>
27 #include <stdarg.h>
28 
29 //>> Forward declaration of xmlNodePtr.
30 typedef struct _xmlNode xmlNode;
31 typedef xmlNode *xmlNodePtr;
32 struct _xmlNode;
33 //<<
34 
35 //>> Forward declaration of xmlDocPtr.
36 typedef struct _xmlDoc xmlDoc;
37 typedef xmlDoc *xmlDocPtr;
38 struct _xmlDoc;
39 //<<
40 
44 CONFIG_EXPORT bool isElementNode(xmlNodePtr theNode);
45 
54 CONFIG_EXPORT bool isNode(xmlNodePtr theNode, const char* theNodeName, ...);
55 
56 //#define isNode(p) _isNode(p, NULL)
57 
64 CONFIG_EXPORT bool isAttributeNode(xmlNodePtr theNode);
65 
70 CONFIG_EXPORT bool isWidgetNode(xmlNodePtr theNode);
71 
72 CONFIG_EXPORT bool isCaseNode(xmlNodePtr theNode);
73 
81 CONFIG_EXPORT bool hasChild(xmlNodePtr theNode);
82 
83 
87 CONFIG_EXPORT bool hasParent(xmlNodePtr theNode);
88 
92 CONFIG_EXPORT bool hasParent(xmlNodePtr theNode, const char* theNodeName, ...);
93 
97 CONFIG_EXPORT xmlNodePtr hasParentRecursive(xmlNodePtr theNode, const char* theNodeName, ...);
98 
99 
103 CONFIG_EXPORT bool getParametersInfo(xmlNodePtr theNode, std::string& outPropertyId,
104  std::list<std::string>& outValidatorParameters);
105 
117 CONFIG_EXPORT std::string library(const std::string& theLibName);
118 
122 CONFIG_EXPORT std::string getProperty(xmlNodePtr theNode, const char* thePropName);
123 
127 CONFIG_EXPORT std::string getContent(xmlNodePtr theNode);
128 
132 std::string getNormalizedProperty(xmlNodePtr theNode, const char* thePropName);
133 
142 CONFIG_EXPORT bool getBooleanAttribute(xmlNodePtr theNode,
143  const char* theAttributeName,
144  bool theDefault);
145 
150 CONFIG_EXPORT std::string normalize(const char* theString);
155 CONFIG_EXPORT std::string normalize(const std::string& theString);
156 
157 #endif