BVariant Class Reference

#include <BVariant.h>

Inheritance diagram for BVariant:

Inheritance graph
[legend]

List of all members.


Detailed Description

A data type that can hold many different types of data, such as numerical, point, and string data.

Public Member Functions

 BVariant (const BStringVector &val)
 Constructs a BVariant that holds a collection of BString values.
 BVariant (char **pVals)
 Constructs a BVariant that holds a collection of BString values.
 BVariant (const DoubleVector &val)
 Constructs a BVariant that holds a collection of floating-point values.
 BVariant (const double *pVals, int count)
 Constructs a BVariant that holds a collection of floating-point values.
 BVariant (const Int32Vector &val)
 Constructs a BVariant that holds a collection of integers.
 BVariant (const int *pVals, int count)
 Constructs a BVariant that holds a collection of integers.
 BVariant (const BPoint &val)
 Constructs a BVariant that holds a BPoint.
 BVariant (Int64 val)
 Constructs a BVariant that holds an integer value.
 BVariant (bool val)
 Constructs a BVariant that holds a boolean value.
 BVariant (float val)
 Constructs a BVariant that holds a floating-point value.
 BVariant (Int32 val)
 Constructs a BVariant that holds an integer value.
 BVariant (double val)
 Constructs a BVariant that holds a floating-point value.
 BVariant (const wchar_t *val, int maxLength=0)
 Constructs a BVariant that holds a BString.
 BVariant (const char *val, int maxLength=0)
 Constructs a BVariant that holds a BString.
 BVariant (const BString *val, int maxLength=0)
 Constructs a BVariant that holds a BString.
 BVariant (const BString &val, int maxLength=0)
 Constructs a BVariant that holds a BString.
 BVariant (const BVariant &var)
 Copy constructor.
 BVariant ()
 Default constructor.
void Clear (void)
 Resets this BVariant to an uninitialized state.
BVariantClone (void) const
 Creates a deep-copy of this object.
virtual size_t ComputeSize (void) const
 Computes the size of the BByteArray required to store this object.
virtual void FromByteArray (const BByteArray &bytes, size_t &startPos)
 Initializes an instance of this object from a BByteArray.
EVariantType GetType (void) const
 Gets the data type for this BVariant.
bool GetValueAsBoolean (bool defVal=false) const
 Returns the contents of this BVariant expressed as a boolean.
double GetValueAsDouble (double defVal=0.0) const
 Returns the contents of this BVariant expressed as a double.
DoubleVector GetValueAsDoubleList () const
 Returns the contents of this BVariant formatted as a double list.
float GetValueAsFloat (float defVal=0.0) const
 Returns the contents of this BVariant expressed as a float.
Int32 GetValueAsInteger (Int32 defVal=0) const
 Returns the contents of this BVariant expressed as an integer.
Int64 GetValueAsInteger64 (Int64 defVal=0) const
 Returns the contents of this BVariant expressed as a 64-bit integer.
Int32Vector GetValueAsIntegerList () const
 Returns the contents of this BVariant formatted as an integer list.
BPoint GetValueAsPoint () const
 Returns the contents of this BVariant formatted as a BPoint.
BString GetValueAsString () const
 Returns the contents of this BVariant formatted as a BString.
BStringVector GetValueAsStringList () const
 Returns the contents of this BVariant formatted as a BString list.
bool IsList (void) const
 Gets an indicator of whether or not this BVariant contains a list of values.
bool operator!= (const BVariant &rhs) const
 Inequality operator.
BVariantoperator= (const BVariant &rhs)
 Assignment operator.
bool operator== (const BVariant &rhs) const
 Equality operator.
void SetType (const EVariantType type)
 Sets the data type for this BVariant.
void SetValue (const BStringVector &val)
 Sets the value of this BVariant to a BString list.
void SetValue (char **pVals)
 Sets the value of this BVariant to a BString list.
void SetValue (const DoubleVector &val)
 Sets the value of this BVariant to a double list.
void SetValue (const double *pVals, int count)
 Sets the value of this BVariant to a double list.
