All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Writer.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 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/Writer.h
22 
23  \brief This class models a XML writer object.
24 */
25 
26 #ifndef __TERRALIB_XML_INTERNAL_WRITER_H
27 #define __TERRALIB_XML_INTERNAL_WRITER_H
28 
29 // TerraLib
30 #include "../common/Holder.h"
31 #include "Config.h"
32 
33 // STL
34 #include <iosfwd>
35 #include <string>
36 
37 // Boost
38 #include <boost/cstdint.hpp>
39 #include <boost/noncopyable.hpp>
40 
41 namespace te
42 {
43  namespace xml
44  {
45  /*!
46  \class Writer
47 
48  \brief This class models a XML writer object.
49 
50  \ingroup xml
51  */
52  class TEXMLEXPORT Writer : public boost::noncopyable
53  {
54  public:
55 
56  /*! \brief Constructor. */
57  Writer(std::ostream& ostr);
58 
59  /*! \brief Virtual destructor. */
60  virtual ~Writer();
61 
62  virtual void writeStartDocument(const std::string& encoding, const std::string& standalone);
63 
64  virtual void writeStartElement(const std::string& qName);
65 
66  virtual void writeElement(const std::string& qName, const std::string& value);
67 
68  virtual void writeElement(const std::string& qName, const double& value);
69 
70  virtual void writeElement(const std::string& qName, boost::int32_t value);
71 
72  virtual void writeElement(const std::string& qName, boost::uint32_t value);
73 
74  virtual void writeElement(const std::string& qName, boost::int64_t value);
75 
76  virtual void writeElement(const std::string& qName, boost::uint64_t value);
77 
78  virtual void writeAttribute(const std::string& attName, const std::string& value);
79 
80  virtual void writeAttribute(const std::string& attName, const double& value);
81 
82  virtual void writeAttribute(const std::string& attName, boost::int32_t value);
83 
84  virtual void writeAttribute(const std::string& attName, boost::uint32_t value);
85 
86  virtual void writeAttribute(const std::string& attName, boost::int64_t value);
87 
88  virtual void writeAttribute(const std::string& attName, boost::uint64_t value);
89 
90  virtual void writeValue(const std::string& value);
91 
92  virtual void writeValue(const double& value);
93 
94  virtual void writeValue(boost::int32_t value);
95 
96  virtual void writeValue(boost::uint32_t value);
97 
98  virtual void writeValue(boost::int64_t value);
99 
100  virtual void writeValue(boost::uint64_t value);
101 
102  virtual void writeEndElement(const std::string& qName);
103 
104  /*virtual void writeEndDocument(std::ostream& ostr);*/
105 
106  private:
107 
108  std::ostream& m_ostr;
110  };
111 
112  } // end namespace xml
113 } // end namespace te
114 
115 #endif // __TERRALIB_XML_INTERNAL_WRITER_H
116 
#define TEXMLEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:119
Configuration flags for the XML API of TerraLib.
bool m_isOpened
Definition: Writer.h:109
std::ostream & m_ostr
Definition: Writer.h:108
This class models a XML writer object.
Definition: Writer.h:52