19#ifndef HEADER_XML_NODE_HPP
20#define HEADER_XML_NODE_HPP
27#include <IXMLReader.h>
34#include "utils/leak_check.hpp"
35#include "utils/no_copy.hpp"
36#include "utils/time.hpp"
57 void readXML(io::IXMLReader *xml);
59 std::string m_file_name;
66 XMLNode(
const std::string &filename);
70 const std::string &getName()
const {
return m_name; }
72 const void getNodes(
const std::string &s, std::vector<XMLNode*>& out)
const;
74 unsigned int getNumNodes()
const {
return (
unsigned int)
m_nodes.size(); }
75 int get(
const std::string &attribute, std::string *value)
const;
76 int get(
const std::string &attribute, core::stringw *value)
const;
77 int getAndDecode(
const std::string &attribute, core::stringw *value)
const;
78 int get(
const std::string &attribute, int32_t *value)
const;
79 int get(
const std::string &attribute, uint16_t *value)
const;
80 int get(
const std::string &attribute, uint32_t *value)
const;
81 int get(
const std::string &attribute, int64_t *value)
const;
82 int get(
const std::string &attribute, uint64_t *value)
const;
83 int get(
const std::string &attribute,
float *value)
const;
84 int get(
const std::string &attribute,
double *value)
const;
85 int get(
const std::string &attribute,
bool *value)
const;
86 int get(
const std::string &attribute,
Vec3 *value)
const;
87 int get(
const std::string &attribute, core::vector2df *value)
const;
88 int get(
const std::string &attribute, core::vector3df *value)
const;
89 int get(
const std::string &attribute, video::SColorf *value)
const;
90 int get(
const std::string &attribute, video::SColor *value)
const;
91 int get(
const std::string &attribute, std::vector<std::string> *value)
const;
92 int get(
const std::string &attribute, std::vector<float> *value)
const;
93 int get(
const std::string &attribute, std::vector<int> *value)
const;
95 int get(core::vector3df *value)
const;
96 int getXYZ(core::vector3df *value)
const;
98 int getHPR(core::vector3df *value)
const;
101 bool hasChildNamed(
const char* name)
const;
104 static bool hasX(
int b) {
return (b&1)==1; }
105 static bool hasY(
int b) {
return (b&2)==2; }
106 static bool hasZ(
int b) {
return (b&4)==4; }
107 static bool hasH(
int b) {
return (b&1)==1; }
108 static bool hasP(
int b) {
return (b&2)==2; }
109 static bool hasR(
int b) {
return (b&4)==4; }
This class manages a set of (x_i,y_i) points, x_i must be sorted.
Definition: interpolation_array.hpp:32
Utility class, you can inherit from this class to disallow the assignment operator and copy construct...
Definition: no_copy.hpp:26
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48
int getXYZ(core::vector3df *value) const
Interprets the attributes 'x', 'y', 'z' as a 3d vector and set the corresponding elements of value.
Definition: xml_node.cpp:593
std::map< std::string, core::stringw > m_attributes
List of all attributes.
Definition: xml_node.hpp:53
std::vector< XMLNode * > m_nodes
List of all sub nodes.
Definition: xml_node.hpp:55
void readXML(io::IXMLReader *xml)
Stores all attributes, and reads in all children.
Definition: xml_node.cpp:93
std::string m_name
Name of this element.
Definition: xml_node.hpp:51
const void getNodes(const std::string &s, std::vector< XMLNode * > &out) const
Returns all nodes with the given name.
Definition: xml_node.cpp:159
int get(const std::string &attribute, std::string *value) const
If 'attribute' was defined, set 'value' to the value of the attribute and return 1,...
Definition: xml_node.cpp:176
static bool hasX(int b)
Handy functions to test the bit pattern returned by get(vector3df*).
Definition: xml_node.hpp:104
~XMLNode()
Destructor.
Definition: xml_node.cpp:80
int getHPR(core::vector3df *value) const
Interprets the attributes 'h', 'p', 'r' as a 3d vector and set the corresponding elements of value.
Definition: xml_node.cpp:629
const XMLNode * getNode(const std::string &name) const
Returns the node with the given name.
Definition: xml_node.cpp:145
Declares the general types that are used by the network.