void SetValue (const Int32Vector &val)
 Sets the value of this BVariant to an integer list.
void SetValue (const Int32 *pVals, int count)
 Sets the value of this BVariant to an integer list.
void SetValue (const BPoint &val)
 Sets the value of this BVariant to a BPoint.
void SetValue (const Int64 val)
 Sets the value of this BVariant to a 64-bit integer.
void SetValue (const bool val)
 Sets the value of this BVariant to a boolean.
void SetValue (const float val)
 Sets the value of this BVariant to a float.
void SetValue (const double val)
 Sets the value of this BVariant to a double.
void SetValue (const Int32 val)
 Sets the value of this BVariant to an integer.
void SetValue (const wchar_t *val, size_t maxLength=0)
 Set the value of this BVariant to a BString.
void SetValue (const char *val, size_t maxLength=0)
 Set the value of this BVariant to a BString.
void SetValue (const BString *val, size_t maxLength=0)
 Set the value of this BVariant to a BString.
void SetValue (const BString &val, size_t maxLength=0)
 Set the value of this BVariant to a BString.
virtual BByteArray ToByteArray (void) const
 Stores this object in a BByteArray.
virtual ~BVariant ()
 Destructor.

Static Public Member Functions

static BString GetDoubleListSeperator ()
 Gets the seperator used when returning a double list as a string.
static BString GetFalseStringValue ()
 Gets the string value to use for false when converting from a boolean.
static BString GetIntegerListSeperator ()
 Gets the seperator used when returning an integer list as a string.
static BString GetStringListSeperator ()
 Gets the seperator used when returning a string list as a single string.
static BString GetTrueStringValue ()
 Gets the string value used for true when converting from a boolean.
static void SetDoubleListSeperator (const BString &seperator)
 Sets the seperator used when returning a double list as a string.
static void SetFalseStringValue (const BString &falseValue)
 Sets the string value to use for false when converting from a boolean.
static void SetIntegerListSeperator (const BString &seperator)
 Sets the seperator used when returning an integer list as a string.
static void SetStringListSeperator (const BString &seperator)
 Sets the seperator used when returning a string list as a single string.
static void SetTrueStringValue (const BString &trueValue)
 Sets the string value to use for true when converting from a boolean.

Classes

union  ValueUnion
 Union to hold scalar values.

Constructor & Destructor Documentation

BVariant (  )  [inline]

Default constructor.

Creates a BVariant with an unspecified type.

BVariant ( const BVariant var  )  [inline]

Copy constructor.

Parameters:
var The BVariant object to copy.

BVariant ( const BString val,
int  maxLength = 0 
) [inline]

Constructs a BVariant that holds a BString.

Parameters:
val The data value.
maxLength The maximum length for the string data. In order to use the whole string, specify 0.

BVariant ( const BString val,
int  maxLength = 0 
) [inline]

Constructs a BVariant that holds a BString.

Parameters:
val The data value.
maxLength The maximum length for the string data. In order to use the whole string, specify 0.

BVariant ( const char *  val,
int  maxLength = 0 
) [inline]

Constructs a BVariant that holds a BString.

Parameters:
val The data value.
maxLength The maximum length for the string data. In order to use the whole string, specify 0.

BVariant ( const wchar_t *  val,
int  maxLength = 0 
) [inline]

Constructs a BVariant that holds a BString.

Parameters:
val The data value.
maxLength The maximum length for the string data. In order to use the whole string, specify 0.

BVariant ( double  val  )  [inline]

Constructs a BVariant that holds a floating-point value.

Parameters:
val The data value.

BVariant ( Int32  val  )  [inline]

Constructs a BVariant that holds an integer value.

Parameters:
val The data value.

BVariant ( float  val  )  [inline]

Constructs a BVariant that holds a floating-point value.

Parameters:
val The data value.

BVariant ( bool  val  )  [inline]

Constructs a BVariant that holds a boolean value.

Parameters:
val The data value.

BVariant ( Int64  val  )  [inline]

Constructs a BVariant that holds an integer value.

