Utils.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/Utils.h
22 
23  \brief Utilitary function for data type module.
24 */
25 
26 #ifndef __TERRALIB_DATATYPE_INTERNAL_UTILS_H
27 #define __TERRALIB_DATATYPE_INTERNAL_UTILS_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 // STL
33 #include <vector>
34 #include <string>
35 
36 namespace te
37 {
38  namespace dt
39  {
40 // Forward declaration
41  class CompositeProperty;
42  class Property;
43 
44  /*!
45  \brief It creates a list with the properties position in the composite property.
46 
47  \param properties The properties to find their position in the composite.
48  \param cp The composite property that contains the properties.
49  \param poslist An output list with the properties position.
50 
51  \pre The composite property cp must contains all informed properties.
52 
53  \note The function will append the positions into the poslist. It doesn't clear previous data.
54  */
55  TEDATATYPEEXPORT void GetPropertiesPosition(const std::vector<Property*>& properties,
56  const CompositeProperty* cp,
57  std::vector<std::size_t>& poslist);
58 
59  /*!
60  \brief It convert a string to a DataType.
61 
62  \param dataType String to be converted.
63 
64  \return DataType integer
65  */
66  TEDATATYPEEXPORT int Convert2Terralib(const std::string& dataType);
67 
68  /*!
69  \brief Function used to convert from a int (Data Type Enum) to a string
70 
71  \param dataType Integer value that defines the data type
72 
73  \return A string with the data type name.
74  */
75  TEDATATYPEEXPORT std::string ConvertDataTypeToString(const int& dataType);
76 
77  } // end namespace dt
78 } // end namespace te
79 
80 #endif // __TERRALIB_DATATYPE_INTERNAL_UTILS_H
81 
#define TEDATATYPEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
TEDATATYPEEXPORT int Convert2Terralib(const std::string &dataType)
It convert a string to a DataType.
Configuration flags for the DataType module of TerraLib.
TEDATATYPEEXPORT std::string ConvertDataTypeToString(const int &dataType)
Function used to convert from a int (Data Type Enum) to a string.
URI C++ Library.
TEDATATYPEEXPORT void GetPropertiesPosition(const std::vector< Property * > &properties, const CompositeProperty *cp, std::vector< std::size_t > &poslist)
It creates a list with the properties position in the composite property.