GDAL

Public Member Functions | Public Attributes | List of all members
GDALOpenInfo Class Reference

Class for dataset open functions. More...

`#include <gdal_openinfo.h>`

## Public Member Functions
| GDALOpenInfo (const char *pszFile, int nOpenFlagsIn, const char *const *papszSiblingFiles=nullptr)
| Constructor/.
int | TryToIngest (int nBytes)
| Ingest bytes from the file.
char ** | GetSiblingFiles ()
| Return sibling files.
char ** | StealSiblingFiles ()
| Return sibling files and steal reference.
bool | AreSiblingFilesLoaded () const
| Return whether sibling files have been loaded.
bool | IsSingleAllowedDriver (const char *pszDriverName) const
| Returns true if the driver name is the single in the list of allowed drivers.
bool | IsExtensionEqualToCI (const char *pszExt) const
| Return whether the extension of the file is equal to pszExt, using case-insensitive comparison.

## Public Attributes
char * | pszFilename = nullptr
| Filename.
std::string | osExtension {}
| Result of CPLGetExtension(pszFilename);.
char ** | papszOpenOptions = nullptr
| Open options.
GDALAccess | eAccess = GA_ReadOnly
| Access flag.
int | nOpenFlags = 0
| Open flags.
bool | bStatOK = false
| Whether stat()'ing the file was successful.
bool | bIsDirectory = false
| Whether the file is a directory.
VSILFILE * | fpL = nullptr
| Pointer to the file.
int | nHeaderBytes = 0
| Number of bytes in pabyHeader.
GByte * | pabyHeader = nullptr
| Buffer with first bytes of the file.
const char *const * | papszAllowedDrivers = nullptr
| Allowed drivers (NULL for all)

## Detailed Description

Class for dataset open functions.

## Constructor & Destructor Documentation

## ◆ GDALOpenInfo()

GDALOpenInfo::GDALOpenInfo | ( | const char * | pszFilenameIn,
|  | int | nOpenFlagsIn,
|  | const char *const * | papszSiblingsIn = `nullptr`
| ) |  |

Constructor/.

Parameters

  pszFilenameIn | filename
  nOpenFlagsIn | open flags
  papszSiblingsIn | list of sibling files, or NULL.

## Member Function Documentation

## ◆ AreSiblingFilesLoaded()

bool GDALOpenInfo::AreSiblingFilesLoaded | ( |  | ) | const

Return whether sibling files have been loaded.

Returns
  true or false.

## ◆ GetSiblingFiles()

char ** GDALOpenInfo::GetSiblingFiles | ( |  | ) |

Return sibling files.

If the list of sibling files has not already been established, it will be, unless the GDAL_DISABLE_READDIR_ON_OPEN configuration option has been set to YES or EMPTY_DIR when this instance was constructed.

Returns
  sibling files. Ownership belongs to "this".

## ◆ IsExtensionEqualToCI()

bool GDALOpenInfo::IsExtensionEqualToCI | ( | const char * | pszExt | ) | const
| inline

Return whether the extension of the file is equal to pszExt, using case-insensitive comparison.

Since
  3.11

## ◆ IsSingleAllowedDriver()

bool GDALOpenInfo::IsSingleAllowedDriver | ( | const char * | pszDriverName | ) | const

Returns true if the driver name is the single in the list of allowed drivers.

Parameters

  pszDriverName | Driver name to test.

Returns
  true if the driver name is the single in the list of allowed drivers.

Since
  GDAL 3.10

## ◆ StealSiblingFiles()

char ** GDALOpenInfo::StealSiblingFiles | ( |  | ) |

Return sibling files and steal reference.

Returns
  sibling files. Ownership below to the caller (must be freed with CSLDestroy)

## ◆ TryToIngest()

int GDALOpenInfo::TryToIngest | ( | int | nBytes | ) |

Ingest bytes from the file.

Parameters

  nBytes | number of bytes to ingest.

Returns
  TRUE if successful

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

- gdal_openinfo.h
- gdalopeninfo.cpp