Coverage Report

Created: 2026-02-14 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/apps/gdalalg_dataset_copy.h
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  GDAL
4
 * Purpose:  gdal "dataset copy" subcommand
5
 * Author:   Even Rouault <even dot rouault at spatialys.com>
6
 *
7
 ******************************************************************************
8
 * Copyright (c) 2025, Even Rouault <even dot rouault at spatialys.com>
9
 *
10
 * SPDX-License-Identifier: MIT
11
 ****************************************************************************/
12
13
#ifndef GDALALG_DATASET_COPY_INCLUDED
14
#define GDALALG_DATASET_COPY_INCLUDED
15
16
#include "gdalalgorithm.h"
17
18
//! @cond Doxygen_Suppress
19
20
/************************************************************************/
21
/*                 GDALDatasetCopyRenameCommonAlgorithm                 */
22
/************************************************************************/
23
24
class GDALDatasetCopyRenameCommonAlgorithm /* non-final */
25
    : public GDALAlgorithm
26
{
27
  protected:
28
    GDALDatasetCopyRenameCommonAlgorithm(const std::string &name,
29
                                         const std::string &description,
30
                                         const std::string &helpURL);
31
32
  private:
33
    std::string m_source{};
34
    std::string m_destination{};
35
    std::string m_format{};
36
    bool m_overwrite = false;
37
38
    bool RunImpl(GDALProgressFunc, void *) override;
39
};
40
41
/************************************************************************/
42
/*                       GDALDatasetCopyAlgorithm                       */
43
/************************************************************************/
44
45
class GDALDatasetCopyAlgorithm final
46
    : public GDALDatasetCopyRenameCommonAlgorithm
47
{
48
  public:
49
    static constexpr const char *NAME = "copy";
50
    static constexpr const char *DESCRIPTION = "Copy files of a dataset.";
51
    static constexpr const char *HELP_URL = "/programs/gdal_dataset_copy.html";
52
53
    static std::vector<std::string> GetAliasesStatic()
54
0
    {
55
0
        return {"cp"};
56
0
    }
57
58
    GDALDatasetCopyAlgorithm();
59
    ~GDALDatasetCopyAlgorithm() override;
60
};
61
62
//! @endcond
63
64
#endif