Attribute field value. More...
#include <pcidsk_shape.h>
Public Member Functions | |
ShapeField () | |
Simple constructor. | |
ShapeField (const ShapeField &src) | |
Copy constructor. | |
ShapeField & | operator= (const ShapeField &src) |
Assignment operator. | |
void | Clear () |
Clear field value. | |
ShapeFieldType | GetType () const |
Fetch field type. | |
void | SetValue (int32 val) |
Set integer value on field. | |
void | SetValue (const std::vector< int32 > &val) |
Set integer list value on field. | |
void | SetValue (const std::string &val) |
Set string value on field. | |
void | SetValue (double val) |
Set double precision floating point value on field. | |
void | SetValue (float val) |
Set single precision floating point value on field. | |
int32 | GetValueInteger () const |
Fetch value as integer or zero if field not of appropriate type. | |
std::vector< int32 > | GetValueCountedInt () const |
Fetch value as integer list or empty list if field not of appropriate type. | |
std::string | GetValueString () const |
Fetch value as string or "" if field not of appropriate type. | |
float | GetValueFloat () const |
Fetch value as float or 0.0 if field not of appropriate type. | |
double | GetValueDouble () const |
Fetch value as double or 0.0 if field not of appropriate type. |
Attribute field value.
This class encapsulates any of the supported vector attribute field types in a convenient way that avoids memory leaks or ownership confusion. The object has a field type (initially FieldTypeNone on construction) and a value of the specified type. Note that the appropriate value accessor (ie. GetValueInteger()) must be used that corresponds to the fields type. No attempt is made to automatically convert (ie. float to double) if the wrong accessor is used.