|
ls1-MarDyn
ls1-MarDyn molecular dynamics code
|
Public Types | |
| enum | NodeType { Unknown_Node =-1 , Invalid_Node =0 , ELEMENT_Node =1 , ATTRIBUTE_Node =2 , TEXT_Node =3 , CDATA_SECTION_Node =4 , ENTITY_REFERENCE_Node =5 , ENTITY_Node =6 , PROCESSING_INSTRUCTION_Node =7 , COMMENT_Node =8 , DOCUMENT_Node =9 , DOCUMENT_TYPE_Node =10 , DOCUMENT_FRAGMENT_Node =11 , NOTATION_Node =12 } |
| Node types enumeration associates a number to each XML node type. More... | |
Public Member Functions | |
| Node () | |
| XMLfile::Node constructor sets up an invalid node. | |
| Node (const Node &n) | |
| XMLfile::Node copy constructor duplicate a node. More... | |
| const std::string & | nodepath () const |
| get nodepath returns the full path of the node More... | |
| std::string | name () const |
| get node name returns the name of the node, if node is valid - otherwise an empty string | |
| void | invalidate () |
| invalidate the node set the internal state to invalid | |
| NodeType | type () const |
| get node type determine the node type (enumeration) More... | |
| bool | isRootNode () const |
| check, if node is root node return true, if node is a valid root node - false otherwise More... | |
| bool | isLeafNode () const |
| check, if node is leaf node return true, if node is a valid leaf node - false otherwise More... | |
| template<typename T > | |
| bool | getValue (T &value) const |
| get the node value returns the node value converted to a given type More... | |
| std::string | value_string (std::string defaultvalue=std::string()) const |
| get the node string value returns the node value as string value or default value, if node is invalid More... | |
| int | value_int (int defaultvalue=0) const |
| get the node int value returns the node value as int value or default value, if node is invalid More... | |
| long | value_long (long defaultvalue=0) const |
| get the node long value returns the node value as long value or default value, if node is invalid More... | |
| float | value_float (float defaultvalue=0.) const |
| get the node float value returns the node value as float value or default value, if node is invalid More... | |
| double | value_double (double defaultvalue=0.) const |
| get the node double value returns the node value as double value or default value, if node is invalid More... | |
| bool | value_bool (bool defaultvalue=false) const |
| get the node bool value returns the node value as bool value or default value, if node is invalid More... | |
| Node & | operator= (const Node &n) |
| assignment operator copy/duplicate other node content to node More... | |
| template<typename T > | |
| operator T () const | |
| template type cast operator return node content (getValue) | |
| operator bool () const | |
| bool cast operator check if Node is valid | |
| void | printXML (std::ostream &ostrm=std::cout) const |
| print XML data to stream print the node content using XML syntax More... | |
| void | print (std::ostream &ostrm=std::cout) const |
| print data to stream print the node data More... | |
| Node & | operator= (Node &node) |
| template<> | |
| bool | getValue (string &value) const |
| template<> | |
| bool | getValue (int &value) const |
| template<> | |
| bool | getValue (long &value) const |
| template<> | |
| bool | getValue (float &value) const |
| template<> | |
| bool | getValue (double &value) const |
| template<> | |
| bool | getValue (bool &value) const |
Friends | |
| class | Query |
| class | XMLfile |
Node types enumeration associates a number to each XML node type.
|
inline |
XMLfile::Node copy constructor duplicate a node.
| XMLfile::Node& | source node |
| bool XMLfile::Node::getValue | ( | T & | value | ) | const |
get the node value returns the node value converted to a given type
| T& | Value to return |
| bool XMLfile::Node::isLeafNode | ( | ) | const |
check, if node is leaf node return true, if node is a valid leaf node - false otherwise
|
inline |
check, if node is root node return true, if node is a valid root node - false otherwise
|
inline |
get nodepath returns the full path of the node
assignment operator copy/duplicate other node content to node
| XMLfile::Node | source node |
| void XMLfile::Node::print | ( | std::ostream & | ostrm = std::cout | ) | const |
print data to stream print the node data
| std::ostream& | stream to write to (default: std::cout) |
| void XMLfile::Node::printXML | ( | std::ostream & | ostrm = std::cout | ) | const |
print XML data to stream print the node content using XML syntax
| std::ostream& | stream to write to (default: std::cout) |
|
inline |
get node type determine the node type (enumeration)
| bool XMLfile::Node::value_bool | ( | bool | defaultvalue = false | ) | const |
get the node bool value returns the node value as bool value or default value, if node is invalid
| bool | default value (default: false) |
| double XMLfile::Node::value_double | ( | double | defaultvalue = 0. | ) | const |
get the node double value returns the node value as double value or default value, if node is invalid
| double | default value (default: 0.) |
| float XMLfile::Node::value_float | ( | float | defaultvalue = 0. | ) | const |
get the node float value returns the node value as float value or default value, if node is invalid
| float | default value (default: 0.) |
| int XMLfile::Node::value_int | ( | int | defaultvalue = 0 | ) | const |
get the node int value returns the node value as int value or default value, if node is invalid
| int | default value (default: 0) |
| long XMLfile::Node::value_long | ( | long | defaultvalue = 0 | ) | const |
get the node long value returns the node value as long value or default value, if node is invalid
| long | default value (default: 0) |
| string XMLfile::Node::value_string | ( | std::string | defaultvalue = std::string() | ) | const |
get the node string value returns the node value as string value or default value, if node is invalid
| std::string | default value (default: empty string) |