Parameters:
val The data value.

BVariant ( const BPoint val  )  [inline]

Constructs a BVariant that holds a BPoint.

Parameters:
val The data value.

BVariant ( const int *  pVals,
int  count 
) [inline]

Constructs a BVariant that holds a collection of integers.

Parameters:
pVals An array of values.
count The number of values in the array.

BVariant ( const Int32Vector val  )  [inline]

Constructs a BVariant that holds a collection of integers.

Parameters:
val A collection of values.

BVariant ( const double *  pVals,
int  count 
) [inline]

Constructs a BVariant that holds a collection of floating-point values.

Parameters:
pVals An array of values.
count The number of values in the array.

BVariant ( const DoubleVector val  )  [inline]

Constructs a BVariant that holds a collection of floating-point values.

Parameters:
val A collection of values.

BVariant ( char **  pVals  )  [inline]

Constructs a BVariant that holds a collection of BString values.

Parameters:
pVals An array of values.

BVariant ( const BStringVector val  )  [inline]

Constructs a BVariant that holds a collection of BString values.

Parameters:
val A collection of BString objects.

virtual ~BVariant (  )  [virtual]

Destructor.


Member Function Documentation

void Clear ( void   ) 

Resets this BVariant to an uninitialized state.

BVariant* Clone ( void   )  const [inline]

Creates a deep-copy of this object.

Returns:
A deep-copy of this object.

virtual size_t ComputeSize ( void   )  const [virtual]

Computes the size of the BByteArray required to store this object.

Returns:
The size of the BByteArray.

Implements BByteStreamable.

virtual void FromByteArray ( const BByteArray bytes,
size_t &  startPos 
) [virtual]

Initializes an instance of this object from a BByteArray.

Parameters:
bytes The BByteArray containing the byte representation of the object.
startPos The position in the BByteArray where the byte representation begins. This value will be updated to point to the byte past the end of this object in the byte array.

Implements BByteStreamable.

static BString GetDoubleListSeperator (  )  [static]

Gets the seperator used when returning a double list as a string.

When a double list is retrieved as a string, it will concatonate all the values into a single string. When it concatonates, it will seperate the values using the seperator returned by this method.

Returns:
The seperator used when returning a double list as a string.

static BString GetFalseStringValue (  )  [static]

Gets the string value to use for false when converting from a boolean.

When a boolean is converted into a string its value is false, this value will be returned.

Returns:
The string value to use for false when converting from a boolean.

static BString GetIntegerListSeperator (  )  [static]

Gets the seperator used when returning an integer list as a string.

When an integer list is retrieved as a string, it will concatonate all the values into a single string. When it concatonates, it will seperate the values using the seperator returned by this method.

Returns:
The seperator used when returning an integer list as a string.

static BString GetStringListSeperator (  )  [static]

Gets the seperator used when returning a string list as a single string.

When a string list is retrieved as a string, it will concatonate all the values into a single string. When it concatonates, it will seperate the values using the seperator returned by this method.

Returns:
The seperator used when returning a string list as a string.

static BString GetTrueStringValue (  )  [static]

Gets the string value used for true when converting from a boolean.

When a boolean is converted into a string and its value is true, this value will be returned.

Returns:
The string value to use for true when converting from a boolean.

EVariantType GetType ( void   )  const [inline]

Gets the data type for this BVariant.

Returns:
The data type

bool GetValueAsBoolean ( bool  defVal = false  )  const

Returns the contents of this BVariant expressed as a boolean.

Parameters:
defVal The value that will be returned if this BVariant cannot be expressed as a boolean.
Returns:
The value of this BVariant expressed as a boolean.
Exceptions:
BAttributeDataException This exception will be thrown if the value of this BVariant cannot be expressed as a boolean.

double GetValueAsDouble ( double  defVal = 0.0  )  const

Returns the contents of this BVariant expressed as a double.

Parameters:
defVal The value that will be returned if this BVariant cannot be expressed as a double.
Returns:
The value of this BVariant expressed as a double.
Exceptions:
BAttributeDataException This exception will be thrown if the value of this BVariant cannot be expressed as a double.

