Skip to main content

FieldBase

Important

This C++ SDK uses outdated technology that limits your extension opportunities. We've built a new Platform SDK using Python and the latest open-source technology to deliver a vastly improved development experience. Go to Platform SDK to get started!

The FieldBase class represents a field within a record and is obtained through the RecordInfo class.

Properties

m_bIsVarLength: Evaluates If the field is of variable length. Returns True if the field's length is variable.

m_ft: The field type. Valid values include:

  • E_FT_Unknown

  • E_FT_Bool

  • E_FT_Byte

  • E_FT_Int16

  • E_FT_Int32

  • E_FT_Int64

  • E_FT_FixedDecimal

  • E_FT_Float

  • E_FT_Double

  • E_FT_String

  • E_FT_WString

  • E_FT_V_String

  • E_FT_V_WString

  • E_FT_Date

  • E_FT_Time

  • E_FT_DateTime

  • E_FT_Blob

  • E_FT_SpatialObj

m_nScale: The degrees of precision after a decimal point for numeric values.

m_nSize: The field's size in bytes.

Operators

==: Evaluate if two instances of FieldBase are the same. Returns True if instances are identical.

!=: Evaluate if two instances of FieldBase are not the same. Returns True if instances are not identical.

[]: Return the FieldBase object that represents the field at the specified index. Use the syntax below, where n is the index.

const FieldBase * operator [](size_t n)

Methods

Copy

Create an exact copy of a FieldBase instance. Returns a smart pointer to the duplicate object.

SmartPointerRefObj<FieldBase> Copy()

EqualType

Evaluate if two FieldBase instances are identical except for names. Returns True if the objects are the same except for names.

bool EqualType(const FieldBase &o)

o: A reference to the object being compared against.

GetAsAString

Obtain the value of the field as an 8-bit string. Returns the string value wrapped in a TFieldVal structure to handle Null values.

TFieldVal<AString> GetAsAString(const RecordData * pRecord)

pRecord: A pointer to the RecordData structure that contains the data.

GetAsBlob

Obtain the value of the field as a binary blob. Returns the blob value wrapped in a TFieldVal structure to handle Null values.

TFieldVal<BlobVal> GetAsBlob(const RecordData * pRecord)

pRecord: A pointer to the RecordData structure that contains the data.

GetAsBool

Obtain the value of the field as a boolean. Returns the boolean value wrapped in a TFieldVal structure to handle Null values.

TFieldVal<bool> GetAsBool(const RecordData * pRecord)

pRecord: A pointer to the RecordData structure that contains the data.

GetAsDouble

Obtain the value of the field as a double. Returns the double value wrapped in a TFieldVal structure to handle Null values.

TFieldVal<double> GetAsDouble(const RecordData * pRecord)

pRecord: A pointer to the RecordData structure that contains the data.

GetAsInt32

Obtain the value of the field as a 32-bit integer. Returns the integer value wrapped in a TFieldVal structure to handle Null values.

TFieldVal<int> GetAsInt32(const RecordData * pRecord)

pRecord: A pointer to the RecordData structure that contains the data.

GetAsInt64

Obtain the value of the field as a 64-bit integer. Returns the integer value wrapped in a TFieldVal structure to handle Null values.

TFieldVal<__int64> GetAsInt64(const RecordData * pRecord)

pRecord: A pointer to the RecordData structure that contains the data.

GetAsSpatialBlob

Obtain the value of the field as a spatial blob. Returns the spatial blob value wrapped in a TFieldVal structure to handle Null values.

TFieldVal<BlobVal> GetAsSpatialBlob(const RecordData * pRecord)

pRecord: A pointer to the RecordData structure that contains the data.

GetAsWString

Obtain the value of the field as a 16-bit string value. Returns the string value wrapped in a TFieldVal structure to handle Null values.

TFieldVal<WString> GetAsWString(const RecordData * pRecord)

pRecord: A pointer to the RecordData structure that contains the data.

GetDescription

Obtain the description associated with a field. Returns the description.

WString GetDescription()

GetFieldName

Obtain the name of the field. Returns the name.

WStringNoCase GetFieldName()

GetGenericEngine

Obtain the generic Alteryxengine assigned to this object. Returns a pointer to the generic Alteryxengine.

GenericEngineBase * GetGenericEngine()

The most commonly used generic engine is GenericEngine_Alteryx, which provides a base-line set of functionality.

GetNull

Evaluate if the field contains a Null value. Returns True if the field contains a Null.

bool GetNull(const RecordData * pRecord)

pRecord: A pointer to the RecordData structure that contains the data.

GetSource

Obtain the name of the source of the field, such as the file name or the tool that created the field. Returns the name.

WString GetSource()

IsReportingFieldConversionErrors

Evaluate if the Generic Engine associated with the object can report field conversion errors. Returns True if the object can report field conversion errors.

bool IsReportingFieldConversionErrors()

ReportFieldConversionError

Notify the Alteryxengine that a field conversion error has occurred. Returns the text of the reported error message.

void ReportFieldConversionError(const wchar_t *pMessage)

The Alteryxengine issues a message with the TCallbackMessage with a status type of 4.

SetDescription

Set the field's description.

void SetDescription(WString strDescription)

strDescription: The description being added.

SetFromBlob

Set a field's value to that from a specified binary blob value.

void SetFromBlob(Record *pRecord, BlobVal & val)

pRecord: A pointer to the Record structure that is receiving the data.

val: The value the field is set to.

SetFromBool

Set a field's value to that from a specified boolean value.

void SetFromBool(Record *pRecord, bool bVal)

pRecord: A pointer to the Record structure that is receiving the data.

bVal: The value the field is set to.

SetFromDouble

Set a field's value to that from a specified double value.

void SetFromDouble(Record *pRecord, double dVal)

pRecord: A pointer to the Record structure that is receiving the data.

dVal: The value the field is set to.

SetFromInt32

Set a field's value to that from a specified 32-bit integer value.

void SetFromInt32(Record *pRecord, int nVal)

pRecord: A pointer to the Record structure that is receiving the data.

nVal: The value the field is set to.

SetFromInt64

Set a field's value to that from a specified 64-bit integer value.

void SetFromInt64(Record *pRecord, __int64 nVal)

pRecord: A pointer to the Record structure that is receiving the data.

nVal: The value the field is set to.

SetFromSpatialBlob

Set a field's value to that from a specified spatial blob value.

void SetFromSpatialBlob(Record *pRecord, BlobVal & val)

pRecord: A pointer to the Record structure that is receiving the data.

val: The value the field is set to.

SetFromString

Set a field's value to that from a specified 8-bit string value.

void SetFromString(Record *pRecord, const char * pVal, size_t nLen)

You can use the same method to set a field's value to that from a specified 16-bit string value.

void SetFromString(Record *pRecord, const wchar_t * pVal, size_t nLen)

pRecord: A pointer to the Record structure that is receiving the data.

pVal: The value the field is set to.

nLen: The length of the string.

SetNull

Set a field's value to Null.

void SetNull(const RecordData * pRecord)

pRecord: A pointer to the Record structure that is being set to Null.

SetSource

Set the source metadata for the field.

void SetSource(WString strSource)

You can also set the scope of the source. The scope cannot contain the character :.

void SetSource(WString strScope, WString strValue)

strScope: The scope of the source.

strValue: The source of the field.