GDAL
gdal_utils_priv.h
1/******************************************************************************
2 *
3 * Project: GDAL Utilities
4 * Purpose: GDAL Utilities Private Declarations.
5 * Author: Even Rouault <even.rouault at spatialys.com>
6 *
7 * ****************************************************************************
8 * Copyright (c) 2015, Even Rouault <even.rouault at spatialys.com>
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef GDAL_UTILS_PRIV_H_INCLUDED
14#define GDAL_UTILS_PRIV_H_INCLUDED
15
16#ifndef DOXYGEN_SKIP
17
18#include "cpl_port.h"
19#include "cpl_string.h"
20#include "gdal_utils.h"
21
22#include <functional>
23
24/* This file is only meant at being used by the XXXX_bin.cpp and XXXX_lib.cpp */
25
27
29{
30 /* Filename to open. */
31 std::string osFilename{};
32
33 /* Open options. */
34 CPLStringList aosOpenOptions{};
35
36 /* For reporting on a particular subdataset */
37 int nSubdataset = 0;
38
39 /* Allowed input drivers. */
40 CPLStringList aosAllowedInputDrivers{};
41};
42
44{
45 std::string osProcessing{};
46 std::string osSrcFilename{};
47 std::string osColorFilename{};
48 std::string osDstFilename{};
49 bool bQuiet = false;
50};
51
53
54/* Access modes */
55typedef enum
56{
57 ACCESS_CREATION,
58 ACCESS_UPDATE, /* open existing output datasource in update mode rather than
59 trying to create a new one */
60 ACCESS_APPEND, /* append to existing layer instead of creating new */
61 ACCESS_OVERWRITE /* delete the output layer and recreate it empty */
62} GDALVectorTranslateAccessMode;
63
65{
66 std::string osDataSource{};
67 std::string osDestDataSource{};
68 bool bQuiet = false;
69 CPLStringList aosOpenOptions{};
70 std::string osFormat{};
71 GDALVectorTranslateAccessMode eAccessMode = ACCESS_CREATION;
72 bool bShowUsageIfError = false;
73
74 /* Allowed input drivers. */
75 CPLStringList aosAllowInputDrivers{};
76};
77
79{
80 CPLStringList aosOpenOptions{};
81 CPLStringList aosCreationOptions{};
82 bool bQuiet = false;
83 std::string osDestDataSource{};
84 std::string osSrcDataSource{};
85};
86
88{
89 /* Filename to open. */
90 std::string osFilename{};
91
92 /* Allowed input drivers. */
93 CPLStringList aosAllowInputDrivers{};
94
95 /* Open options. */
96 CPLStringList aosOpenOptions{};
97};
98
100{
101 std::string osSource{};
102 std::string osDest{};
103 std::string osFormat{};
104 bool bQuiet = false;
105 bool bUpdate = false;
106
107 /* Allowed input drivers. */
108 CPLStringList aosAllowInputDrivers{};
109
110 /* Open options. */
111 CPLStringList aosOpenOptions{};
112};
113
115{
116 /* Filename to open. */
117 std::string osFilename{};
118
119 bool bVerbose = true;
120
121 bool bReadOnly = false;
122
123 bool bUpdate = false;
124
125 std::string osSQLStatement{};
126
127 /* Open options. */
128 CPLStringList aosOpenOptions{};
129
130 /* Allowed input drivers. */
131 CPLStringList aosAllowInputDrivers{};
132};
133
135{
136 std::string osSource{};
137 std::string osDest{};
138 bool bQuiet = false;
139 CPLStringList aosOpenOptions{};
140};
141
143{
144 std::string osSource{};
145 bool bDestSpecified = false;
146 std::string osDest{};
147 bool bQuiet = false;
148 CPLStringList aosOpenOptions{};
149 bool bCreateOutput = false;
150 std::string osFormat{};
151};
152
154{
155 std::string osSource{};
156 bool bDestSpecified = false;
157 std::string osDest{};
158 bool bQuiet = false;
159 CPLStringList aosOpenOptions{};
160 bool bCreateOutput = false;
161 std::string osFormat{};
162
164 bool bOverwrite = false;
165
166 std::string osDestLayerName{};
167};
168
170{
171 CPLStringList aosSrcFiles{};
172 bool bDestSpecified = false;
173 std::string osDest{};
174 bool bQuiet = false;
175};
176
178{
179 std::string osInFile{};
180 std::string osOutFile{};
181 bool bQuiet = false;
182};
183
185{
186 std::string osSource{};
187 std::string osDest{};
188 bool bQuiet = false;
189 bool bCopySubDatasets = false;
190 CPLStringList aosOpenOptions{};
191 CPLStringList aosCreateOptions{};
192 std::string osFormat{};
193
194 /* Allowed input drivers. */
195 CPLStringList aosAllowedInputDrivers{};
196};
197
199{
200 CPLStringList aosSrcFiles{};
201 std::string osDstFilename{};
202 bool bQuiet = false;
203 CPLStringList aosOpenOptions{};
204
206 CPLStringList aosDestOpenOptions{};
207
208 CPLStringList aosCreateOptions{};
209
210 bool bOverwrite = false;
211 bool bCreateOutput = false;
212
213 /* Allowed input drivers. */
214 CPLStringList aosAllowedInputDrivers{};
215};
216
218{
219 CPLStringList aosSrcFiles{};
220 std::string osDstFilename{};
221 bool bQuiet = false;
222 bool bOverwrite = false;
223};
224
225std::string CPL_DLL GDALNearblackGetParserUsage();
226
227std::string CPL_DLL GDALVectorInfoGetParserUsage();
228
229std::string CPL_DLL GDALTranslateGetParserUsage();
230
231std::string CPL_DLL GDALMultiDimTranslateAppGetParserUsage();
232
233std::string CPL_DLL GDALVectorTranslateGetParserUsage();
234
235std::string CPL_DLL GDALWarpAppGetParserUsage();
236
237std::string CPL_DLL GDALInfoAppGetParserUsage();
238
239std::string CPL_DLL GDALMultiDimInfoAppGetParserUsage();
240
241std::string CPL_DLL GDALGridGetParserUsage();
242
243std::string CPL_DLL GDALContourGetParserUsage();
244
245std::string CPL_DLL GDALBuildVRTGetParserUsage();
246
247std::string CPL_DLL GDALTileIndexAppGetParserUsage();
248
249std::string CPL_DLL GDALFootprintAppGetParserUsage();
250
251std::string CPL_DLL GDALRasterizeAppGetParserUsage();
252
258std::string CPL_DLL
259GDALDEMAppGetParserUsage(const std::string &osProcessingMode);
260
261GDALDatasetH GDALTileIndexInternal(const char *pszDest,
262 GDALDatasetH hTileIndexDS, OGRLayerH hLayer,
263 int nSrcCount,
264 const char *const *papszSrcDSNames,
265 const GDALTileIndexOptions *psOptionsIn,
266 int *pbUsageError);
267
269
270void EmitTextDisplayOfCRS(
271 const OGRSpatialReference *poSRS, const std::string &osCRSFormat,
272 const std::string &osIntroText,
273 std::function<void(const std::string &)> printFunction);
274
275#endif /* #ifndef DOXYGEN_SKIP */
276
277#endif /* GDAL_UTILS_PRIV_H_INCLUDED */
String list class designed around our use of C "char**" string lists.
Definition cpl_string.h:476
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:152
Core portability definitions for CPL.
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:279
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:275
Various convenience functions for working with strings and string lists.
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition gdal_fwd.h:42
void * OGRLayerH
Opaque type for a layer (OGRLayer)
Definition gdal_fwd.h:157
Public (C callable) GDAL Utilities entry points.
struct GDALBuildVRTOptionsForBinary GDALBuildVRTOptionsForBinary
Opaque type.
Definition gdal_utils.h:256
struct GDALInfoOptionsForBinary GDALInfoOptionsForBinary
Opaque type.
Definition gdal_utils.h:35
struct GDALFootprintOptionsForBinary GDALFootprintOptionsForBinary
Opaque type.
Definition gdal_utils.h:235
struct GDALMultiDimTranslateOptionsForBinary GDALMultiDimTranslateOptionsForBinary
Opaque type.
Definition gdal_utils.h:293
struct GDALVectorTranslateOptionsForBinary GDALVectorTranslateOptionsForBinary
Opaque type.
Definition gdal_utils.h:96
struct GDALVectorInfoOptionsForBinary GDALVectorInfoOptionsForBinary
Opaque type.
Definition gdal_utils.h:316
struct GDALWarpAppOptionsForBinary GDALWarpAppOptionsForBinary
Opaque type.
Definition gdal_utils.h:70
struct GDALDEMProcessingOptionsForBinary GDALDEMProcessingOptionsForBinary
Opaque type.
Definition gdal_utils.h:118
struct GDALNearblackOptionsForBinary GDALNearblackOptionsForBinary
Opaque type.
Definition gdal_utils.h:139
struct GDALGridOptionsForBinary GDALGridOptionsForBinary
Opaque type.
Definition gdal_utils.h:160
struct GDALTileIndexOptionsForBinary GDALTileIndexOptionsForBinary
Opaque type.
Definition gdal_utils.h:331
struct GDALMultiDimInfoOptionsForBinary GDALMultiDimInfoOptionsForBinary
Opaque type.
Definition gdal_utils.h:278
struct GDALTranslateOptionsForBinary GDALTranslateOptionsForBinary
Opaque type.
Definition gdal_utils.h:49
struct GDALContourOptionsForBinary GDALContourOptionsForBinary
Opaque type.
Definition gdal_utils.h:180
struct GDALRasterizeOptionsForBinary GDALRasterizeOptionsForBinary
Opaque type.
Definition gdal_utils.h:214