diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2016-03-03 09:26:06 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2016-03-03 09:26:06 -0500 |
commit | 90f3d2ff9fe7297dae0bdcee9c441e53177a0fb7 (patch) | |
tree | 3f89437e059b33dc2c78766e17c21e62fb1489e6 /src/tinyxml2.cpp | |
parent | e879b257b9512816f2ff579a7444fe600a74ed91 (diff) |
efficiency stuffs
Diffstat (limited to 'src/tinyxml2.cpp')
-rwxr-xr-x | src/tinyxml2.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tinyxml2.cpp b/src/tinyxml2.cpp index c4ea7cd..6198418 100755 --- a/src/tinyxml2.cpp +++ b/src/tinyxml2.cpp @@ -1400,6 +1400,18 @@ const XMLAttribute* XMLElement::FindAttribute( const char* name ) const return 0;
}
+std::string XMLElement::StrAttribute( const char* name, const char* value ) const
+{
+ std::string str;
+ const XMLAttribute* a = FindAttribute( name );
+ if ( a ) {
+ if ( !value || XMLUtil::StringEqual( a->Value(), value )) {
+ str = a->Value();
+ return str;
+ }
+ }
+ return str;
+}
const char* XMLElement::Attribute( const char* name, const char* value ) const
{
@@ -1413,7 +1425,6 @@ const char* XMLElement::Attribute( const char* name, const char* value ) const return 0;
}
-
const char* XMLElement::GetText() const
{
if ( FirstChild() && FirstChild()->ToText() ) {
|