summaryrefslogtreecommitdiff
path: root/src/pugixml.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-10-18 16:59:31 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-10-18 16:59:31 +0000
commit498947c71897bfad865d37252df6689c1a78e1d8 (patch)
tree9e9a4fbed47c89bb468d4083227ea6d6285ed8ec /src/pugixml.cpp
parentb1bc4e4ed595d64ee6145ff97ac2c3c7aac6d369 (diff)
Fixed internal_object() const-correctness, added xml_node::hash_value and xml_attribute::hash_value functions
git-svn-id: http://pugixml.googlecode.com/svn/trunk@767 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r--src/pugixml.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index febf2eb..1142930 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -3420,7 +3420,12 @@ namespace pugi
return (_attr && _attr->value) ? _attr->value : PUGIXML_TEXT("");
}
- xml_attribute_struct* xml_attribute::internal_object()
+ size_t xml_attribute::hash_value() const
+ {
+ return static_cast<size_t>(reinterpret_cast<uintptr_t>(_attr) / sizeof(xml_attribute_struct));
+ }
+
+ xml_attribute_struct* xml_attribute::internal_object() const
{
return _attr;
}
@@ -4134,7 +4139,12 @@ namespace pugi
return walker.end(arg_end);
}
- xml_node_struct* xml_node::internal_object()
+ size_t xml_node::hash_value() const
+ {
+ return static_cast<size_t>(reinterpret_cast<uintptr_t>(_root) / sizeof(xml_node_struct));
+ }
+
+ xml_node_struct* xml_node::internal_object() const
{
return _root;
}