GDAL

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
GDALMajorObject Class Reference

Object with metadata. More...

`#include <gdal_majorobject.h>`

Inheritance diagram for GDALMajorObject:

## Public Member Functions
int | GetMOFlags () const
| Returns the GMO_ flags.
void | SetMOFlags (int nFlagsIn)
| Assign GMO_flags.
virtual const char * | GetDescription () const
| Fetch object description.
virtual void | SetDescription (const char *)
| Set object description.
virtual char ** | GetMetadataDomainList ()
| Fetch list of metadata domains.
virtual char ** | GetMetadata (const char *pszDomain="")
| Fetch metadata.
virtual CPLErr | SetMetadata (char **papszMetadata, const char *pszDomain="")
| Set metadata.
virtual const char * | GetMetadataItem (const char *pszName, const char *pszDomain="")
| Fetch single metadata item.
virtual CPLErr | SetMetadataItem (const char *pszName, const char *pszValue, const char *pszDomain="")
| Set single metadata item.

## Static Public Member Functions
static GDALMajorObjectH | ToHandle (GDALMajorObject *poMajorObject)
| Convert a GDALMajorObject* to a GDALMajorObjectH.
static GDALMajorObject * | FromHandle (GDALMajorObjectH hMajorObject)
| Convert a GDALMajorObjectH to a GDALMajorObject*.

## Protected Member Functions
char ** | BuildMetadataDomainList (char **papszList, int bCheckNonEmpty,...) CPL_NULL_TERMINATED
| Helper function for custom implementations of GetMetadataDomainList()
| GDALMajorObject (const GDALMajorObject &)=default
| Copy constructor.
GDALMajorObject & | operator= (const GDALMajorObject &)=default
| Copy assignment operator.
| GDALMajorObject (GDALMajorObject &&)=default
| Move constructor.
GDALMajorObject & | operator= (GDALMajorObject &&)=default
| Move assignment operator.

## Detailed Description

Object with metadata.

## Member Function Documentation

## ◆ BuildMetadataDomainList()

char ** GDALMajorObject::BuildMetadataDomainList | ( | char ** | papszList,
|  | int | bCheckNonEmpty,
|  |  | ...
| ) |  |
| protected

Helper function for custom implementations of GetMetadataDomainList()

Parameters

  papszList | initial list of domains. May be NULL. Will become invalid after function call (use return value)
  bCheckNonEmpty | if TRUE, each candidate domain will be tested to be non empty
  ... | NULL terminated variadic list of candidate domains.

Returns
  NULL or a string list. Must be freed with CSLDestroy()

## ◆ GetDescription()

const char * GDALMajorObject::GetDescription | ( |  | ) | const
| virtual

Fetch object description.

The semantics of the returned description are specific to the derived type. For GDALDatasets it is the dataset name. For GDALRasterBands it is actually a description (if supported) or "".

This method is the same as the C function GDALGetDescription().

Returns
  non-null pointer to internal description string.

## ◆ GetMetadata()

char ** GDALMajorObject::GetMetadata | ( | const char * | pszDomain = `""` | ) |
| virtual

Fetch metadata.

The returned string list is owned by the object, and may change at any time. It is formatted as a "Name=value" list with the last pointer value being NULL. Use the CPL StringList functions such as CSLFetchNameValue() to manipulate it.

Note that relatively few formats return any metadata at this time.

This method does the same thing as the C function GDALGetMetadata().

Parameters

  pszDomain | the domain of interest. Use "" or NULL for the default domain.

Returns
  NULL or a string list.

Reimplemented in GDALPluginDriverProxy, GDALDataset, and GDALPamDataset.

## ◆ GetMetadataDomainList()

char ** GDALMajorObject::GetMetadataDomainList | ( |  | ) |
| virtual

Fetch list of metadata domains.

The returned string list is the list of (non-empty) metadata domains.

This method does the same thing as the C function GDALGetMetadataDomainList().

Returns
  NULL or a string list. Must be freed with CSLDestroy()

Reimplemented in GDALDataset.

## ◆ GetMetadataItem()

const char * GDALMajorObject::GetMetadataItem | ( | const char * | pszName,
|  | const char * | pszDomain = `""`
| ) |  |
| virtual

Fetch single metadata item.

The C function GDALGetMetadataItem() does the same thing as this method.

Parameters

  pszName | the key for the metadata item to fetch.
  pszDomain | the domain to fetch for, use NULL for the default domain.

Returns
  NULL on failure to find the key, or a pointer to an internal copy of the value string on success.

Reimplemented in GDALDriver, GDALPamDataset, GDALRasterBand, and GDALPluginDriverProxy.

## ◆ GetMOFlags()

int GDALMajorObject::GetMOFlags | ( |  | ) | const

Returns the GMO_ flags.

Returns
  flags

## ◆ SetDescription()

void GDALMajorObject::SetDescription | ( | const char * | pszNewDesc | ) |
| virtual

Set object description.

The semantics of the description are specific to the derived type. For GDALDatasets it is the dataset name. For GDALRasterBands it is actually a description (if supported) or "".

Normally application code should not set the "description" for GDALDatasets. It is handled internally.

This method is the same as the C function GDALSetDescription().

Reimplemented in GDALPamRasterBand.

## ◆ SetMetadata()

CPLErr GDALMajorObject::SetMetadata | ( | char ** | papszMetadataIn,
|  | const char * | pszDomain = `""`
| ) |  |
| virtual

Set metadata.

The C function GDALSetMetadata() does the same thing as this method.

Parameters

  papszMetadataIn | the metadata in name=value string list format to apply.
  pszDomain | the domain of interest. Use "" or NULL for the default domain.

Returns
  CE_None on success, CE_Failure on failure and CE_Warning if the metadata has been accepted, but is likely not maintained persistently by the underlying object between sessions.

Reimplemented in GDALDataset, GDALRasterBand, GDALPamDataset, and GDALPamRasterBand.

## ◆ SetMetadataItem()

CPLErr GDALMajorObject::SetMetadataItem | ( | const char * | pszName,
|  | const char * | pszValue,
|  | const char * | pszDomain = `""`
| ) |  |
| virtual

Set single metadata item.

The C function GDALSetMetadataItem() does the same thing as this method.

Parameters

  pszName | the key for the metadata item to fetch.
  pszValue | the value to assign to the key.
  pszDomain | the domain to set within, use NULL for the default domain.

Returns
  CE_None on success, or an error code on failure.

Reimplemented in GDALDataset, GDALRasterBand, GDALDriver, GDALPamDataset, GDALPamRasterBand, and GDALPluginDriverProxy.

## ◆ SetMOFlags()

void GDALMajorObject::SetMOFlags | ( | int | nNewFlags | ) |

Assign GMO_flags.

Parameters

  nNewFlags | new flags.

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

- gdal_majorobject.h
- gdalmajorobject.cpp