00001 /* 00002 Copyright 2007, 2008, 2009, 2010, 2011 Instituto de Sistemas e Robotica, Instituto Superior Tecnico 00003 00004 This file is part of MeRMaID. 00005 00006 MeRMaID is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU Lesser General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 MeRMaID is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public License 00017 along with MeRMaID. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 00021 00022 /** 00023 * @Filename XmlItem.hpp 00024 * @Description XmlItem definition file. 00025 * @Status Implementing 00026 * @Version $Id: XmlItem.hpp 1 2011-03-04 18:13:18Z jreis $ 00027 * @Maintainer Nelson Ramos (nmsra@mega.ist.utl.pt) 00028 */ 00029 00030 #ifndef __XML_XMLITEM_H_ 00031 #define __XML_XMLITEM_H_ 00032 00033 namespace mermaid 00034 { 00035 namespace support 00036 { 00037 namespace xml 00038 { 00039 class XmlItem; 00040 } 00041 } 00042 } 00043 00044 #include <string> 00045 #include <vector> 00046 00047 #include <Stringable.hpp> 00048 00049 00050 00051 namespace mermaid 00052 { 00053 namespace support 00054 { 00055 namespace xml 00056 { 00057 using std::string; 00058 using std::vector; 00059 00060 using mermaid::support::syntacticsugar::Stringable; 00061 00062 typedef vector<XmlItem*> XmlItemVector; ///< Vector of XmlItem's 00063 00064 /** 00065 * @Class XmlItem XmlItem.hpp "XmlItem.hpp" 00066 * @Description Class representing an XML item. 00067 * @Author Marco Barbosa 00068 */ 00069 class XmlItem : public Stringable 00070 { 00071 public: 00072 /** 00073 * @Description Method to check if XmlItem is of type XmlElement 00074 * @Returns True if XmlItem is of type XmlElement, false otherwise 00075 */ 00076 virtual const bool isXmlElement() const; 00077 00078 /** 00079 * @Description Method to check if XmlItem is of type XmlCharData 00080 * @Returns True if XmlItem is of type XmlCharData, false otherwise 00081 */ 00082 virtual const bool isXmlCharData() const; 00083 00084 /** 00085 * @Description String cast operator 00086 */ 00087 virtual operator string() const = 0; 00088 }; // XmlItem 00089 } // namespace xml 00090 } // namespace support 00091 } // namespace mermaid 00092 00093 #endif // __XML_XMLITEM_H_