summaryrefslogtreecommitdiffstats
path: root/Source/cmXMLParser.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-02-24 20:43:49 (GMT)
committerBrad King <brad.king@kitware.com>2009-02-24 20:43:49 (GMT)
commitb5db18e72322862883e6d0695e3e0cc5826f39c9 (patch)
tree64ef6bac88f671a80e15dcf695b1b4c130e4d318 /Source/cmXMLParser.cxx
parentd033f0d2d15ddc84b446da0012b809f6cba1597f (diff)
downloadCMake-b5db18e72322862883e6d0695e3e0cc5826f39c9.zip
CMake-b5db18e72322862883e6d0695e3e0cc5826f39c9.tar.gz
CMake-b5db18e72322862883e6d0695e3e0cc5826f39c9.tar.bz2
ENH: Added cmXMLParser::FindAttribute method
This method will help subclasses look for element attributes in their StartElement methods.
Diffstat (limited to 'Source/cmXMLParser.cxx')
-rw-r--r--Source/cmXMLParser.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx
index 09cc384..0f68cb6 100644
--- a/Source/cmXMLParser.cxx
+++ b/Source/cmXMLParser.cxx
@@ -181,6 +181,23 @@ int cmXMLParser::IsSpace(char c)
}
//----------------------------------------------------------------------------
+const char* cmXMLParser::FindAttribute(const char** atts,
+ const char* attribute)
+{
+ if(atts && attribute)
+ {
+ for(const char** a = atts; *a && *(a+1); a += 2)
+ {
+ if(strcmp(*a, attribute) == 0)
+ {
+ return *(a+1);
+ }
+ }
+ }
+ return 0;
+}
+
+//----------------------------------------------------------------------------
void cmXMLParserStartElement(void* parser, const char *name,
const char **atts)
{