DoubleVector GetValueAsDoubleList (  )  const

Returns the contents of this BVariant formatted as a double list.

Returns:
The value of this BVariant expressed as an double list.
Exceptions:
BAttributeDataException This exception will be thrown if the value of this BVariant cannot be expressed as an double list.

float GetValueAsFloat ( float  defVal = 0.0  )  const

Returns the contents of this BVariant expressed as a float.

Parameters:
defVal The value that will be returned if this BVariant cannot be expressed as a float.
Returns:
The value of this BVariant expressed as a float.
Exceptions:
BAttributeDataException This exception will be thrown if the value of this BVariant cannot be expressed as a float.

Int32 GetValueAsInteger ( Int32  defVal = 0  )  const

Returns the contents of this BVariant expressed as an integer.

If this BVariant contains a floating-point value, then this will return the greatest integer that is less than the floating-point value.

Parameters:
defVal The value that will be returned if this BVariant cannot be expressed as an integer.
Returns:
The value of this BVariant expressed as an integer.
Exceptions:
BAttributeDataException This exception will be thrown if the value of this BVariant cannot be expressed as an integer.

Int64 GetValueAsInteger64 ( Int64  defVal = 0  )  const

Returns the contents of this BVariant expressed as a 64-bit integer.

If this BVariant contains a floating-point value, then this will return the greatest integer that is less than the floating-point value.

Parameters:
defVal The value that will be returned if this BVariant cannot be expressed as an integer.
Returns:
The value of this BVariant expressed as a 64-bit integer.
Exceptions:
BAttributeDataException This exception will be thrown if the value of this BVariant cannot be expressed as a 64-bit integer.

Int32Vector GetValueAsIntegerList (  )  const

Returns the contents of this BVariant formatted as an integer list.

Returns:
The value of this BVariant expressed as an integer list.
Exceptions:
BAttributeDataException This exception will be thrown if the value of this BVariant cannot be expressed as an integer list.

BPoint GetValueAsPoint (  )  const

Returns the contents of this BVariant formatted as a BPoint.

Returns:
The value of this BVariant expressed as a BPoint.
Exceptions:
BAttributeDataException This exception will be thrown if the value of this BVariant cannot be expressed as a BPoint.

BString GetValueAsString (  )  const

Returns the contents of this BVariant formatted as a BString.

Returns:
The value of this BVariant formatted as a BString.
Exceptions:
BAttributeDataException This exception will be thrown if the value of this BVariant cannot be formatted as a BString.

BStringVector GetValueAsStringList (  )  const

Returns the contents of this BVariant formatted as a BString list.

Returns:
The value of this BVariant expressed as a BString list.
Exceptions:
BAttributeDataException This exception will be thrown if the value of this BVariant cannot be expressed as a BString list.

bool IsList ( void   )  const [inline]

Gets an indicator of whether or not this BVariant contains a list of values.

Returns:
True if this BVariant contains a list and false if it contains a single value.

bool operator!= ( const BVariant rhs  )  const [inline]

Inequality operator.

Parameters:
rhs The BVariant to compare to this one.
Returns:
True if the specified BVariant does not have the same value as this one and false otherwise.

BVariant& operator= ( const BVariant rhs  ) 

Assignment operator.

Parameters:
rhs The BVariant whose value will be copied into this one.
Returns:
A reference to this BVariant.

bool operator== ( const BVariant rhs  )  const

Equality operator.

Parameters:
rhs The BVariant to compare to this one.
Returns:
True if the specified BVariant has the same value as this one and false otherwise.

static void SetDoubleListSeperator ( const BString seperator  )  [static]

Sets the seperator used when returning a double list as a string.

When a double list is retrieved as a string, it will concatonate all the values into a single string. When it concatonates, it will seperate the values using the seperator specified by this method.

Parameters:
seperator The seperator to use.

static void SetFalseStringValue ( const BString falseValue  )  [static]

Sets the string value to use for false when converting from a boolean.

