PixelLightAPI  .
XmlText.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: XmlText.h                                      *
00003  *
00004  *  Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLCORE_XML_TEXT_H__
00024 #define __PLCORE_XML_TEXT_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLCore/Xml/XmlNode.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Namespace                                             ]
00036 //[-------------------------------------------------------]
00037 namespace PLCore {
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ Classes                                               ]
00042 //[-------------------------------------------------------]
00043 /**
00044 *  @brief
00045 *    XML text node - contained in an XML element
00046 */
00047 class XmlText : public XmlNode {
00048 
00049 
00050     //[-------------------------------------------------------]
00051     //[ Friends                                               ]
00052     //[-------------------------------------------------------]
00053     friend class XmlNode;
00054     friend class XmlElement;
00055 
00056 
00057     //[-------------------------------------------------------]
00058     //[ Public functions                                      ]
00059     //[-------------------------------------------------------]
00060     public:
00061         /**
00062         *  @brief
00063         *    Default constructor
00064         */
00065         XmlText();
00066 
00067         /**
00068         *  @brief
00069         *    Constructor
00070         *
00071         *  @param[in] sValue
00072         *    Value of this text node
00073         */
00074         PLCORE_API XmlText(const String &sValue);
00075 
00076         /**
00077         *  @brief
00078         *    Copy constructor
00079         *
00080         *  @param[in] cSource
00081         *    Source to copy from
00082         */
00083         PLCORE_API XmlText(const XmlText &cSource);
00084 
00085         /**
00086         *  @brief
00087         *    Destructor
00088         */
00089         PLCORE_API virtual ~XmlText();
00090 
00091         /**
00092         *  @brief
00093         *    Copy operator
00094         *
00095         *  @param[in] cSource
00096         *    Source to copy from
00097         *
00098         *  @return
00099         *    Reference to this instance
00100         */
00101         PLCORE_API XmlText &operator =(const XmlText &cSource);
00102 
00103         /**
00104         *  @brief
00105         *    Queries whether this represents text using a CDATA section
00106         *
00107         *  @return
00108         *    'true' if this is input and output as a CDATA style text element, else 'false'
00109         */
00110         inline bool IsCDATA() const;
00111 
00112         /**
00113         *  @brief
00114         *    Turns on or off a CDATA representation of text
00115         *
00116         *  @param[in] bCDATA
00117         *    'true' if this should be input and output as a CDATA style text element, else 'false'
00118         */
00119         inline void SetCDATA(bool bCDATA);
00120 
00121 
00122     //[-------------------------------------------------------]
00123     //[ Public virtual XmlBase functions                      ]
00124     //[-------------------------------------------------------]
00125     public:
00126         PLCORE_API virtual bool Save(File &cFile, uint32 nDepth = 0) override;
00127         PLCORE_API virtual String ToString(uint32 nDepth = 0) const override;
00128         PLCORE_API virtual const char *Parse(const char *pszData, XmlParsingData *pData = nullptr, EEncoding nEncoding = EncodingUnknown) override;
00129 
00130 
00131     //[-------------------------------------------------------]
00132     //[ Public virtual XmlNode functions                      ]
00133     //[-------------------------------------------------------]
00134     public:
00135         PLCORE_API virtual XmlNode *Clone() const override;
00136 
00137 
00138     //[-------------------------------------------------------]
00139     //[ Private data                                          ]
00140     //[-------------------------------------------------------]
00141     private:
00142         bool m_bCDATA;  /**< 'true' if this should be input and output as a CDATA style text element */
00143 
00144 
00145 };
00146 
00147 
00148 //[-------------------------------------------------------]
00149 //[ Namespace                                             ]
00150 //[-------------------------------------------------------]
00151 } // PLCore
00152 
00153 
00154 //[-------------------------------------------------------]
00155 //[ Implementation                                        ]
00156 //[-------------------------------------------------------]
00157 #include "PLCore/Xml/XmlText.inl"
00158 
00159 
00160 #endif // __PLCORE_XML_TEXT_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:02
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported