All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Utils.cpp
Go to the documentation of this file.
1 // Terralib Raster Manager tool
2 #include "Utils.h"
3 
4 // TerraLib
6 
7 bool te::tools::dscopy::Utils::loadModules(std::string & errorMessage)
8 {
9 
10  {
12 
13  #if TE_PLATFORM == TE_PLATFORMCODE_MSWINDOWS
14  info.m_type = "dll";
15  #elif TE_PLATFORM == TE_PLATFORMCODE_LINUX
16  info.m_type = "s.o.";
17  #elif TE_PLATFORM == TE_PLATFORMCODE_APPLE
18  info.m_type = "dylib";
19  #else
20  #error "Platform not supported yet"
21  #endif
22 
23  info.m_name = "OGR DataSource Driver";
24  info.m_description = "This data source driver supports...";
25 
26  #if TE_PLATFORM == TE_PLATFORMCODE_MSWINDOWS
27  #ifdef NDEBUG
28  info.m_mainFile = "terralib_ogr.dll";
29  #else
30  info.m_mainFile = "terralib_ogr_d.dll";
31  #endif
32  #endif
33 
34  #if TE_PLATFORM == TE_PLATFORMCODE_LINUX
35  #ifdef NDEBUG
36  info.m_mainFile = "libterralib_ogr.so";
37  #else
38  info.m_mainFile = "libterralib_ogr_d.so";
39  #endif
40  #endif
41 
42  #if TE_PLATFORM == TE_PLATFORMCODE_APPLE
43  #ifdef NDEBUG
44  info.m_mainFile = "terralib_ogr.dylib"; // should it be different????
45  #else
46  info.m_mainFile = "terralib_ogr.dylib";
47  #endif
48  #endif
49 
50  te::plugin::PluginManager::getInstance().loadPlugin(info);
51  }
52 
53  {
55 
56  #if TE_PLATFORM == TE_PLATFORMCODE_MSWINDOWS
57  info.m_type = "dll";
58  #elif TE_PLATFORM == TE_PLATFORMCODE_LINUX
59  info.m_type = "s.o.";
60  #elif TE_PLATFORM == TE_PLATFORMCODE_APPLE
61  info.m_type = "dylib";
62  #else
63  #error "Platform not supported yet"
64  #endif
65 
66  info.m_name = "GDAL DataSource Driver";
67  info.m_description = "This data source driver supports...";
68 
69  #if TE_PLATFORM == TE_PLATFORMCODE_MSWINDOWS
70  #ifdef NDEBUG
71  info.m_mainFile = "terralib_gdal.dll";
72  #else
73  info.m_mainFile = "terralib_gdal_d.dll";
74  #endif
75  #endif
76 
77  #if TE_PLATFORM == TE_PLATFORMCODE_LINUX
78  #ifdef NDEBUG
79  info.m_mainFile = "libterralib_gdal.so";
80  #else
81  info.m_mainFile = "libterralib_gdal_d.so";
82  #endif
83  #endif
84 
85  #if TE_PLATFORM == TE_PLATFORMCODE_APPLE
86  #ifdef NDEBUG
87  info.m_mainFile = "terralib_gdal.dylib";
88  #else
89  info.m_mainFile = "terralib_gdal.dylib";
90  #endif
91  #endif
92 
93  te::plugin::PluginManager::getInstance().loadPlugin(info);
94  }
95 
96  {
98 
99  #if TE_PLATFORM == TE_PLATFORMCODE_MSWINDOWS
100  info.m_type = "dll";
101  #elif TE_PLATFORM == TE_PLATFORMCODE_LINUX
102  info.m_type = "s.o.";
103  #elif TE_PLATFORM == TE_PLATFORMCODE_APPLE
104  info.m_type = "dylib";
105  #else
106  #error "Platform not supported yet"
107  #endif
108 
109  info.m_name = "PostGIS DataSource Driver";
110  info.m_description = "This data source driver supports...";
111 
112  #if TE_PLATFORM == TE_PLATFORMCODE_MSWINDOWS
113  #ifdef NDEBUG
114  info.m_mainFile = "terralib_postgis.dll";
115  #else
116  info.m_mainFile = "terralib_postgis_d.dll";
117  #endif
118  #endif
119 
120  #if TE_PLATFORM == TE_PLATFORMCODE_LINUX
121  #ifdef NDEBUG
122  info.m_mainFile = "libterralib_postgis.so";
123  #else
124  info.m_mainFile = "libterralib_postgis_d.so";
125  #endif
126  #endif
127 
128  #if TE_PLATFORM == TE_PLATFORMCODE_APPLE
129  #ifdef NDEBUG
130  info.m_mainFile = "terralib_postgis.dylib";
131  #else
132  info.m_mainFile = "terralib_postgis.dylib";
133  #endif
134  #endif
135 
136  te::plugin::PluginManager::getInstance().loadPlugin(info);
137 
138  }
139 
140  {
142 
143  #if TE_PLATFORM == TE_PLATFORMCODE_MSWINDOWS
144  info.m_type = "dll";
145  #elif TE_PLATFORM == TE_PLATFORMCODE_LINUX
146  info.m_type = "s.o.";
147  #elif TE_PLATFORM == TE_PLATFORMCODE_APPLE
148  info.m_type = "dylib";
149  #else
150  #error "Platform not supported yet"
151  #endif
152 
153  info.m_name = "MEM DataSource Driver";
154  info.m_description = "This data source driver supports...";
155 
156  #if TE_PLATFORM == TE_PLATFORMCODE_MSWINDOWS
157  #ifdef NDEBUG
158  info.m_mainFile = "terralib_memory.dll";
159  #else
160  info.m_mainFile = "terralib_memory_d.dll";
161  #endif
162  #endif
163 
164  #if TE_PLATFORM == TE_PLATFORMCODE_LINUX
165  #ifdef NDEBUG
166  info.m_mainFile = "libterralib_memory.so";
167  #else
168  info.m_mainFile = "libterralib_memory_d.so";
169  #endif
170  #endif
171 
172  #if TE_PLATFORM == TE_PLATFORMCODE_APPLE
173  #ifdef NDEBUG
174  info.m_mainFile = "terralib_memory.dylib"; // should it be different????
175  #else
176  info.m_mainFile = "terralib_memory.dylib";
177  #endif
178  #endif
179 
180  te::plugin::PluginManager::getInstance().loadPlugin(info);
181  }
182 
183  return true;
184 }
std::string m_name
The plugin name: an internal value used to identify the plugin in the system. Must be a unique value...
Definition: PluginInfo.h:66
static PluginManager & getInstance()
It returns a reference to the singleton instance.
A singleton for managing plugins.
std::string m_description
A brief explanation about the plugin.
Definition: PluginInfo.h:68
The basic information about a plugin.
Definition: PluginInfo.h:61
static bool loadModules(std::string &errorMessage)
Load Terralib modules.
Definition: Utils.cpp:7
Terralib Raster Manager Tool Utils.