Install additional header file.
[asdcplib.git] / src / KM_xml.h
index 31f506471cabacffe1e714a224e0590b1db172e9..13070fca8e1ab387a672a09f4a31c62279770922 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2005-2006, John Hurst
+Copyright (c) 2005-2008, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,9 @@ namespace Kumu
 {
   class XMLElement;
 
+  // Return true if the given string contains an XML document (or the start of one).
+  bool StringIsXML(const char* document, ui32_t len = 0);
+
   //
   struct NVPair
   {
@@ -74,6 +77,10 @@ namespace Kumu
   //
   class XMLElement
     {
+      KM_NO_COPY_CONSTRUCT(XMLElement);
+      XMLElement();
+
+    protected:
       AttributeList       m_AttrList;
       ElementList         m_ChildList;
       const XMLNamespace* m_Namespace;
@@ -82,9 +89,6 @@ namespace Kumu
       std::string   m_Name;
       std::string   m_Body;
 
-      KM_NO_COPY_CONSTRUCT(XMLElement);
-      XMLElement();
-
     public:
       XMLElement(const char* name);
       ~XMLElement();
@@ -93,12 +97,12 @@ namespace Kumu
       inline void                SetNamespace(const XMLNamespace* ns) { assert(ns); m_Namespace = ns; }
 
       bool        ParseString(const std::string& document);
-      bool        TestString(const char* document, ui32_t len = 0);
 
       // building
       void        SetName(const char* name);
       void        AppendBody(const std::string& value);
       void        SetAttr(const char* name, const char* value);
+      XMLElement* AddChild(XMLElement* element);
       XMLElement* AddChild(const char* name);
       XMLElement* AddChildWithContent(const char* name, const char* value);
       XMLElement* AddChildWithContent(const char* name, const std::string& value);