OGR
|
#include <ogr_feature.h>
Public Member Functions | |
OGRFieldDefn (const char *, OGRFieldType) | |
Constructor. More... | |
OGRFieldDefn (OGRFieldDefn *) | |
Constructor. More... | |
void | SetName (const char *) |
Reset the name of this field. More... | |
const char * | GetNameRef () |
Fetch name of this field. More... | |
OGRFieldType | GetType () |
Fetch type of this field. More... | |
void | SetType (OGRFieldType eTypeIn) |
Set the type of this field. This should never be done to an OGRFieldDefn that is already part of an OGRFeatureDefn. More... | |
OGRJustification | GetJustify () |
Get the justification for this field. More... | |
void | SetJustify (OGRJustification eJustifyIn) |
Set the justification for this field. More... | |
int | GetWidth () |
Get the formatting width for this field. More... | |
void | SetWidth (int nWidthIn) |
Set the formatting width for this field in characters. More... | |
int | GetPrecision () |
Get the formatting precision for this field. This should normally be zero for fields of types other than OFTReal. More... | |
void | SetPrecision (int nPrecisionIn) |
Set the formatting precision for this field in characters. More... | |
void | Set (const char *, OGRFieldType, int=0, int=0, OGRJustification=OJUndefined) |
Set defining parameters for a field in one call. More... | |
void | SetDefault (const OGRField *) |
Set default field value. More... | |
int | IsIgnored () |
Return whether this field should be omitted when fetching features. More... | |
void | SetIgnored (int bIgnore) |
Set whether this field should be omitted when fetching features. More... | |
int | IsSame (const OGRFieldDefn *) const |
Test if the field definition is identical to the other one. More... | |
Static Public Member Functions | |
static const char * | GetFieldTypeName (OGRFieldType) |
Fetch human readable name for a field type. More... | |
Definition of an attribute of an OGRFeatureDefn.
OGRFieldDefn::OGRFieldDefn | ( | const char * | pszNameIn, |
OGRFieldType | eTypeIn | ||
) |
Constructor.
pszNameIn | the name of the new field. |
eTypeIn | the type of the new field. |
Referenced by OGR_Fld_Create().
OGRFieldDefn::OGRFieldDefn | ( | OGRFieldDefn * | poPrototype | ) |
Constructor.
Create by cloning an existing field definition.
poPrototype | the field definition to clone. |
References GetJustify(), GetNameRef(), GetPrecision(), GetType(), GetWidth(), SetJustify(), SetPrecision(), and SetWidth().
|
static |
Fetch human readable name for a field type.
This static method is the same as the C function OGR_GetFieldTypeName().
eType | the field type to get name for. |
References OFTBinary, OFTDate, OFTDateTime, OFTInteger, OFTIntegerList, OFTReal, OFTRealList, OFTString, OFTStringList, and OFTTime.
Referenced by OGRFeature::DumpReadable(), and OGR_GetFieldTypeName().
|
inline |
Get the justification for this field.
This method is the same as the C function OGR_Fld_GetJustify().
Referenced by OGRFieldDefn().
|
inline |
Fetch name of this field.
This method is the same as the C function OGR_Fld_GetNameRef().
Referenced by OGRDataSource::CopyLayer(), OGRFeature::DumpReadable(), OGRDataSource::ExecuteSQL(), OGRUnionLayer::GetGeomType(), OGRGenSQLResultsLayer::GetLayerDefn(), OGRUnionLayer::GetLayerDefn(), OGR_DS_GetLayerByName(), OGR_L_SetIgnoredFields(), OGRFieldDefn(), OGRFeature::SetField(), OGRFeature::SetFrom(), and OGRGenSQLResultsLayer::TestCapability().
|
inline |
Get the formatting precision for this field. This should normally be zero for fields of types other than OFTReal.
This method is the same as the C function OGR_Fld_GetPrecision().
Referenced by OGRFeature::GetFieldAsString(), OGR_DS_GetLayerByName(), and OGRFieldDefn().
|
inline |
Fetch type of this field.
This method is the same as the C function OGR_Fld_GetType().
Referenced by OGRFeature::DumpReadable(), OGRFeature::Equal(), OGRDataSource::ExecuteSQL(), OGRFeature::GetFieldAsBinary(), OGRFeature::GetFieldAsDateTime(), OGRFeature::GetFieldAsDouble(), OGRFeature::GetFieldAsDoubleList(), OGRFeature::GetFieldAsInteger(), OGRFeature::GetFieldAsIntegerList(), OGRFeature::GetFieldAsString(), OGRFeature::GetFieldAsStringList(), OGRGenSQLResultsLayer::GetLayerDefn(), OGR_DS_GetLayerByName(), OGR_F_Create(), OGRFieldDefn(), OGRFeature::SetField(), OGRFeature::SetFieldsFrom(), OGRGenSQLResultsLayer::TestCapability(), and OGRFeature::UnsetField().
|
inline |
Get the formatting width for this field.
This method is the same as the C function OGR_Fld_GetWidth().
Referenced by OGRFeature::GetFieldAsString(), OGR_DS_GetLayerByName(), and OGRFieldDefn().
|
inline |
Return whether this field should be omitted when fetching features.
This method is the same as the C function OGR_Fld_IsIgnored().
int OGRFieldDefn::IsSame | ( | const OGRFieldDefn * | poOtherFieldDefn | ) | const |
Test if the field definition is identical to the other one.
poOtherFieldDefn | the other field definition to compare to. |
Referenced by OGRFeatureDefn::IsSame().
void OGRFieldDefn::Set | ( | const char * | pszNameIn, |
OGRFieldType | eTypeIn, | ||
int | nWidthIn = 0 , |
||
int | nPrecisionIn = 0 , |
||
OGRJustification | eJustifyIn = OJUndefined |
||
) |
Set defining parameters for a field in one call.
This method is the same as the C function OGR_Fld_Set().
pszNameIn | the new name to assign. |
eTypeIn | the new type (one of the OFT values like OFTInteger). |
nWidthIn | the preferred formatting width. Defaults to zero indicating undefined. |
nPrecisionIn | number of decimals places for formatting, defaults to zero indicating undefined. |
eJustifyIn | the formatting justification (OJLeft or OJRight), defaults to OJUndefined. |
References SetJustify(), SetName(), SetPrecision(), SetType(), and SetWidth().
void OGRFieldDefn::SetDefault | ( | const OGRField * | puDefaultIn | ) |
Set default field value.
Currently use of OGRFieldDefn "defaults" is discouraged. This feature may be fleshed out in the future.
References OFTInteger, OFTReal, and OFTString.
|
inline |
Set whether this field should be omitted when fetching features.
This method is the same as the C function OGR_Fld_SetIgnored().
ignore | ignore state |
Referenced by OGRLayer::SetIgnoredFields().
|
inline |
Set the justification for this field.
This method is the same as the C function OGR_Fld_SetJustify().
eJustify | the new justification. |
Referenced by OGRFieldDefn(), and Set().
void OGRFieldDefn::SetName | ( | const char * | pszNameIn | ) |
Reset the name of this field.
This method is the same as the C function OGR_Fld_SetName().
pszNameIn | the new name to apply. |
References CPLStrdup().
Referenced by OGR_DS_GetLayerByName(), OGR_L_SetIgnoredFields(), and Set().
|
inline |
Set the formatting precision for this field in characters.
This should normally be zero for fields of types other than OFTReal.
This method is the same as the C function OGR_Fld_SetPrecision().
nPrecision | the new precision. |
Referenced by OGR_DS_GetLayerByName(), OGRFieldDefn(), and Set().
|
inline |
Set the type of this field. This should never be done to an OGRFieldDefn that is already part of an OGRFeatureDefn.
This method is the same as the C function OGR_Fld_SetType().
eType | the new field type. |
Referenced by OGR_DS_GetLayerByName(), OGRGeocodeDestroySession(), and Set().
|
inline |
Set the formatting width for this field in characters.
This method is the same as the C function OGR_Fld_SetWidth().
nWidth | the new width. |
Referenced by OGR_DS_GetLayerByName(), OGRFieldDefn(), and Set().