Loading...
Searching...
No Matches
AbstractWriter.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19
20/*!
21 \file terralib/xml/AbstractWriter.h
22
23 \brief This class models a XML writer object.
24*/
25
26#ifndef __TERRALIB_XML_INTERNAL_ABSTRACTWRITER_H
27#define __TERRALIB_XML_INTERNAL_ABSTRACTWRITER_H
28
29// TerraLib
30#include "Config.h"
31
32// STL
33#include <string>
34
35// Boost
36#include <boost/cstdint.hpp>
37
38namespace te
39{
40 namespace xml
41 {
42 /*!
43 \class AbstractWriter
44
45 \brief This class models a XML writer object.
46
47 \ingroup xml
48 */
50 {
51 public:
52
53 /*! \brief Constructor. */
55
56 /*! \brief Virtual destructor. */
57 virtual ~AbstractWriter();
58
59 virtual void writeStartDocument(const std::string& encoding, const std::string& standalone) = 0;
60
61 virtual void writeStartElement(const std::string& qName) = 0;
62
63 virtual void writeElement(const std::string& qName, const std::string& value) = 0;
64
65 virtual void writeElement(const std::string& qName, const double& value) = 0;
66
67 virtual void writeElement(const std::string& qName, boost::int32_t value) = 0;
68
69 virtual void writeElement(const std::string& qName, boost::uint32_t value) = 0;
70
71 virtual void writeElement(const std::string& qName, boost::int64_t value) = 0;
72
73 virtual void writeElement(const std::string& qName, boost::uint64_t value) = 0;
74
75 virtual void writeAttribute(const std::string& attName, const std::string& value) = 0;
76
77 virtual void writeAttribute(const std::string& attName, const double& value) = 0;
78
79 virtual void writeAttribute(const std::string& attName, boost::int32_t value) = 0;
80
81 virtual void writeAttribute(const std::string& attName, boost::uint32_t value) = 0;
82
83 virtual void writeAttribute(const std::string& attName, boost::int64_t value) = 0;
84
85 virtual void writeAttribute(const std::string& attName, boost::uint64_t value) = 0;
86
87 virtual void writeValue(const std::string& value) = 0;
88
89 virtual void writeValue(const double& value) = 0;
90
91 virtual void writeValue(boost::int32_t value) = 0;
92
93 virtual void writeValue(boost::uint32_t value) = 0;
94
95 virtual void writeValue(boost::int64_t value) = 0;
96
97 virtual void writeValue(boost::uint64_t value) = 0;
98
99 virtual void writeEndElement(const std::string& qName) = 0;
100
101 virtual void writeToFile() = 0;
102
103 /*!
104 \brief Gets the XML content in a std::string format
105
106 \exception Exception It throws an exception if the content cannot be read
107 */
108 virtual std::string getContent() = 0;
109
110 void setRootNamespaceURI(const std::string& uri);
111
112 void setURI(const std::string& uri);
113
114 std::string getURI();
115
116 protected:
117
118 std::string m_uri;
120 };
121
122 } // end namespace xml
123} // end namespace te
124
125#endif // __TERRALIB_XML_INTERNAL_ABSTRACTWRITER_H
126
This class models a XML writer object.
virtual void writeAttribute(const std::string &attName, boost::int32_t value)=0
virtual std::string getContent()=0
Gets the XML content in a std::string format.
virtual void writeAttribute(const std::string &attName, const double &value)=0
virtual void writeElement(const std::string &qName, boost::int64_t value)=0
virtual void writeStartElement(const std::string &qName)=0
virtual void writeElement(const std::string &qName, boost::uint64_t value)=0
virtual void writeValue(const std::string &value)=0
virtual void writeToFile()=0
virtual void writeElement(const std::string &qName, boost::uint32_t value)=0
virtual void writeValue(boost::int32_t value)=0
virtual void writeAttribute(const std::string &attName, const std::string &value)=0
void setURI(const std::string &uri)
virtual void writeAttribute(const std::string &attName, boost::uint32_t value)=0
virtual void writeValue(boost::uint64_t value)=0
virtual void writeValue(const double &value)=0
void setRootNamespaceURI(const std::string &uri)
virtual void writeValue(boost::int64_t value)=0
std::string m_rootNamespaceUri
virtual ~AbstractWriter()
Virtual destructor.
AbstractWriter()
Constructor.
virtual void writeElement(const std::string &qName, boost::int32_t value)=0
virtual void writeElement(const std::string &qName, const double &value)=0
virtual void writeElement(const std::string &qName, const std::string &value)=0
virtual void writeAttribute(const std::string &attName, boost::uint64_t value)=0
virtual void writeStartDocument(const std::string &encoding, const std::string &standalone)=0
virtual void writeAttribute(const std::string &attName, boost::int64_t value)=0
virtual void writeValue(boost::uint32_t value)=0
virtual void writeEndElement(const std::string &qName)=0
TerraLib.
#define TEXMLEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:88
Proxy configuration file for TerraView (see terraview_config.h).