Loading...
Searching...
No Matches
StringConverters.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/datatype/StringConverters.h
22
23 \brief A set of function that convert an String type to other types.
24*/
25
26#ifndef __TERRALIB_DATATYPE_INTERNAL_STRINGCONVERTERS_H
27#define __TERRALIB_DATATYPE_INTERNAL_STRINGCONVERTERS_H
28
29// TerraLib
30#include "Exception.h"
31#include "Config.h"
32
33namespace te
34{
35 namespace dt
36 {
37// Forward declarations
38 class AbstractData;
39
40 /** @name String Methods
41 * Methods related to String conversion.
42 */
43 //@{
44
45 /*!
46 \brief It converts an String data value to a Int16 data value.
47
48 \param d The input data value.
49
50 \return A new data value converted to Int16 data type. The caller will take the ownership of the returned data.
51
52 \exception Exception It throws an exception if the input abstract data is not a String type.
53 */
55
56 /*!
57 \brief It converts an String data value to an unsigned Int16 data value.
58
59 \param d The input data value.
60
61 \return A new data value converted to unsigned Int16 data type. The caller will take the ownership of the returned data.
62
63 \exception Exception It throws an exception if the input abstract data is not a String type.
64 */
66
67 /*!
68 \brief It converts an String data value to a Int32 data value.
69
70 \param d The input data value.
71
72 \return A new data value converted to Int32 data type. The caller will take the ownership of the returned data.
73
74 \exception Exception It throws an exception if the input abstract data is not a String type.
75 */
77
78 /*!
79 \brief It converts an String data value to an unsigned Int32 data value.
80
81 \param d The input data value.
82
83 \return A new data value converted to unsigned Int32 data type. The caller will take the ownership of the returned data.
84
85 \exception Exception It throws an exception if the input abstract data is not a String type.
86 */
88
89 /*!
90 \brief It converts an String data value to a Int64 data value.
91
92 \param d The input data value.
93
94 \return A new data value converted to Int64 data type. The caller will take the ownership of the returned data.
95
96 \exception Exception It throws an exception if the input abstract data is not a String type.
97 */
99
100 /*!
101 \brief It converts an String data value to an unsigned Int64 data value.
102
103 \param d The input data value.
104
105 \return A new data value converted to unsigned Int64 data type. The caller will take the ownership of the returned data.
106
107 \exception Exception It throws an exception if the input abstract data is not a String type.
108 */
110
111 /*!
112 \brief It converts an String data value to a boolean data value.
113
114 \param d The input data value.
115
116 \return A new data value converted to boolean data type. The caller will take the ownership of the returned data.
117
118 \exception Exception It throws an exception if the input abstract data is not a String type.
119 */
121
122 /*!
123 \brief It converts an String data value to a float data value.
124
125 \param d The input data value.
126
127 \return A new data value converted to float data type. The caller will take the ownership of the returned data.
128
129 \exception Exception It throws an exception if the input abstract data is not a String type.
130 */
132
133 /*!
134 \brief It converts an String data value to a double data value.
135
136 \param d The input data value.
137
138 \return A new data value converted to double data type. The caller will take the ownership of the returned data.
139
140 \exception Exception It throws an exception if the input abstract data is not a String type.
141 */
143
144 /*!
145 \brief It converts an String data value to a Numeric data value.
146
147 \param d The input data value.
148
149 \return A new data value converted to Numeric data type. The caller will take the ownership of the returned data.
150
151 \exception Exception It throws an exception if the input abstract data is not a String type.
152 */
154
155 /*!
156 \brief It converts an String data value to a DateTime data value.
157
158 \param d The input data value.
159
160 \return A new data value converted to DateTime data type. The caller will take the ownership of the returned data.
161
162 \exception Exception It throws an exception if the input abstract data is not a String type.
163 */
165
166 /*!
167 \brief Auxiliary method that asserts that the given data is an String type.
168
169 \param d The input data value.
170
171 \exception Exception It throws an exception if the input abstract data is not a String type.
172 */
174
175 //@}
176
177 } // end namespace dt
178} // end namespace te
179
180#endif // __TERRALIB_DATATYPE_INTERNAL_STRINGCONVERTERS_H
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:56
TEDATATYPEEXPORT AbstractData * StringToUInt32Converter(AbstractData *d)
It converts an String data value to an unsigned Int32 data value.
TEDATATYPEEXPORT AbstractData * StringToBooleanConverter(AbstractData *d)
It converts an String data value to a boolean data value.
TEDATATYPEEXPORT AbstractData * StringToDoubleConverter(AbstractData *d)
It converts an String data value to a double data value.
TEDATATYPEEXPORT AbstractData * StringToNumericConverter(AbstractData *d)
It converts an String data value to a Numeric data value.
TEDATATYPEEXPORT AbstractData * StringToUInt16Converter(AbstractData *d)
It converts an String data value to an unsigned Int16 data value.
TEDATATYPEEXPORT AbstractData * StringToInt32Converter(AbstractData *d)
It converts an String data value to a Int32 data value.
TEDATATYPEEXPORT AbstractData * StringToInt64Converter(AbstractData *d)
It converts an String data value to a Int64 data value.
TEDATATYPEEXPORT AbstractData * StringToInt16Converter(AbstractData *d)
It converts an String data value to a Int16 data value.
TEDATATYPEEXPORT AbstractData * StringToUInt64Converter(AbstractData *d)
It converts an String data value to an unsigned Int64 data value.
TEDATATYPEEXPORT void AssertString(AbstractData *d)
Auxiliary method that asserts that the given data is an String type.
TEDATATYPEEXPORT AbstractData * StringToFloatConverter(AbstractData *d)
It converts an String data value to a float data value.
TEDATATYPEEXPORT AbstractData * StringToDateTimeConverter(AbstractData *d)
It converts an String data value to a DateTime data value.
TerraLib.
#define TEDATATYPEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
Proxy configuration file for TerraView (see terraview_config.h).
An exception class for the XML module.