NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
tinyxmlutil.h
Go to the documentation of this file.
1 /*
2  This software is Copyright by the Board of Trustees of Michigan
3  State University (c) Copyright 2017.
4 
5  You may use this software under the terms of the GNU public license
6  (GPL). The terms of this license are described at:
7 
8  http://www.gnu.org/licenses/gpl.txt
9 
10  Authors:
11  Ron Fox
12  Giordano Cerriza
13  NSCL
14  Michigan State University
15  East Lansing, MI 48824-1321
16 */
17 
22  #ifndef TINYXMLUTIL_H
23  #define TINYXMLUTIL_H
24  #include <tinyxml2.h>
25 
26 
27  template <class T>
28  void readValue(T& result, tinyxml2::XMLElement& container);
29  void getAttribute(
30  uint32_t& result, tinyxml2::XMLElement& container,
31  const char* att
32  );
33  void getAttribute(
34  double& result, tinyxml2::XMLElement& container, const char* att
35  );
36  void getAttribute(
37  bool& result, tinyxml2::XMLElement& container, const char* att
38  );
39 
41  haveChild(tinyxml2::XMLElement& parent, const char* element);
42 
43 
44 void
46  tinyxml2::XMLError err, tinyxml2::XMLDocument& doc
47  );
48 
49 // Template implementations must be accessible at compile time.
56 template <class T>
57 void
59  T& result, tinyxml2::XMLElement& container
60 )
61 {
62  getAttribute(result, container, "value");
63 }
64 
65  #endif
void readValue(T &result, tinyxml2::XMLElement &container)
Definition: tinyxmlutil.h:58
Definition: tinyxml2.h:1258
void checkXmlError(tinyxml2::XMLError err, tinyxml2::XMLDocument &doc)
Definition: tinyxmlutil.cpp:95
Definition: tinyxml2.h:1691
tinyxml2::XMLElement * haveChild(tinyxml2::XMLElement &parent, const char *element)
Definition: tinyxmlutil.cpp:74
void getAttribute(uint32_t &result, tinyxml2::XMLElement &container, const char *att)
Definition: tinyxmlutil.cpp:36