GDAL

gdalsubdatasetinfo.h
1/***************************************************************************
2 gdal_subdatasetinfo.h - GDALSubdatasetInfo
3
4 ---------------------
5 begin : 21.7.2023
6 copyright : (C) 2023 by Alessndro Pasotti
7 email : elpaso@itopen.it
8 ***************************************************************************
9 * *
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
16 *
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
27 * *
28 ***************************************************************************/
29#ifndef GDALSUBDATASETINFO_H
30#define GDALSUBDATASETINFO_H
31
32#include "cpl_port.h"
33#include <string>
34
42 struct CPL_DLL GDALSubdatasetInfo
43{
44
45 public:
50 GDALSubdatasetInfo(const std::string &fileName);
51
52 virtual ~GDALSubdatasetInfo() = default;
53
60 std::string GetPathComponent() const;
61
71 std::string ModifyPathComponent(const std::string &newPathName) const;
72
79 std::string GetSubdatasetComponent() const;
80
82 protected:
87 virtual void parseFileName() = 0;
88
92 static std::string quote(const std::string &path);
93
97 static std::string unquote(const std::string &path);
98
100 std::string m_fileName;
102 std::string m_pathComponent;
104 std::string m_cleanedPathComponent;
106 std::string m_subdatasetComponent;
108 std::string m_driverPrefixComponent;
110 bool m_isQuoted = false;
111
112 private:
113 mutable bool m_initialized = false;
114
115 void init() const;
116
118};
119
120#endif // GDALSUBDATASETINFO_H
cpl_port.h
Core portability definitions for CPL.
GDALSubdatasetInfo
The GDALSubdatasetInfo abstract class provides methods to extract and manipulate subdataset informati...
Definition gdalsubdatasetinfo.h:43