• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

spl/xml/XmlDeclaration.h

00001 /*
00002  *   This file is part of the Standard Portable Library (SPL).
00003  *
00004  *   SPL is free software: you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation, either version 3 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   SPL is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License
00015  *   along with SPL.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 #ifndef _xmldeclaration_h
00018 #define _xmldeclaration_h
00019 
00020 #include <spl/Debug.h>
00021 #include <spl/xml/XmlNode.h>
00022 
00031 class XmlDeclaration : public XmlNode
00032 {
00033 protected:
00034         friend void _TestTinyXml();
00035         
00036         void CopyTo( XmlDeclaration& target ) const;
00037 
00038         String version;
00039         String encoding;
00040         String standalone;      
00041         
00042         virtual const char* _Parse( const char* p, XmlParsingData* data, XmlEncoding encoding );
00043 
00044 public:
00046         inline XmlDeclaration()   : XmlNode( XmlNode::DECLARATION ) {}
00047 
00049         XmlDeclaration( const String& _version,
00050                                                 const String& _encoding,
00051                                                 const String& _standalone );
00052 
00053         virtual ~XmlDeclaration();
00054 
00055         XmlDeclaration( const XmlDeclaration& copy );
00056         void operator=( const XmlDeclaration& copy );
00057 
00058         virtual String Name() const;
00059                         
00061         inline const String& Version() const                    { return version; }
00063         inline const String& Encoding() const           { return encoding; }
00065         inline const String &Standalone() const         { return standalone; }
00066 
00068         virtual XmlNodePtr Clone() const;
00069 
00070         virtual XmlDeclarationPtr ToDeclaration() const; 
00071 
00072         virtual StringPtr ToString() const;
00073         virtual void WriteTo(TextWriter& writer) const; 
00074                         
00075 #ifdef DEBUG
00076         virtual void ValidateMem() const;
00077         virtual void CheckMem() const;
00078 #endif
00079 };
00080 
00081 REGISTER_TYPEOF( 534, XmlDeclaration );
00082 
00085 #endif