Skip to content

Commit

Permalink
Update to TinyXml 2.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
parsley72 committed Dec 15, 2023
1 parent 298f7a1 commit 531ce02
Show file tree
Hide file tree
Showing 9 changed files with 336 additions and 355 deletions.
24 changes: 12 additions & 12 deletions htmlutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ void v_out_html(FILE* Fp_out, ///< Output HTML file
XNp_child = XNp_source->FirstChild();
while (XNp_child) {
switch (XNp_child->Type()) {
case TiXmlNode::DOCUMENT:
case TiXmlNode::TINYXML_DOCUMENT:
fprintf(Fp_out, "\nStart document\n");
break;

case TiXmlNode::ELEMENT:
case TiXmlNode::TINYXML_ELEMENT:
v_levelize((int)u_level, Fp_out, true);
fprintf(Fp_out, "&lt;"); // '<'
fprintf(Fp_out, "%s", XNp_child->ToElement()->Value());
Expand All @@ -74,14 +74,14 @@ void v_out_html(FILE* Fp_out, ///< Output HTML file
fprintf(Fp_out, " /&gt;<br>\n");
break;

case TiXmlNode::COMMENT:
case TiXmlNode::TINYXML_COMMENT:
fprintf(Fp_out, "&lt;!-- %s --&gt;<br>\n", XNp_child->ToComment()->Value());
break;
case TiXmlNode::TEXT:
case TiXmlNode::TINYXML_TEXT:
fprintf(Fp_out, "%s\n", XNp_child->ToText()->Value());
break;
case TiXmlNode::UNKNOWN:
case TiXmlNode::DECLARATION:
case TiXmlNode::TINYXML_UNKNOWN:
case TiXmlNode::TINYXML_DECLARATION:
break;
default:
assert(false);
Expand All @@ -90,21 +90,21 @@ void v_out_html(FILE* Fp_out, ///< Output HTML file
v_out_html(Fp_out, XNp_child, u_level + 1);

switch (XNp_child->Type()) {
case TiXmlNode::DOCUMENT:
case TiXmlNode::TINYXML_DOCUMENT:
fprintf(Fp_out, "\nEnd document\n");
break;
case TiXmlNode::ELEMENT:
case TiXmlNode::TINYXML_ELEMENT:
if (XNp_child->FirstChild()) {
v_levelize((int)u_level, Fp_out, true);
fprintf(Fp_out, "&lt;");
fprintf(Fp_out, "/%s", XNp_child->ToElement()->Value());
fprintf(Fp_out, "&gt;<br>\n"); // '>\n'
}
break;
case TiXmlNode::COMMENT:
case TiXmlNode::TEXT:
case TiXmlNode::UNKNOWN:
case TiXmlNode::DECLARATION:
case TiXmlNode::TINYXML_COMMENT:
case TiXmlNode::TINYXML_TEXT:
case TiXmlNode::TINYXML_UNKNOWN:
case TiXmlNode::TINYXML_DECLARATION:
default:
break;
}
Expand Down
16 changes: 8 additions & 8 deletions node_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void node_set::v_copy_selected_node_recursive(const TiXmlNode* XNp_root, ///< T

if ((!cp_lookup) || !strcmp(XNp_root->Value(), cp_lookup))
v_add_node_in_set(XNp_root);
if (XNp_root->Type() == TiXmlNode::ELEMENT) {
if (XNp_root->Type() == TiXmlNode::TINYXML_ELEMENT) {
XAp_attrib = XNp_root->ToElement()->FirstAttribute();
while (XAp_attrib) {
v_add_attrib_in_set(XAp_attrib);
Expand Down Expand Up @@ -127,7 +127,7 @@ TIXML_STRING node_set::S_get_string_value() const {
for (u_node = 0; u_node < _u_nb_node; u_node++) {
if (!_op_attrib[u_node]) {
XNp_node = (const TiXmlNode*)_vpp_node_set[u_node];
if (XNp_node->Type() == TiXmlNode::TEXT)
if (XNp_node->Type() == TiXmlNode::TINYXML_TEXT)
S_res += XNp_node->Value();
}
}
Expand Down Expand Up @@ -165,16 +165,16 @@ void node_set::v_add_base_in_set(const TiXmlBase* XBp_member, ///< Base to add
XNp_node = (TiXmlNode *) XBp_member;
switch (XNp_node->Type())
{
case TiXmlNode::TEXT :
case TiXmlNode::TINYXML_TEXT :
printf ("text (%s)", XNp_node->ToText()->Value ());
break;
case TiXmlNode::DOCUMENT :
case TiXmlNode::TINYXML_DOCUMENT :
printf ("document");
break;
case TiXmlNode::ELEMENT :
case TiXmlNode::TINYXML_ELEMENT :
printf ("element <%s>", XNp_node->ToElement()->Value ());
break;
case TiXmlNode::COMMENT :
case TiXmlNode::TINYXML_COMMENT :
printf ("comment <%s>", XNp_node->ToComment()->Value ());
break;
}
Expand Down Expand Up @@ -219,7 +219,7 @@ void node_set::v_add_all_foll_node(const TiXmlNode* XNp_node, ///< base node
XNp_ptr = XNp_ptr->NextSiblingElement();
}
XNp_ptr = XNp_node->Parent();
if (XNp_ptr && XNp_ptr->Type() == TiXmlNode::ELEMENT)
if (XNp_ptr && XNp_ptr->Type() == TiXmlNode::TINYXML_ELEMENT)
v_add_all_foll_node(XNp_ptr, S_name);
}

Expand All @@ -240,7 +240,7 @@ void node_set::v_add_all_prec_node(const TiXmlNode* XNp_node, ///< base node
cp_lookup = S_name.c_str();
XNp_ptr = XNp_node->PreviousSibling();
while (XNp_ptr) {
if (XNp_ptr->Type() == TiXmlNode::ELEMENT) {
if (XNp_ptr->Type() == TiXmlNode::TINYXML_ELEMENT) {
v_add_node_in_set_if_name_or_star(XNp_ptr, S_name);
v_copy_node_children(XNp_ptr, cp_lookup);
}
Expand Down
5 changes: 0 additions & 5 deletions tinyxml/tinystr.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
www.sourceforge.net/projects/tinyxml
Original file by Yves Berquin.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
Expand All @@ -22,10 +21,6 @@ must not be misrepresented as being the original software.
distribution.
*/

/*
* THIS FILE WAS ALTERED BY Tyge Løvset, 7. April 2005.
*/


#ifndef TIXML_USE_STL

Expand Down
14 changes: 0 additions & 14 deletions tinyxml/tinystr.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
www.sourceforge.net/projects/tinyxml
Original file by Yves Berquin.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
Expand All @@ -22,17 +21,6 @@ must not be misrepresented as being the original software.
distribution.
*/

/*
* THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005.
*
* - completely rewritten. compact, clean, and fast implementation.
* - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems)
* - fixed reserve() to work as per specification.
* - fixed buggy compares operator==(), operator<(), and operator>()
* - fixed operator+=() to take a const ref argument, following spec.
* - added "copy" constructor with length, and most compare operators.
* - added swap(), clear(), size(), capacity(), operator+().
*/

#ifndef TIXML_USE_STL

Expand Down Expand Up @@ -106,13 +94,11 @@ class TiXmlString
quit();
}

// = operator
TiXmlString& operator = (const char * copy)
{
return assign( copy, (size_type)strlen(copy));
}

// = operator
TiXmlString& operator = (const TiXmlString & copy)
{
return assign(copy.start(), copy.length());
Expand Down
Loading

0 comments on commit 531ce02

Please sign in to comment.