Changeset 69:b9bd564ea70c in rrlib_xml
Legend:
- Unmodified
- Added
- Removed
-
tDocument.cpp
r64 r69 199 199 xmlXPathFreeObject(ptr); 200 200 }; // clean up the XPath object 201 std::unique_ptr<xmlXPathObject, decltype(cleanup_path_object)> xpath_object(xmlXPathEvalExpression( (xmlChar*)name.c_str(), xpath_context.get()), cleanup_path_object); // create and initialize an XPath object as query result with auto cleanup201 std::unique_ptr<xmlXPathObject, decltype(cleanup_path_object)> xpath_object(xmlXPathEvalExpression(reinterpret_cast<xmlChar*>(const_cast<char*>(name.c_str())), xpath_context.get()), cleanup_path_object); // create and initialize an XPath object as query result with auto cleanup 202 202 203 203 if (xpath_object == nullptr) -
tNode.cpp
r57 r69 79 79 // tNode IsInSubtreeOf 80 80 //---------------------------------------------------------------------- 81 constbool tNode::IsInSubtreeOf(const tNode &node) const81 bool tNode::IsInSubtreeOf(const tNode &node) const 82 82 { 83 83 const tNode *current_node = this; -
tNode.h
r66 r69 139 139 } 140 140 141 inline constbool operator == (const iterator &other) const141 inline bool operator == (const iterator &other) const 142 142 { 143 143 return element == other.element; 144 144 } 145 inline constbool operator != (const iterator &other) const145 inline bool operator != (const iterator &other) const 146 146 { 147 147 return !(*this == other); … … 190 190 } 191 191 192 inline constbool operator == (const const_iterator &other) const192 inline bool operator == (const const_iterator &other) const 193 193 { 194 194 return element == other.element; 195 195 } 196 inline constbool operator != (const const_iterator &other) const196 inline bool operator != (const const_iterator &other) const 197 197 { 198 198 return !(*this == other); … … 247 247 * \returns Whether \a this is contained within the subtree of \a node 248 248 */ 249 constbool IsInSubtreeOf(const tNode &node) const;249 bool IsInSubtreeOf(const tNode &node) const; 250 250 251 251 /*! Get the name of this node … … 321 321 * \returns Whether \a this has children or not 322 322 */ 323 inline constbool HasChildren() const323 inline bool HasChildren() const 324 324 { 325 325 return this->ChildrenBegin() != this->ChildrenEnd(); … … 332 332 * \returns The number of XML nodes reachable as children of this node 333 333 */ 334 inline constsize_t GetNumberOfChildren() const334 inline size_t GetNumberOfChildren() const 335 335 { 336 336 return std::distance(this->ChildrenBegin(), this->ChildrenEnd()); … … 441 441 * \returns Whether a sibling is reachable or not 442 442 */ 443 inline constbool HasNextSibling() const443 inline bool HasNextSibling() const 444 444 { 445 445 return this->NextSiblingsBegin() != this->NextSiblingsEnd(); … … 527 527 * \returns Whether this node has the given attribute or not 528 528 */ 529 inline constbool HasAttribute(const std::string &name) const529 inline bool HasAttribute(const std::string &name) const 530 530 { 531 531 return xmlHasProp(const_cast<tNode *>(this), reinterpret_cast<const xmlChar *>(name.c_str())) != 0; … … 567 567 * \returns The attribute as int 568 568 */ 569 inline constint GetIntAttribute(const std::string &name, int base = 10) const569 inline int GetIntAttribute(const std::string &name, int base = 10) const 570 570 { 571 571 return this->GetLongIntAttribute(name, base); … … 584 584 * \returns The attribute as long int 585 585 */ 586 inline constlong int GetLongIntAttribute(const std::string &name, int base = 10) const586 inline long int GetLongIntAttribute(const std::string &name, int base = 10) const 587 587 { 588 588 return tNode::ConvertStringToNumber(this->GetStringAttribute(name), std::strtol, base); … … 602 602 * \returns The attribute as long long int 603 603 */ 604 inline constlong long int GetLongLongIntAttribute(const std::string &name, int base = 10) const604 inline long long int GetLongLongIntAttribute(const std::string &name, int base = 10) const 605 605 { 606 606 return tNode::ConvertStringToNumber(this->GetStringAttribute(name), std::strtoll, base); … … 618 618 * \returns The attribute as float 619 619 */ 620 inline constfloat GetFloatAttribute(const std::string &name) const620 inline float GetFloatAttribute(const std::string &name) const 621 621 { 622 622 return tNode::ConvertStringToNumber(this->GetStringAttribute(name), std::strtof); … … 634 634 * \returns The attribute as double 635 635 */ 636 inline constdouble GetDoubleAttribute(const std::string &name) const636 inline double GetDoubleAttribute(const std::string &name) const 637 637 { 638 638 return tNode::ConvertStringToNumber(this->GetStringAttribute(name), std::strtod); … … 650 650 * \returns The attribute as long double 651 651 */ 652 inline constlong double GetLongDoubleAttribute(const std::string &name) const652 inline long double GetLongDoubleAttribute(const std::string &name) const 653 653 { 654 654 return tNode::ConvertStringToNumber(this->GetStringAttribute(name), std::strtold); … … 716 716 * \returns Whether the attribute's value was "true" or "false" 717 717 */ 718 inline constbool GetBoolAttribute(const std::string &name) const718 inline bool GetBoolAttribute(const std::string &name) const 719 719 { 720 720 static const std::vector<std::string> bool_names = { "false", "true" };
Note: See TracChangeset
for help on using the changeset viewer.