GDAL
gdal_utils_priv.h
1 /******************************************************************************
2  * $Id$
3  *
4  * Project: GDAL Utilities
5  * Purpose: GDAL Utilities Private Declarations.
6  * Author: Even Rouault <even.rouault at spatialys.com>
7  *
8  * ****************************************************************************
9  * Copyright (c) 2015, Even Rouault <even.rouault at spatialys.com>
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a
12  * copy of this software and associated documentation files (the "Software"),
13  * to deal in the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  * and/or sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included
19  * in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  ****************************************************************************/
29 
30 #ifndef GDAL_UTILS_PRIV_H_INCLUDED
31 #define GDAL_UTILS_PRIV_H_INCLUDED
32 
33 #ifndef DOXYGEN_SKIP
34 
35 #include "cpl_port.h"
36 #include "cpl_string.h"
37 #include "gdal_utils.h"
38 
39 /* This file is only meant at being used by the XXXX_bin.cpp and XXXX_lib.cpp
40  * files */
41 
43 
45 {
46  /* Filename to open. */
47  std::string osFilename{};
48 
49  /* Open options. */
50  CPLStringList aosOpenOptions{};
51 
52  /* For reporting on a particular subdataset */
53  int nSubdataset = 0;
54 
55  /* Allowed input drivers. */
56  CPLStringList aosAllowedInputDrivers{};
57 };
58 
60 {
61  std::string osProcessing;
62  std::string osSrcFilename;
63  std::string osColorFilename;
64  std::string osDstFilename;
65  bool bQuiet = false;
66 };
67 
69 
70 /* Access modes */
71 typedef enum
72 {
73  ACCESS_CREATION,
74  ACCESS_UPDATE, /* open existing output datasource in update mode rather than
75  trying to create a new one */
76  ACCESS_APPEND, /* append to existing layer instead of creating new */
77  ACCESS_OVERWRITE /* delete the output layer and recreate it empty */
78 } GDALVectorTranslateAccessMode;
79 
81 {
82  std::string osDataSource{};
83  std::string osDestDataSource{};
84  bool bQuiet = false;
85  CPLStringList aosOpenOptions{};
86  std::string osFormat;
87  GDALVectorTranslateAccessMode eAccessMode = ACCESS_CREATION;
88  bool bShowUsageIfError = false;
89 
90  /* Allowed input drivers. */
91  CPLStringList aosAllowInputDrivers{};
92 };
93 
95 {
96  /* Filename to open. */
97  std::string osFilename{};
98 
99  /* Allowed input drivers. */
100  CPLStringList aosAllowInputDrivers{};
101 
102  /* Open options. */
103  CPLStringList aosOpenOptions{};
104 };
105 
107 {
108  std::string osSource{};
109  std::string osDest{};
110  std::string osFormat{};
111  bool bQuiet = false;
112  bool bUpdate = false;
113 
114  /* Allowed input drivers. */
115  CPLStringList aosAllowInputDrivers{};
116 
117  /* Open options. */
118  CPLStringList aosOpenOptions{};
119 };
120 
122 {
123  /* Filename to open. */
124  std::string osFilename{};
125 
126  bool bVerbose = true;
127 
128  bool bReadOnly = false;
129 
130  bool bUpdate = false;
131 
132  std::string osSQLStatement{};
133 
134  /* Open options. */
135  CPLStringList aosOpenOptions{};
136 
137  /* Allowed input drivers. */
138  CPLStringList aosAllowInputDrivers{};
139 };
140 
142 {
143  std::string osSource{};
144  std::string osDest{};
145  bool bQuiet = false;
146  CPLStringList aosOpenOptions{};
147 };
148 
150 {
151  std::string osSource{};
152  bool bDestSpecified = false;
153  std::string osDest{};
154  bool bQuiet = false;
155  CPLStringList aosOpenOptions{};
156  bool bCreateOutput = false;
157  std::string osFormat{};
158 };
159 
161 {
162  std::string osSource{};
163  bool bDestSpecified = false;
164  std::string osDest{};
165  bool bQuiet = false;
166  CPLStringList aosOpenOptions{};
167  bool bCreateOutput = false;
168  std::string osFormat{};
169 
171  bool bOverwrite = false;
172 
173  std::string osDestLayerName{};
174 };
175 
177 {
178  CPLStringList aosSrcFiles{};
179  bool bDestSpecified = false;
180  std::string osDest{};
181  bool bQuiet = false;
182 };
183 
185 {
186  std::string osInFile{};
187  std::string osOutFile{};
188  bool bQuiet = false;
189 };
190 
192 {
193  std::string osSource{};
194  std::string osDest{};
195  bool bQuiet = false;
196  bool bCopySubDatasets = false;
197  CPLStringList aosOpenOptions{};
198  std::string osFormat{};
199 
200  /* Allowed input drivers. */
201  CPLStringList aosAllowedInputDrivers{};
202 };
203 
205 {
206  CPLStringList aosSrcFiles{};
207  std::string osDstFilename{};
208  bool bQuiet = false;
209  CPLStringList aosOpenOptions{};
210 
212  CPLStringList aosDestOpenOptions{};
213 
214  CPLStringList aosCreateOptions{};
215 
216  bool bOverwrite = false;
217  bool bCreateOutput = false;
218 
219  /* Allowed input drivers. */
220  CPLStringList aosAllowedInputDrivers{};
221 };
222 
224 {
225  CPLStringList aosSrcFiles{};
226  std::string osDstFilename{};
227  bool bQuiet = false;
228  bool bOverwrite = false;
229 };
230 
231 std::string CPL_DLL GDALNearblackGetParserUsage();
232 
233 std::string CPL_DLL GDALVectorInfoGetParserUsage();
234 
235 std::string CPL_DLL GDALTranslateGetParserUsage();
236 
237 std::string CPL_DLL GDALMultiDimTranslateAppGetParserUsage();
238 
239 std::string CPL_DLL GDALVectorTranslateGetParserUsage();
240 
241 std::string CPL_DLL GDALWarpAppGetParserUsage();
242 
243 std::string CPL_DLL GDALInfoAppGetParserUsage();
244 
245 std::string CPL_DLL GDALMultiDimInfoAppGetParserUsage();
246 
247 std::string CPL_DLL GDALGridGetParserUsage();
248 
249 std::string CPL_DLL GDALBuildVRTGetParserUsage();
250 
251 std::string CPL_DLL GDALTileIndexAppGetParserUsage();
252 
253 std::string CPL_DLL GDALFootprintAppGetParserUsage();
254 
260 std::string CPL_DLL
261 GDALDEMAppGetParserUsage(const std::string &osProcessingMode);
262 
263 #endif /* #ifndef DOXYGEN_SKIP */
264 
265 #endif /* GDAL_UTILS_PRIV_H_INCLUDED */
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:449
Core portability definitions for CPL.
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:299
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:295
Various convenience functions for working with strings and string lists.
Public (C callable) GDAL Utilities entry points.
struct GDALBuildVRTOptionsForBinary GDALBuildVRTOptionsForBinary
Opaque type.
Definition: gdal_utils.h:239
struct GDALInfoOptionsForBinary GDALInfoOptionsForBinary
Opaque type.
Definition: gdal_utils.h:52
struct GDALFootprintOptionsForBinary GDALFootprintOptionsForBinary
Opaque type.
Definition: gdal_utils.h:218
struct GDALMultiDimTranslateOptionsForBinary GDALMultiDimTranslateOptionsForBinary
Opaque type.
Definition: gdal_utils.h:276
struct GDALVectorTranslateOptionsForBinary GDALVectorTranslateOptionsForBinary
Opaque type.
Definition: gdal_utils.h:113
struct GDALVectorInfoOptionsForBinary GDALVectorInfoOptionsForBinary
Opaque type.
Definition: gdal_utils.h:299
struct GDALWarpAppOptionsForBinary GDALWarpAppOptionsForBinary
Opaque type.
Definition: gdal_utils.h:87
struct GDALDEMProcessingOptionsForBinary GDALDEMProcessingOptionsForBinary
Opaque type.
Definition: gdal_utils.h:135
struct GDALNearblackOptionsForBinary GDALNearblackOptionsForBinary
Opaque type.
Definition: gdal_utils.h:156
struct GDALGridOptionsForBinary GDALGridOptionsForBinary
Opaque type.
Definition: gdal_utils.h:177
struct GDALTileIndexOptionsForBinary GDALTileIndexOptionsForBinary
Opaque type.
Definition: gdal_utils.h:314
struct GDALMultiDimInfoOptionsForBinary GDALMultiDimInfoOptionsForBinary
Opaque type.
Definition: gdal_utils.h:261
struct GDALTranslateOptionsForBinary GDALTranslateOptionsForBinary
Opaque type.
Definition: gdal_utils.h:66
struct GDALRasterizeOptionsForBinary GDALRasterizeOptionsForBinary
Opaque type.
Definition: gdal_utils.h:197