Writer.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/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 "AbstractWriter.h"
32 #include "Config.h"
33 
34 // STL
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  */
53  {
54  public:
55 
56  Writer();
57 
58  /*! \brief Constructor. */
59  //Writer(std::ostream& ostr);
60 
61  /*! \brief Virtual destructor. */
62  ~Writer();
63 
64  void writeStartDocument(const std::string& encoding, const std::string& standalone);
65 
66  void writeStartElement(const std::string& qName);
67 
68  void writeElement(const std::string& qName, const std::string& value);
69 
70  void writeElement(const std::string& qName, const double& value);
71 
72  void writeElement(const std::string& qName, boost::int32_t value);
73 
74  void writeElement(const std::string& qName, boost::uint32_t value);
75 
76  void writeElement(const std::string& qName, boost::int64_t value);
77 
78  void writeElement(const std::string& qName, boost::uint64_t value);
79 
80  void writeAttribute(const std::string& attName, const std::string& value);
81 
82  void writeAttribute(const std::string& attName, const double& value);
83 
84  void writeAttribute(const std::string& attName, boost::int32_t value);
85 
86  void writeAttribute(const std::string& attName, boost::uint32_t value);
87 
88  void writeAttribute(const std::string& attName, boost::int64_t value);
89 
90  void writeAttribute(const std::string& attName, boost::uint64_t value);
91 
92  void writeValue(const std::string& value);
93 
94  void writeValue(const double& value);
95 
96  void writeValue(boost::int32_t value);
97 
98  void writeValue(boost::uint32_t value);
99 
100  void writeValue(boost::int64_t value);
101 
102  void writeValue(boost::uint64_t value);
103 
104  void writeEndElement(const std::string& qName);
105 
106  void setRootNamespaceURI(const std::string& uri);
107 
108  void writeToFile();
109 
110  private:
111 
112  std::ostream* m_ostr;
114  };
115 
116  } // end namespace xml
117 } // end namespace te
118 
119 #endif // __TERRALIB_XML_INTERNAL_WRITER_H
120 
bool m_isOpened
Definition: Writer.h:113
This class models a XML writer object.
Definition: Writer.h:52
This class models a XML writer object.
Configuration flags for the XML API of TerraLib.
URI C++ Library.
std::ostream * m_ostr
Definition: Writer.h:112
This class models a XML writer object.
#define TEXMLEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:88