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>
41 struct CPL_DLL GDALSubdatasetInfo
42 {
43 
44  public:
49  GDALSubdatasetInfo(const std::string &fileName);
50 
51  virtual ~GDALSubdatasetInfo() = default;
52 
59  std::string GetPathComponent() const;
60 
70  std::string ModifyPathComponent(const std::string &newPathName) const;
71 
78  std::string GetSubdatasetComponent() const;
79 
81  protected:
86  virtual void parseFileName() = 0;
87 
91  static std::string quote(const std::string &path);
92 
96  static std::string unquote(const std::string &path);
97 
99  std::string m_fileName;
101  std::string m_pathComponent;
103  std::string m_cleanedPathComponent;
105  std::string m_subdatasetComponent;
107  std::string m_driverPrefixComponent;
109  bool m_isQuoted = false;
110 
111  private:
112  mutable bool m_initialized = false;
113 
114  void init() const;
115 
117 };
118 
119 #endif // GDALSUBDATASETINFO_H
cpl_port.h
GDALSubdatasetInfo
The GDALSubdatasetInfo abstract class provides methods to extract and manipulate subdataset informati...
Definition: gdalsubdatasetinfo.h:41