GDAL

gdalalg_convert.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: gdal "convert" subcommand
5 * Author: Even Rouault <even dot rouault at spatialys.com>
6 *
7 ******************************************************************************
8 * Copyright (c) 2024, Even Rouault <even dot rouault at spatialys.com>
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef GDALALG_CONVERT_INCLUDED
14#define GDALALG_CONVERT_INCLUDED
15
17
18#include "gdalalgorithm.h"
19#include "gdalalg_raster_convert.h"
20#include "gdalalg_vector_convert.h"
21#include "gdalalg_dispatcher.h"
22
23/************************************************************************/
24/* GDALConvertAlgorithm */
25/************************************************************************/
26
27 class GDALConvertAlgorithm final
28 : public GDALDispatcherAlgorithm<GDALRasterConvertAlgorithm,
29 GDALVectorConvertAlgorithm>
30{
31 public:
32 static constexpr const char *NAME = "convert";
33 static constexpr const char *DESCRIPTION =
34 "Convert a dataset (shortcut for 'gdal raster convert' or "
35 "'gdal vector convert').";
36 static constexpr const char *HELP_URL = "/programs/gdal_convert.html";
37
38 static std::vector<std::string> GetAliasesStatic()
39 {
40 return {GDALAlgorithmRegistry::HIDDEN_ALIAS_SEPARATOR, "translate"};
41 }
42
43 GDALConvertAlgorithm();
44
45 ~GDALConvertAlgorithm() override;
46
47 private:
48 std::string m_format{};
49 GDALArgDatasetValue m_inputDataset{};
50 GDALArgDatasetValue m_outputDataset{};
51};
52
54
55#endif
GDALAlgorithmRegistry::HIDDEN_ALIAS_SEPARATOR
static constexpr const char * HIDDEN_ALIAS_SEPARATOR
Special value to put in m_aliases to separate public alias from hidden aliases.
Definition gdalalgorithm_cpp.h:2136
GDALArgDatasetValue
Value for an argument that points to a GDALDataset.
Definition gdalalgorithm_cpp.h:149