XMLFormatter.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/qt/af/XMLFormatter.h
22  *
23  * \brief A class for xml serialization formatting strings.
24  */
25 
26 #ifndef TE_QT_AF_XMLFORMATTER_H
27 #define TE_QT_AF_XMLFORMATTER_H
28 
29 #include "Config.h"
30 
31 #include "../../maptools/AbstractLayer.h"
32 
33 //STL
34 #include <list>
35 #include <string>
36 
37 namespace te
38 {
39  //Forward declarations
40  namespace da
41  {
42  class DataSourceInfo;
43  }
44 
45  namespace qt
46  {
47  namespace af
48  {
49  /*!
50  \class XMLFormatter
51 
52  \brief A class that formats strings.
53 
54  Use this class for changing strings, contained in some TerraLib objects, to XML percentage encode format and/or to human readable format. Use XML formatting before serializing the object to a XML file, for example, and human readable format after read the object from a XML.
55 
56  \ingroup af
57  */
59  {
60  public:
61 
62  /*!
63  \brief Formats the layer informations.
64 
65  \param l The layer.
66 
67  \param encode \a Pass true to change for XML percentage format and \a false for human readable format.
68 
69  \note The sublayers will be formatted too, using the \a encode passed.
70  */
71  static void format(te::map::AbstractLayer* l, const bool& encode);
72 
73  /*!
74  \brief Formats the data source informations.
75 
76  \param d The data source info.
77 
78  \param encode \a Pass true to change for XML percentage format and \a false for human readable format.
79  */
80  static void format(te::da::DataSourceInfo* d, const bool& encode);
81 
82  /*!
83  \brief Formats all data source informations registered in the \a te::da::DataSourceInfoManager object.
84 
85  \param encode \a Pass true to change for XML percentage format and \a false for human readable format.
86 
87  \sa te::da::DataSourceInfoManager
88  */
89  static void formatDataSourceInfos(const bool& encode);
90 
91  /*!
92  \brief Formats the string.
93 
94  \param s The string.
95 
96  \param encode \a Pass true to change for XML percentage format and \a false for human readable format.
97  */
98  static std::string format(const std::string& s, const bool& encode);
99  };
100  }
101  }
102 }
103 
104 
105 
106 
107 #endif // TE_QT_AF_XMLFORMATTER_H
This is the base class for layers.
Definition: AbstractLayer.h:76
Configuration flags for the TerraLib Application Framework.
std::string TECOMMONEXPORT encode(const traits &ts, const std::string &comp)
Encode the URI (sub) component.
URI C++ Library.
#define TEQTAFEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:71
A class that formats strings.
Definition: XMLFormatter.h:58
A class that represents a data source component.