GDAL
|
Class used to represent potentially complex data types. More...
#include <gdal_priv.h>
Public Member Functions | |
GDALExtendedDataType (const GDALExtendedDataType &) | |
Copy constructor. | |
GDALExtendedDataType & | operator= (const GDALExtendedDataType &) |
Copy assignment. | |
GDALExtendedDataType & | operator= (GDALExtendedDataType &&) |
Move assignment. | |
bool | operator== (const GDALExtendedDataType &) const |
Equality operator. More... | |
bool | operator!= (const GDALExtendedDataType &other) const |
Non-equality operator. | |
const std::string & | GetName () const |
Return type name. More... | |
GDALExtendedDataTypeClass | GetClass () const |
Return type class. More... | |
GDALDataType | GetNumericDataType () const |
Return numeric data type (only valid when GetClass() == GEDTC_NUMERIC) More... | |
GDALExtendedDataTypeSubType | GetSubType () const |
Return subtype. More... | |
const std::vector< std::unique_ptr< GDALEDTComponent > > & | GetComponents () const |
Return the components of the data type (only valid when GetClass() == GEDTC_COMPOUND) More... | |
size_t | GetSize () const |
Return data type size in bytes. More... | |
size_t | GetMaxStringLength () const |
Return the maximum length of a string in bytes. More... | |
bool | CanConvertTo (const GDALExtendedDataType &other) const |
Return whether this data type can be converted to the other one. More... | |
bool | NeedsFreeDynamicMemory () const |
Return whether the data type holds dynamically allocated memory, that needs to be freed with FreeDynamicMemory(). | |
void | FreeDynamicMemory (void *pBuffer) const |
Release the dynamic memory (strings typically) from a raw value. More... | |
Static Public Member Functions | |
static GDALExtendedDataType | Create (GDALDataType eType) |
Return a new GDALExtendedDataType of class GEDTC_NUMERIC. More... | |
static GDALExtendedDataType | Create (const std::string &osName, size_t nTotalSize, std::vector< std::unique_ptr< GDALEDTComponent >> &&components) |
Return a new GDALExtendedDataType of class GEDTC_COMPOUND. More... | |
static GDALExtendedDataType | CreateString (size_t nMaxStringLength=0, GDALExtendedDataTypeSubType eSubType=GEDTST_NONE) |
Return a new GDALExtendedDataType of class GEDTC_STRING. More... | |
static bool | CopyValue (const void *pSrc, const GDALExtendedDataType &srcType, void *pDst, const GDALExtendedDataType &dstType) |
Convert a value from a source type to a destination type. More... | |
static bool | CopyValues (const void *pSrc, const GDALExtendedDataType &srcType, GPtrDiff_t nSrcStrideInElts, void *pDst, const GDALExtendedDataType &dstType, GPtrDiff_t nDstStrideInElts, size_t nValues) |
Convert severals value from a source type to a destination type. More... | |
Class used to represent potentially complex data types.
Several classes of data types are supported: numeric (based on GDALDataType), compound or string.
bool GDALExtendedDataType::CanConvertTo | ( | const GDALExtendedDataType & | other | ) | const |
Return whether this data type can be converted to the other one.
This is the same as the C function GDALExtendedDataTypeCanConvertTo().
other | Target data type for the conversion being considered. |
|
static |
Convert a value from a source type to a destination type.
If dstType is GEDTC_STRING, the written value will be a pointer to a char*, that must be freed with CPLFree().
|
static |
Convert severals value from a source type to a destination type.
If dstType is GEDTC_STRING, the written value will be a pointer to a char*, that must be freed with CPLFree().
|
static |
Return a new GDALExtendedDataType of class GEDTC_COMPOUND.
This is the same as the C function GDALExtendedDataTypeCreateCompound()
osName | Type name. |
nTotalSize | Total size of the type in bytes. Should be large enough to store all components. |
components | Components of the compound type. |
|
static |
Return a new GDALExtendedDataType of class GEDTC_NUMERIC.
This is the same as the C function GDALExtendedDataTypeCreate()
eType | Numeric data type. |
|
static |
Return a new GDALExtendedDataType of class GEDTC_STRING.
This is the same as the C function GDALExtendedDataTypeCreateString().
nMaxStringLength | maximum length of a string in bytes. 0 if unknown/unlimited |
eSubType | Subtype. |
void GDALExtendedDataType::FreeDynamicMemory | ( | void * | pBuffer | ) | const |
Release the dynamic memory (strings typically) from a raw value.
This is the same as the C function GDALExtendedDataTypeFreeDynamicMemory().
pBuffer | Raw buffer of a single element of an attribute or array value. |
|
inline |
Return type class.
This is the same as the C function GDALExtendedDataTypeGetClass()
|
inline |
Return the components of the data type (only valid when GetClass() == GEDTC_COMPOUND)
This is the same as the C function GDALExtendedDataTypeGetComponents()
|
inline |
Return the maximum length of a string in bytes.
0 indicates unknown/unlimited string.
|
inline |
Return type name.
This is the same as the C function GDALExtendedDataTypeGetName()
|
inline |
Return numeric data type (only valid when GetClass() == GEDTC_NUMERIC)
This is the same as the C function GDALExtendedDataTypeGetNumericDataType()
|
inline |
Return data type size in bytes.
For a string, this will be size of a char* pointer.
This is the same as the C function GDALExtendedDataTypeGetSize()
|
inline |
bool GDALExtendedDataType::operator== | ( | const GDALExtendedDataType & | other | ) | const |
Equality operator.
This is the same as the C function GDALExtendedDataTypeEquals().