Revision: 96
http://xmlstorage.svn.sourceforge.net/xmlstorage/?rev=96&view=rev
Author: martinfuchs
Date: 2008-05-30 05:03:59 -0700 (Fri, 30 May 2008)
Log Message:
-----------
adjust constness for find calls
Modified Paths:
--------------
trunk/c++/xmlstorage.h
Modified: trunk/c++/xmlstorage.h
===================================================================
--- trunk/c++/xmlstorage.h 2008-05-30 12:03:14 UTC (rev 95)
+++ trunk/c++/xmlstorage.h 2008-05-30 12:03:59 UTC (rev 96)
@@ -1111,7 +1111,7 @@
/// convenient value access in children node
XS_String subvalue(const char* child_name, const char* attr_name, int n=0) const
{
- const XMLNode* node = XPathElement(child_name, n).find(this);
+ const XMLNode* node = XPathElement(child_name, n).const_find(this);
if (node)
return node->get(attr_name);
@@ -1120,7 +1120,7 @@
}
/// convenient storage of distinct values in children node
- XS_String& subvalue(const char* name, const XS_String& attr_name, int n=0)
+ XS_String& subvalue(const char* child_name, const XS_String& attr_name, int n=0)
{
XMLNode* node = XPathElement(child_name, n).find(this);
@@ -1645,7 +1645,7 @@
/// create node if not already existing and move to it
void smart_create(const char* child_name)
{
- XMLNode* node = _cur->find(child_name);
+ XMLNode* node = XPathElement(child_name).find(_cur);
if (node)
go_to(node);
@@ -1657,12 +1657,12 @@
template<typename T, typename U>
void smart_create(const char* child_name, const T& attr_name, const U& attr_value)
{
- XMLNode* node = _cur->find(child_name, attr_name, attr_value);
+ XMLNode* node = XPathElement(child_name, 0, attr_name, attr_value).find(_cur);
if (node)
go_to(node);
else {
- XMLNode* node = new XMLNode(child_name);
+ node = new XMLNode(child_name);
add_down(node);
(*node)[attr_name] = attr_value;
}
@@ -1801,7 +1801,7 @@
/// search for child and go down
bool go_down(const char* child_name, int n=0)
{
- XMLNode* node = XPathElement(child_name, n).const_find(_cur);
+ const XMLNode* node = XPathElement(child_name, n).const_find(_cur);
if (node) {
go_to(node);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|