#include <xml_node.hpp>
Definition at line 39 of file xml_node.hpp.
Public Member Functions | |
bool | has_attribute (const std::string &att_name) const |
Check if an attribute is present. More... | |
void | set_attribute (const std::string &att_name, const std::string &att) |
Add an attribute. More... | |
void | set_attribute (const std::string &att_name, casadi_int att) |
Add an integer attribute. More... | |
void | set_attribute (const std::string &att_name, double att) |
Add an integer attribute. More... | |
void | set_attribute (const std::string &att_name, const std::vector< casadi_int > &att) |
Add a vector attribute. More... | |
std::vector< std::string > | child_names () const |
Names of children. More... | |
std::vector< std::string > | attribute_names () const |
Names of attributes. More... | |
template<typename T > | |
T | attribute (const std::string &att_name) const |
Get an attribute by its name. More... | |
template<typename T > | |
T | attribute (const std::string &att_name, const T &def_att) const |
Get an attribute by its name, default value if not found. More... | |
const XmlNode & | operator[] (size_t i) const |
Get a reference to a child by its index. More... | |
XmlNode & | operator[] (size_t i) |
Get a reference to a child by its index. More... | |
const XmlNode & | operator[] (const std::string &childname) const |
Get a reference to a child by its name. More... | |
XmlNode & | operator[] (const std::string &childname) |
Get a reference to a child by its name. More... | |
bool | has_child (const std::string &childname) const |
Check if a child is present. More... | |
size_t | size () const |
Get the number of children. More... | |
template<typename T > | |
void | get (T *val) const |
Get value of text field. More... | |
void | dump (std::ostream &stream, casadi_int indent=0) const |
Dump representation. More... | |
Static Public Member Functions | |
static void | read (const std::string &str, std::string *val) |
Read the string value of a string (i.e. copy) More... | |
static void | read (const std::string &str, bool *val) |
Read the boolean value of a string. More... | |
static void | read (const std::string &str, casadi_int *val) |
Read the integer value of a string. More... | |
static void | read (const std::string &str, size_t *val) |
Read the size_t value of a string. More... | |
static void | read (const std::string &str, double *val) |
Read the double value of a string. More... | |
static void | read (const std::string &str, std::vector< casadi_int > *val) |
Read a vector of integer values of a string. More... | |
static void | read (const std::string &str, std::vector< std::string > *val) |
Read a vector of string values of a string. More... | |
Public Attributes | |
std::map< std::string, std::string > | attributes |
std::vector< XmlNode > | children |
std::string | name |
std::string | comment |
casadi_int | line |
std::string | text |
Friends | |
CASADI_EXPORT friend std::ostream & | operator<< (std::ostream &stream, const XmlNode &node) |
Print to stream. More... | |
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_vg
Definition at line 99 of file xml_node.hpp.
References casadi::T.
Referenced by casadi::DaeBuilderInternal::import_default_experiment(), casadi::DaeBuilderInternal::import_dynamic_equations(), casadi::DaeBuilderInternal::import_initial_equations(), casadi::DaeBuilderInternal::import_model_exchange(), casadi::DaeBuilderInternal::import_model_structure(), casadi::DaeBuilderInternal::import_model_variables(), casadi::DaeBuilderInternal::load_fmi_description(), casadi::DaeBuilderInternal::qualified_name(), casadi::DaeBuilderInternal::read_dependencies(), casadi::DaeBuilderInternal::read_dependencies_kind(), and set_attribute().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_vh
Definition at line 113 of file xml_node.hpp.
References casadi::T.
std::vector< std::string > casadi::XmlNode::attribute_names | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_vf
Definition at line 169 of file xml_node.cpp.
References attributes.
std::vector< std::string > casadi::XmlNode::child_names | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_ve
Definition at line 162 of file xml_node.cpp.
References children.
void casadi::XmlNode::dump | ( | std::ostream & | stream, |
casadi_int | indent = 0 |
||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_vw
Definition at line 84 of file xml_node.cpp.
References attributes, comment, name, size(), and text.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_vo
Definition at line 161 of file xml_node.hpp.
Referenced by casadi::DaeBuilderInternal::qualified_name(), and casadi::DaeBuilderInternal::read_expr().
bool casadi::XmlNode::has_attribute | ( | const std::string & | att_name | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_vc
Definition at line 31 of file xml_node.cpp.
References attributes.
Referenced by casadi::DaeBuilderInternal::read_dependencies(), and casadi::DaeBuilderInternal::read_dependencies_kind().
bool casadi::XmlNode::has_child | ( | const std::string & | childname | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_vm
Definition at line 35 of file xml_node.cpp.
References children.
Referenced by casadi::DaeBuilderInternal::import_model_exchange(), casadi::DaeBuilderInternal::import_model_structure(), casadi::DaeBuilderInternal::import_model_variables(), and casadi::DaeBuilderInternal::load_fmi_description().
XmlNode & casadi::XmlNode::operator[] | ( | const std::string & | childname | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_vl
Definition at line 44 of file xml_node.cpp.
References children.
const XmlNode & casadi::XmlNode::operator[] | ( | const std::string & | childname | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_vk
Definition at line 56 of file xml_node.cpp.
|
inline |
|
inline |
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_vq
Definition at line 115 of file xml_node.cpp.
References casadi::str().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_vr
Definition at line 130 of file xml_node.cpp.
References casadi::str().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_vs
Definition at line 135 of file xml_node.cpp.
References casadi::str().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_29u
Definition at line 125 of file xml_node.cpp.
References casadi::str().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_vp
Definition at line 111 of file xml_node.cpp.
References casadi::str().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_vt
Definition at line 140 of file xml_node.cpp.
References casadi::str().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_vu
Definition at line 151 of file xml_node.cpp.
References casadi::str().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_252
Definition at line 71 of file xml_node.hpp.
void casadi::XmlNode::set_attribute | ( | const std::string & | att_name, |
const std::string & | att | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_vd
Definition at line 60 of file xml_node.cpp.
References attribute(), and attributes.
Referenced by casadi::Variable::export_xml(), casadi::DaeBuilderInternal::generate_build_description(), casadi::DaeBuilderInternal::generate_model_description(), casadi::DaeBuilderInternal::generate_model_structure(), casadi::TinyXmlInterface::import_node(), and set_attribute().
void casadi::XmlNode::set_attribute | ( | const std::string & | att_name, |
const std::vector< casadi_int > & | att | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_254
Definition at line 64 of file xml_node.cpp.
References set_attribute().
void casadi::XmlNode::set_attribute | ( | const std::string & | att_name, |
double | att | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_253
Definition at line 73 of file xml_node.cpp.
References set_attribute().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_vn
Definition at line 155 of file xml_node.hpp.
Referenced by dump(), casadi::DaeBuilderInternal::import_binding_equations(), casadi::DaeBuilderInternal::import_dynamic_equations(), casadi::DaeBuilderInternal::import_initial_equations(), casadi::DaeBuilderInternal::import_model_structure(), casadi::DaeBuilderInternal::import_model_variables(), casadi::DaeBuilderInternal::qualified_name(), casadi::DaeBuilderInternal::read_expr(), and casadi::read_list().
|
friend |
Extra doc: https://github.com/casadi/casadi/wiki/L_vv
Definition at line 79 of file xml_node.cpp.
std::map<std::string, std::string> casadi::XmlNode::attributes |
Definition at line 41 of file xml_node.hpp.
Referenced by attribute_names(), dump(), casadi::TinyXmlInterface::export_node(), has_attribute(), and set_attribute().
std::vector<XmlNode> casadi::XmlNode::children |
Definition at line 44 of file xml_node.hpp.
Referenced by child_names(), casadi::TinyXmlInterface::export_node(), casadi::DaeBuilderInternal::generate_build_description(), casadi::DaeBuilderInternal::generate_model_description(), casadi::DaeBuilderInternal::generate_model_structure(), casadi::DaeBuilderInternal::generate_model_variables(), has_child(), casadi::TinyXmlInterface::import_node(), and operator[]().
std::string casadi::XmlNode::comment |
Definition at line 50 of file xml_node.hpp.
Referenced by dump(), and casadi::TinyXmlInterface::import_node().
casadi_int casadi::XmlNode::line |
Definition at line 53 of file xml_node.hpp.
Referenced by casadi::TinyXmlInterface::import_node().
std::string casadi::XmlNode::name |
Definition at line 47 of file xml_node.hpp.
Referenced by dump(), casadi::TinyXmlInterface::export_node(), casadi::Variable::export_xml(), casadi::DaeBuilderInternal::generate_build_description(), casadi::DaeBuilderInternal::generate_model_description(), casadi::DaeBuilderInternal::generate_model_structure(), casadi::DaeBuilderInternal::generate_model_variables(), casadi::DaeBuilderInternal::import_dynamic_equations(), casadi::DaeBuilderInternal::import_model_structure(), casadi::DaeBuilderInternal::import_model_variables(), casadi::TinyXmlInterface::import_node(), and casadi::DaeBuilderInternal::read_expr().
std::string casadi::XmlNode::text |
Definition at line 56 of file xml_node.hpp.
Referenced by dump(), casadi::DaeBuilderInternal::import_model_variables(), casadi::TinyXmlInterface::import_node(), and casadi::DaeBuilderInternal::read_expr().