When a boolean is converted into a string & is false, this value will be returned.

Parameters:
falseValue The string value for boolean false.

static void SetIntegerListSeperator ( const BString seperator  )  [static]

Sets the seperator used when returning an integer list as a string.

When an integer list is retrieved as a string, it will concatonate all the values into a single string. When it concatonates, it will seperate the values using the seperator specified by this method.

Parameters:
seperator The seperator to use to separate integers.

static void SetStringListSeperator ( const BString seperator  )  [static]

Sets the seperator used when returning a string list as a single string.

When a string list is retrieved as a string, it will concatonate all the values into a single string. When it concatonates, it will seperate the values using the seperator specified by this method.

Parameters:
seperator The seperator to use.

static void SetTrueStringValue ( const BString trueValue  )  [static]

Sets the string value to use for true when converting from a boolean.

When a boolean is converted into a string & is true, this value will be returned.

Parameters:
trueValue The string value for boolean true.

void SetType ( const EVariantType  type  )  [inline]

Sets the data type for this BVariant.

Parameters:
type The data type.

void SetValue ( const BStringVector val  ) 

Sets the value of this BVariant to a BString list.

Parameters:
val A collection of BString values.

void SetValue ( char **  pVals  ) 

Sets the value of this BVariant to a BString list.

Parameters:
pVals An array of null-terminated character arrays. The end of the array should be indicated by a NULL character array.

void SetValue ( const DoubleVector val  ) 

Sets the value of this BVariant to a double list.

Parameters:
val A collection of data values.

void SetValue ( const double *  pVals,
int  count 
)

Sets the value of this BVariant to a double list.

Parameters:
pVals A collection of data values.
count The number of values in the collection.

void SetValue ( const Int32Vector val  ) 

Sets the value of this BVariant to an integer list.

Parameters:
val A collection of data values.

void SetValue ( const Int32 pVals,
int  count 
)

Sets the value of this BVariant to an integer list.

Parameters:
pVals A collection of data values.
count The number of values in the collection.

void SetValue ( const BPoint val  ) 

Sets the value of this BVariant to a BPoint.

Parameters:
val The data value.

void SetValue ( const Int64  val  ) 

Sets the value of this BVariant to a 64-bit integer.

Parameters:
val The data value.

void SetValue ( const bool  val  ) 

Sets the value of this BVariant to a boolean.

Parameters:
val The data value.

void SetValue ( const float  val  ) 

Sets the value of this BVariant to a float.

Parameters:
val The data value.

void SetValue ( const double  val  ) 

Sets the value of this BVariant to a double.

Parameters:
val The data value.

void SetValue ( const Int32  val  ) 

Sets the value of this BVariant to an integer.

Parameters:
val The data value.

void SetValue ( const wchar_t *  val,
size_t  maxLength = 0 
)

Set the value of this BVariant to a BString.

Parameters:
val A null-terminated charater string.
maxLength The maximum number of characters to be copied from val. If maxLength is 0, then the whole string will be used.

void SetValue ( const char *  val,
size_t  maxLength = 0 
)

Set the value of this BVariant to a BString.

Parameters:
val A null-terminated charater string.
maxLength The maximum number of characters to be copied from val. If maxLength is 0, then the whole string will be used.

void SetValue ( const BString val,
size_t  maxLength = 0 
) [inline]

Set the value of this BVariant to a BString.

Parameters:
val The data value.
maxLength The maximum number of characters to be copied from val. If maxLength is 0, then the whole string will be used.

void SetValue ( const BString val,
size_t  maxLength = 0 
)

Set the value of this BVariant to a BString.

Parameters:
val The data value.
maxLength The maximum number of characters to be copied from val. If maxLength is 0, then the whole string will be used.

virtual BByteArray ToByteArray ( void   )  const [virtual]

Stores this object in a BByteArray.

Returns:
A BByteArray that stores the contents of this object.

Implements BByteStreamable.


The documentation for this class was generated from the following file:

GeoTranslate 5.0 From Blue Marble Geographics