GDAL
Public Member Functions | List of all members
GDALSubdatasetInfo Struct Reference

The GDALSubdatasetInfo abstract class provides methods to extract and manipulate subdataset information from a file name that contains subdataset information. More...

#include <gdalsubdatasetinfo.h>

Public Member Functions

 GDALSubdatasetInfo (const std::string &fileName)
 Construct a GDALSubdatasetInfo object from a subdataset file descriptor.
 
std::string GetPathComponent () const
 Returns the unquoted and unescaped path component of the complete file descriptor stripping any subdataset, prefix and additional information.
 
std::string ModifyPathComponent (const std::string &newPathName) const
 Replaces the path component of the complete file descriptor by keeping the subdataset and any other component unaltered.
 
std::string GetSubdatasetComponent () const
 Returns the subdataset component of the file name.
 

Detailed Description

The GDALSubdatasetInfo abstract class provides methods to extract and manipulate subdataset information from a file name that contains subdataset information.

Drivers offering this functionality must override the parseFileName() method.

Constructor & Destructor Documentation

◆ GDALSubdatasetInfo()

GDALSubdatasetInfo::GDALSubdatasetInfo ( const std::string &  fileName)

Construct a GDALSubdatasetInfo object from a subdataset file descriptor.

Parameters
fileNameThe subdataset file name descriptor.

Member Function Documentation

◆ GetPathComponent()

std::string GDALSubdatasetInfo::GetPathComponent ( ) const

Returns the unquoted and unescaped path component of the complete file descriptor stripping any subdataset, prefix and additional information.

Returns
The path to the file
Since
GDAL 3.8

◆ GetSubdatasetComponent()

std::string GDALSubdatasetInfo::GetSubdatasetComponent ( ) const

Returns the subdataset component of the file name.

Returns
The subdataset name
Since
GDAL 3.8

◆ ModifyPathComponent()

std::string GDALSubdatasetInfo::ModifyPathComponent ( const std::string &  newPathName) const

Replaces the path component of the complete file descriptor by keeping the subdataset and any other component unaltered.

The returned string must be freed with CPLFree()

Parameters
newPathNameNew path name with no subdataset information.
Note
This method does not check if the subdataset actually exists.
Returns
The original file name with the old path component replaced by newPathName.
Since
GDAL 3.8

The documentation for this struct was generated from the following files: