File Geodatabase API
FileGDBAPI::Row Class Reference

Provides methods to get and set data on table rows. More...

List of all members.

Public Member Functions

Getters and setters
fgdbError IsNull (const std::wstring &field, bool &isNull)
 Indicates whether the specified field contains a null value.
fgdbError SetNull (const std::wstring &field)
 Assigns a null value to the specified field.
fgdbError GetOID (int32 &objectID)
 Gets the row's Object ID.
fgdbError GetGlobalID (Guid &globalID)
 Gets the row's Global ID.
fgdbError GetGeometry (ShapeBuffer &shapeBuffer)
 Gets the row's geometry.
fgdbError SetGeometry (const ShapeBuffer &shapeBuffer)
 Sets the row's geometry.
fgdbError GetShort (const std::wstring &field, short &value)
 Gets a short value from the specified field.
fgdbError SetShort (const std::wstring &field, short value)
 Assigns a short value to the specified field.
fgdbError GetInteger (const std::wstring &field, int32 &value)
 Gets an integer value from the specified field.
fgdbError SetInteger (const std::wstring &field, int32 value)
 Assigns an integer value to the specified field.
fgdbError GetFloat (const std::wstring &field, float &value)
 Gets a float value from the specified field.
fgdbError SetFloat (const std::wstring &field, float value)
 Assigns a float value to the specified field.
fgdbError GetDouble (const std::wstring &field, double &value)
 Gets a double value from the specified field.
fgdbError SetDouble (const std::wstring &field, double value)
 Assigns a double value to the specified field.
fgdbError GetDate (const std::wstring &field, struct tm &value)
 Gets a date/time value from the specified field.
fgdbError SetDate (const std::wstring &field, const struct tm &value)
 Assigns a date/time value to the specified field.
fgdbError GetString (const std::wstring &field, std::wstring &value)
 Gets a string value from the specified field.
fgdbError SetString (const std::wstring &field, const std::wstring &value)
 Assigns a string value to the specified field.
fgdbError GetGUID (const std::wstring &field, Guid &value)
 Gets a GUID value from the specified field.
fgdbError SetGUID (const std::wstring &field, const Guid &value)
 Assigns a GUID value to the specified field.
fgdbError GetXML (const std::wstring &field, std::string &value)
 Gets an XML value from the specified field.
fgdbError SetXML (const std::wstring &field, const std::string &value)
 Assigns an XML value to the specified field.
fgdbError GetBinary (const std::wstring &field, ByteArray &binaryBuf)
 Gets a byte array from the specified field.
fgdbError SetBinary (const std::wstring &field, const ByteArray &binaryBuf)
 Assigns a byte array to the specified field.
Field properties
fgdbError GetFieldInformation (FieldInfo &fieldInfo)
 Return information about the fields in the row.
Constructors and Destructors
 Row ()
 The class constructor.
 ~Row ()
 The class destructor.

Detailed Description

Provides methods to get and set data on table rows.


Member Function Documentation

fgdbError FileGDBAPI::Row::IsNull ( const std::wstring &  field,
bool &  isNull 
)

Indicates whether the specified field contains a null value.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).

Parameters:
[in]fieldThe field to check for a null value.
[out]isNullIndicates whether the specified field contains a null value.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::SetNull ( const std::wstring &  field)

Assigns a null value to the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field is not nullable, this will fail with an error code of -2147219879 (The field is not nullable).

Parameters:
[in]fieldThe field to set as null.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetOID ( int32 &  objectID)

Gets the row's Object ID.

If the row's table does not have an Object ID column, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).

Parameters:
[out]objectIDThe row's Object ID.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetGlobalID ( Guid &  globalID)

Gets the row's Global ID.

If the row's table does not have an Global ID column, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).

Parameters:
[out]globalIDThe row's Global ID.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetGeometry ( ShapeBuffer shapeBuffer)

Gets the row's geometry.

The buffer is a shape record as defined in the ESRI Shapefile Technical Description, which is included in the documentation. The Editing and Querying samples write and read a point shape buffer. Other shape types can be read based on the shapefile specification. If the row's table does not have a geometry column, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).

Parameters:
[out]shapeBufferThe row's geometry.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::SetGeometry ( const ShapeBuffer shapeBuffer)

Sets the row's geometry.

The buffer is a shape record as defined in the ESRI Shapefile Technical Description, which is included in the documentation. The Editing and Querying samples write and read a point shape buffer. If the row's table does not have a geometry column, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the geometry has an invalid geometry type, this will fail with an error code of E_FAIL.

