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
42 CPL_C_START
43
44struct GDALInfoOptionsForBinary
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
59struct GDALDEMProcessingOptionsForBinary
60{
61 char *pszProcessing;
62 char *pszSrcFilename;
63 char *pszColorFilename;
64 char *pszDstFilename;
65 int bQuiet;
66};
67
68 CPL_C_END
69
70/* Access modes */
71typedef 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
80struct GDALVectorTranslateOptionsForBinary
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
89 /* Allowed input drivers. */
90 CPLStringList aosAllowInputDrivers{};
91};
92
93struct GDALMultiDimInfoOptionsForBinary
94{
95 /* Filename to open. */
96 std::string osFilename{};
97
98 /* Allowed input drivers. */
99 CPLStringList aosAllowInputDrivers{};
100
101 /* Open options. */
102 CPLStringList aosOpenOptions{};
103};
104
105struct GDALMultiDimTranslateOptionsForBinary
106{
107 std::string osSource{};
108 std::string osDest{};
109 std::string osFormat{};
110 bool bQuiet = false;
111 bool bUpdate = false;
112
113 /* Allowed input drivers. */
114 CPLStringList aosAllowInputDrivers{};
115
116 /* Open options. */
117 CPLStringList aosOpenOptions{};
118};
119
120struct GDALVectorInfoOptionsForBinary
121{
122 /* Filename to open. */
123 std::string osFilename{};
124
125 bool bVerbose = true;
126
127 bool bReadOnly = false;
128
129 bool bUpdate = false;
130
131 std::string osSQLStatement{};
132
133 /* Open options. */
134 CPLStringList aosOpenOptions{};
135
136 /* Allowed input drivers. */
137 CPLStringList aosAllowInputDrivers{};
138};
139
140struct GDALGridOptionsForBinary
141{
142 std::string osSource{};
143 std::string osDest{};
144 bool bQuiet = false;
145 CPLStringList aosOpenOptions{};
146};
147
148struct GDALRasterizeOptionsForBinary
149{
150 std::string osSource{};
151 bool bDestSpecified = false;
152 std::string osDest{};
153 bool bQuiet = false;
154 CPLStringList aosOpenOptions{};
155 bool bCreateOutput = false;
156 std::string osFormat{};
157};
158
159struct GDALFootprintOptionsForBinary
160{
161 std::string osSource{};
162 bool bDestSpecified = false;
163 std::string osDest{};
164 bool bQuiet = false;
165 CPLStringList aosOpenOptions{};
166 bool bCreateOutput = false;
167 std::string osFormat{};
168
170 bool bOverwrite = false;
171
172 std::string osDestLayerName{};
173};
174
175struct GDALTileIndexOptionsForBinary
176{
177 CPLStringList aosSrcFiles{};
178 bool bDestSpecified = false;
179 std::string osDest{};
180 bool bQuiet = false;
181};
182
183struct GDALNearblackOptionsForBinary
184{
185 std::string osInFile{};
186 std::string osOutFile{};
187 bool bQuiet = false;
188};
189
190struct GDALTranslateOptionsForBinary
191{
192 std::string osSource{};
193 std::string osDest{};
194 bool bQuiet = false;
195 bool bCopySubDatasets = false;
196 CPLStringList aosOpenOptions{};
197 std::string osFormat{};
198
199 /* Allowed input drivers. */
200 CPLStringList aosAllowedInputDrivers{};
201};
202
203struct GDALWarpAppOptionsForBinary
204{
205 CPLStringList aosSrcFiles{};
206 std::string osDstFilename{};
207 bool bQuiet = false;
208 CPLStringList aosOpenOptions{};
209
211 CPLStringList aosDestOpenOptions{};
212
213 CPLStringList aosCreateOptions{};
214
215 bool bOverwrite = false;
216 bool bCreateOutput = false;
217
218 /* Allowed input drivers. */
219 CPLStringList aosAllowedInputDrivers{};
220};
221
222struct GDALBuildVRTOptionsForBinary
223{
224 CPLStringList aosSrcFiles{};
225 std::string osDstFilename{};
226 bool bQuiet = false;
227 bool bOverwrite = false;
228};
229
230std::string CPL_DLL GDALNearblackGetParserUsage();
231
232std::string CPL_DLL GDALVectorInfoGetParserUsage();
233
234std::string CPL_DLL GDALTranslateGetParserUsage();
235
236std::string CPL_DLL GDALVectorTranslateGetParserUsage();
237
238std::string CPL_DLL GDALWarpAppGetParserUsage();
239
240std::string CPL_DLL GDALInfoAppGetParserUsage();
241
242std::string CPL_DLL GDALGridGetParserUsage();
243
244std::string CPL_DLL GDALBuildVRTGetParserUsage();
245
246#endif /* #ifndef DOXYGEN_SKIP */
247
248#endif /* GDAL_UTILS_PRIV_H_INCLUDED */
CPLStringList
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:449
cpl_port.h
Core portability definitions for CPL.
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:299
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:295
cpl_string.h
Various convenience functions for working with strings and string lists.
gdal_utils.h
Public (C callable) GDAL Utilities entry points.
GDALBuildVRTOptionsForBinary
struct GDALBuildVRTOptionsForBinary GDALBuildVRTOptionsForBinary
Opaque type.
Definition: gdal_utils.h:239
GDALInfoOptionsForBinary
struct GDALInfoOptionsForBinary GDALInfoOptionsForBinary
Opaque type.
Definition: gdal_utils.h:52
GDALFootprintOptionsForBinary
struct GDALFootprintOptionsForBinary GDALFootprintOptionsForBinary
Opaque type.
Definition: gdal_utils.h:218
GDALMultiDimTranslateOptionsForBinary
struct GDALMultiDimTranslateOptionsForBinary GDALMultiDimTranslateOptionsForBinary
Opaque type.
Definition: gdal_utils.h:276
GDALVectorTranslateOptionsForBinary
struct GDALVectorTranslateOptionsForBinary GDALVectorTranslateOptionsForBinary
Opaque type.
Definition: gdal_utils.h:113
GDALVectorInfoOptionsForBinary
struct GDALVectorInfoOptionsForBinary GDALVectorInfoOptionsForBinary
Opaque type.
Definition: gdal_utils.h:299
GDALWarpAppOptionsForBinary
struct GDALWarpAppOptionsForBinary GDALWarpAppOptionsForBinary
Opaque type.
Definition: gdal_utils.h:87
GDALDEMProcessingOptionsForBinary
struct GDALDEMProcessingOptionsForBinary GDALDEMProcessingOptionsForBinary
Opaque type.
Definition: gdal_utils.h:135
GDALNearblackOptionsForBinary
struct GDALNearblackOptionsForBinary GDALNearblackOptionsForBinary
Opaque type.
Definition: gdal_utils.h:156
GDALGridOptionsForBinary
struct GDALGridOptionsForBinary GDALGridOptionsForBinary
Opaque type.
Definition: gdal_utils.h:177
GDALTileIndexOptionsForBinary
struct GDALTileIndexOptionsForBinary GDALTileIndexOptionsForBinary
Opaque type.
Definition: gdal_utils.h:314
GDALMultiDimInfoOptionsForBinary
struct GDALMultiDimInfoOptionsForBinary GDALMultiDimInfoOptionsForBinary
Opaque type.
Definition: gdal_utils.h:261
GDALTranslateOptionsForBinary
struct GDALTranslateOptionsForBinary GDALTranslateOptionsForBinary
Opaque type.
Definition: gdal_utils.h:66
GDALRasterizeOptionsForBinary
struct GDALRasterizeOptionsForBinary GDALRasterizeOptionsForBinary
Opaque type.
Definition: gdal_utils.h:197