Parameters:
[in]shapeBufferThe geometry to assign to the row.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetShort ( const std::wstring &  field,
short &  value 
)

Gets a short value from the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field is has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type). If the field contains a null value, this will fail with an error code of E_FAIL.

Parameters:
[in]fieldThe name of the field to get the value from.
[out]valueThe field's value.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::SetShort ( const std::wstring &  field,
short  value 
)

Assigns a short value to the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).

Parameters:
[in]fieldThe name of the field to assign the value to.
[out]valueThe value to assign to the field.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetInteger ( const std::wstring &  field,
int32 &  value 
)

Gets an integer value from the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type). If the field contains a null value, this will fail with an error code of E_FAIL.

Parameters:
[in]fieldThe name of the field to get the value from.
[out]valueThe field's value.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::SetInteger ( const std::wstring &  field,
int32  value 
)

Assigns an integer value to the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).

Parameters:
[in]fieldThe name of the field to assign the value to.
[in]valueThe value to assign to the field.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetFloat ( const std::wstring &  field,
float &  value 
)

Gets a float value from the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type). If the field contains a null value, this will fail with an error code of E_FAIL.

Parameters:
[in]fieldThe name of the field to get the value from.
[out]valueThe field's value.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::SetFloat ( const std::wstring &  field,
float  value 
)

Assigns a float value to the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).

Parameters:
[in]fieldThe name of the field to assign the value to.
[in]valueThe value to assign to the field.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetDouble ( const std::wstring &  field,
double &  value 
)

Gets a double value from the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type). If the field contains a null value, this will fail with an error code of E_FAIL.

Parameters:
[in]fieldThe name of the field to get the value from.
[out]valueThe field's value.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::SetDouble ( const std::wstring &  field,
double  value 
)

Assigns a double value to the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).

Parameters:
[in]fieldThe name of the field to assign the value to.
[in]valueThe value to assign to the field.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetDate ( const std::wstring &  field,
struct tm &  value 
)

Gets a date/time value from the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type). If the field contains a null value, this will fail with an error code of E_FAIL.

Parameters:
[in]fieldThe name of the field to get the value from.
[out]valueThe field's value.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::SetDate ( const std::wstring &  field,
const struct tm &  value 
)

Assigns a date/time value to the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).

Parameters:
[in]fieldThe name of the field to get the value from.
[in]valueThe value to assign to the field.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetString ( const std::wstring &  field,
std::wstring &  value 
)

Gets a string value from the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type). If the field contains a null value, this will fail with an error code of E_FAIL.

Parameters:
[in]fieldThe name of the field to get the value from.
[out]valueThe field's value.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::SetString ( const std::wstring &  field,
const std::wstring &  value 
)

Assigns a string value to the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).

Parameters:
[in]fieldThe name of the field to assign the value to.
[in]valueThe value to assign to the field.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetGUID ( const std::wstring &  field,
Guid &  value 
)

Gets a GUID value from the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type). If the field contains a null value, this will fail with an error code of E_FAIL.

Parameters:
[in]fieldThe name of the field to get the value from.
[out]valueThe field's value.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::SetGUID ( const std::wstring &  field,
const Guid &  value 
)

Assigns a GUID value to the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).

Parameters:
[in]fieldThe name of the field to assign the value to.
[in]valueThe value to assign to the field.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetXML ( const std::wstring &  field,
std::string &  value 
)

Gets an XML value from the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type). If the field contains a null value, this will fail with an error code of E_FAIL.

Parameters:
[in]fieldThe name of the field to get the value from.
[out]valueThe field's value.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::SetXML ( const std::wstring &  field,
const std::string &  value 
)

Assigns an XML value to the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).

Parameters:
[in]fieldThe name of the field to assign the value to.
[in]valueThe value to assign to the field.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetBinary ( const std::wstring &  field,
ByteArray binaryBuf 
)

Gets a byte array from the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type). If the field contains a null value, this will fail with an error code of E_FAIL.

Parameters:
[in]fieldThe name of the field to get the value from.
[out]binaryBufThe field's value.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::SetBinary ( const std::wstring &  field,
const ByteArray binaryBuf 
)

Assigns a byte array to the specified field.

If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly). If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).

Parameters:
[in]fieldThe name of the field to assign the value to.
[in]binaryBufThe value to assign to the field.
Returns:
Error code indicating whether the method finished successfully.
fgdbError FileGDBAPI::Row::GetFieldInformation ( FieldInfo fieldInfo)

Return information about the fields in the row.

Parameters:
[out]fieldInfoThe field information.
Returns:
Error code indicating whether the method finished successfully.