MFC Grid manual

CValue Class Reference

Stores value of the primitive type used by Common and GUI libraries. More...

#include <Dapfor/Common/Value.h>

List of all members.


Public methods

bool ParseStl (const CFormat *format, const TString &str)
 Parses a formatted STL string to the non-formatted value.
EnType GetType () const
 Gets a value type.
void Serialize (CSerializer &serializer)
 Serializes this object to CSerializer.
static unsigned char GetSerializeVertion ()
 Gets a serialization version.

Public Member Functions

 CValue ()
 CValue (const CValue &v)
 CValue (const TString &v)
 CValue (char v)
 CValue (unsigned char v)
 CValue (short v)
 CValue (unsigned short v)
 CValue (long v)
 CValue (unsigned long v)
 CValue (int64 v)
 CValue (bool v)
 CValue (float v)
 CValue (double v)
 CValue (CDataObject *v)
TString FormatStl (const CFormat *format) const
 Formats value to the formatted STL string.
CString FormatMfc (const CFormat *format) const
 Formats value to the MFC formatted string.
bool ParseMfc (const CFormat *format, const CString &str)
 Parses a MFC formatted string to the non-formatted value.
Assignment operators
CValueoperator= (const CValue &)
CValueoperator= (const TString &)
CValueoperator= (char)
CValueoperator= (unsigned char)
CValueoperator= (short)
CValueoperator= (unsigned short)
CValueoperator= (long)
CValueoperator= (unsigned long)
CValueoperator= (int64)
CValueoperator= (float)
CValueoperator= (bool)
CValueoperator= (double)
CValueoperator= (CDataObject *)
Conversion operator
 operator const TString & () const
 operator char () const
 operator unsigned char () const
 operator short () const
 operator unsigned short () const
 operator long () const
 operator unsigned long () const
 operator int64 () const
 operator bool () const
 operator float () const
 operator double () const
 operator CDataObject * () const
Equality operators
bool operator== (const CValue &) const
bool operator== (const TString &) const
bool operator== (char) const
bool operator== (unsigned char) const
bool operator== (short) const
bool operator== (unsigned short) const
bool operator== (long) const
bool operator== (unsigned long) const
bool operator== (int64) const
bool operator== (bool) const
bool operator== (float) const
bool operator== (double) const
bool operator== (CDataObject *) const
Operators "not equal"
bool operator!= (const CValue &) const
bool operator!= (const TString &) const
bool operator!= (char) const
bool operator!= (unsigned char) const
bool operator!= (short) const
bool operator!= (unsigned short) const
bool operator!= (long) const
bool operator!= (unsigned long) const
bool operator!= (int64) const
bool operator!= (bool) const
bool operator!= (float) const
bool operator!= (double) const
bool operator!= (CDataObject *) const
Operators "less than"
bool operator< (const CValue &) const
bool operator< (const TString &) const
bool operator< (char) const
bool operator< (unsigned char) const
bool operator< (short) const
bool operator< (unsigned short) const
bool operator< (long) const
bool operator< (unsigned long) const
bool operator< (int64) const
bool operator< (bool) const
bool operator< (double) const
bool operator< (float) const
bool operator< (CDataObject *) const
Operators "less than or equal to"
bool operator<= (const CValue &) const
bool operator<= (const TString &) const
bool operator<= (char) const
bool operator<= (unsigned char) const
bool operator<= (short) const
bool operator<= (unsigned short) const
bool operator<= (long) const
bool operator<= (unsigned long) const
bool operator<= (int64) const
bool operator<= (bool) const
bool operator<= (float) const
bool operator<= (double) const
bool operator<= (CDataObject *) const
Operators "greater than"
bool operator> (const CValue &) const
bool operator> (const TString &) const
bool operator> (char) const
bool operator> (unsigned char) const
bool operator> (short) const
bool operator> (unsigned short) const
bool operator> (long) const
bool operator> (unsigned long) const
bool operator> (int64) const
bool operator> (bool) const
bool operator> (float) const
bool operator> (double) const
bool operator> (CDataObject *) const
Operators "greater than or equal to"
bool operator>= (const CValue &) const
bool operator>= (const TString &) const
bool operator>= (char) const
bool operator>= (unsigned char) const
bool operator>= (short) const
bool operator>= (unsigned short) const
bool operator>= (long) const
bool operator>= (unsigned long) const
bool operator>= (int64) const
bool operator>= (bool) const
bool operator>= (float) const
bool operator>= (double) const
bool operator>= (CDataObject *) const

Static Public Member Functions

static TString & GetEmptyStlString ()
 Returns a reference to an empty STL string.
static CString & GetEmptyMfcString ()
 Returns a reference to an empty MFC string.

Detailed Description

Stores value of the primitive type used by Common and GUI libraries.

The value can be one of the following types:
1. STL string
2. MFC CString
3. char
4. undefined char
5. short
6. undefined short
7. long
8. undefined long
9. __int64
10. float
11. double
12. bool

Thread safety
Functions of the class are not thread-safe.

Constructor & Destructor Documentation

CValue (  ) 

Default constructor

CValue ( const CValue v  ) 

Copy constructor

Parameters:
[in] v Value to be copied

CValue ( const TString &  v  ) 

StlString type constructor

Parameters:
[in] v std::string value

CValue ( char  v  ) 

Char type constructor

Parameters:
[in] v char value

CValue ( unsigned char  v  ) 

Unsigned char type constructor

Parameters:
[in] v unsigned char value

CValue ( short  v  ) 

Short type constructor

Parameters:
[in] v short value

CValue ( unsigned short  v  ) 

Unsigned short type constructor

Parameters:
[in] v unsigned short value

CValue ( long  v  ) 

Long type constructor

Parameters:
[in] v long value

CValue ( unsigned long  v  ) 

Unsigned long type constructor

Parameters:
[in] v unsigned long value

CValue ( int64  v  ) 

Int64 type constructor

Parameters:
[in] v __int64 value

CValue ( bool  v  ) 

Bool type constructor

Parameters:
[in] v bool value

CValue ( float  v  ) 

Float type constructor

Parameters:
[in] v float value

CValue ( double  v  ) 

Double type constructor

Parameters:
[in] v double value

CValue ( CDataObject v  ) 

Pointer to CDataObject type constructor

Parameters:
[in] v pointer to CDataObject


Member Function Documentation

CValue & operator= ( const CValue v  ) 

Parameters:
[in] v CValue type

CValue & operator= ( const TString &  v  )  [inline]

Parameters:
[in] v StlString type value

CValue & operator= ( char  v  )  [inline]

Parameters:
[in] v char type value

CValue & operator= ( unsigned char  v  )  [inline]

Parameters:
[in] v unsigned char type value

CValue & operator= ( short  v  )  [inline]

Parameters:
[in] v short type value

CValue & operator= ( unsigned short  v  )  [inline]

Parameters:
[in] v unsigned short type value

CValue & operator= ( long  v  )  [inline]

Parameters:
[in] v long type value

CValue & operator= ( unsigned long  v  )  [inline]

Parameters:
[in] v unsigned long type value

CValue & operator= ( int64  v  )  [inline]

Parameters:
[in] v int64 type value

CValue & operator= ( float  v  )  [inline]

Parameters:
[in] v float type value

CValue & operator= ( bool  v  )  [inline]

Parameters:
[in] v bool type value

CValue & operator= ( double  v  )  [inline]

Parameters:
[in] v double type value

CValue & operator= ( CDataObject v  )  [inline]

Parameters:
[in] v pointer to CDataObject value

operator const TString & (  )  const [inline]

Returns:
TString type value.

operator char (  )  const [inline]

Returns:
char type value.

operator unsigned char (  )  const [inline]

Returns:
unsigned char type value.

operator short (  )  const [inline]

Returns:
short type value.

operator unsigned short (  )  const [inline]

Returns:
unsigned short type value.

operator long (  )  const [inline]

Returns:
long type value.

operator unsigned long (  )  const [inline]

Returns:
unsigned long type value.

operator int64 (  )  const [inline]

Returns:
__int64 type value.

operator bool (  )  const [inline]

Returns:
bool type value.

operator float (  )  const [inline]

Returns:
float type value.

operator double (  )  const [inline]

Returns:
double type value.

operator CDataObject * (  )  const [inline]

Returns:
pointer to CDataObject type value.

bool operator== ( const CValue v  )  const

Parameters:
[in] v CValue type
Returns:
True if the values are equal. Otherwise false.

bool operator== ( const TString &  v  )  const

Parameters:
[in] v StlString type value
Returns:
True if the values are equal. Otherwise false.

bool operator== ( char  v  )  const [inline]

Parameters:
[in] v char type value
Returns:
True if the values are equal. Otherwise false.

bool operator== ( unsigned char  v  )  const [inline]

Parameters:
[in] v unsigned char type value
Returns:
True if the values are equal. Otherwise false.

bool operator== ( short  v  )  const [inline]

Parameters:
[in] v short type value
Returns:
True if the values are equal. Otherwise false.

bool operator== ( unsigned short  v  )  const [inline]

Parameters:
[in] v unsigned short type value
Returns:
True if the values are equal. Otherwise false.

bool operator== ( long  v  )  const [inline]

Parameters:
[in] v long type value
Returns:
True if the values are equal. Otherwise false.

bool operator== ( unsigned long  v  )  const [inline]

Parameters:
[in] v unsigned long type value
Returns:
True if the values are equal. Otherwise false.

bool operator== ( int64  v  )  const [inline]

Parameters:
[in] v int64 type value
Returns:
True if the values are equal. Otherwise false.

bool operator== ( bool  v  )  const [inline]

Parameters:
[in] v bool type value
Returns:
True if the values are equal. Otherwise false.

bool operator== ( float  v  )  const [inline]

Parameters:
[in] v float type value
Returns:
True if the values are equal. Otherwise false.

bool operator== ( double  v  )  const [inline]

Parameters:
[in] v double type value
Returns:
True if the values are equal. Otherwise false.

bool operator== ( CDataObject v  )  const [inline]

Parameters:
[in] v pointer to CDataObject value
Returns:
True if the values are equal. Otherwise false.

bool operator!= ( const CValue v  )  const [inline]

Parameters:
[in] v CValue type
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( const TString &  v  )  const [inline]

Parameters:
[in] v StlString type value
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( char  v  )  const [inline]

Parameters:
[in] v char type value
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( unsigned char  v  )  const [inline]

Parameters:
[in] v unsigned char type value
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( short  v  )  const [inline]

Parameters:
[in] v short type value
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( unsigned short  v  )  const [inline]

Parameters:
[in] v unsigned short type value
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( long  v  )  const [inline]

Parameters:
[in] v long type value
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( unsigned long  v  )  const [inline]

Parameters:
[in] v unsigned long type value
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( int64  v  )  const [inline]

Parameters:
[in] v int64 type value
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( bool  v  )  const [inline]

Parameters:
[in] v bool type value
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( float  v  )  const [inline]

Parameters:
[in] v float type value
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( double  v  )  const [inline]

Parameters:
[in] v double type value
Returns:
True if the values are not equal. Otherwise false.

bool operator!= ( CDataObject v  )  const [inline]

Parameters:
[in] v pointer to CDataObject value
Returns:
True if the values are not equal. Otherwise false.

bool operator< ( const CValue v  )  const

Parameters:
[in] v CValue type
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( const TString &  v  )  const

Parameters:
[in] v StlString type value
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( char  v  )  const [inline]

Parameters:
[in] v char type value
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( unsigned char  v  )  const [inline]

Parameters:
[in] v unsigned char type value
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( short  v  )  const [inline]

Parameters:
[in] v short type value
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( unsigned short  v  )  const [inline]

Parameters:
[in] v unsigned short type value
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( long  v  )  const [inline]

Parameters:
[in] v long type value
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( unsigned long  v  )  const [inline]

Parameters:
[in] v unsigned long type value
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( int64  v  )  const [inline]

Parameters:
[in] v int64 type value
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( bool  v  )  const [inline]

Parameters:
[in] v bool type value
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( double  v  )  const [inline]

Parameters:
[in] v double type value
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( float  v  )  const [inline]

Parameters:
[in] v float type value
Returns:
True if the value is less than v. Otherwise false.

bool operator< ( CDataObject v  )  const [inline]

Parameters:
[in] v pointer to CDataObject value
Returns:
True if the value is less than v. Otherwise false.

bool operator<= ( const CValue v  )  const

Parameters:
[in] v CValue type
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( const TString &  v  )  const

Parameters:
[in] v StlString type value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( char  v  )  const [inline]

Parameters:
[in] v char type value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( unsigned char  v  )  const [inline]

Parameters:
[in] v unsigned char type value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( short  v  )  const [inline]

Parameters:
[in] v short type value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( unsigned short  v  )  const [inline]

Parameters:
[in] v unsigned short type value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( long  v  )  const [inline]

Parameters:
[in] v long type value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( unsigned long  v  )  const [inline]

Parameters:
[in] v unsigned long type value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( int64  v  )  const [inline]

Parameters:
[in] v int64 type value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( bool  v  )  const [inline]

Parameters:
[in] v bool type value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( float  v  )  const [inline]

Parameters:
[in] v float type value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( double  v  )  const [inline]

Parameters:
[in] v double type value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator<= ( CDataObject v  )  const [inline]

Parameters:
[in] v pointer to CDataObject value
Returns:
True if the value is less or equal to v. Otherwise false.

bool operator> ( const CValue v  )  const

Parameters:
[in] v CValue type
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( const TString &  v  )  const

Parameters:
[in] v StlString type value
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( char  v  )  const [inline]

Parameters:
[in] v char type value
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( unsigned char  v  )  const [inline]

Parameters:
[in] v unsigned char type value
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( short  v  )  const [inline]

Parameters:
[in] v short type value
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( unsigned short  v  )  const [inline]

Parameters:
[in] v unsigned short type value
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( long  v  )  const [inline]

Parameters:
[in] v long type value
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( unsigned long  v  )  const [inline]

Parameters:
[in] v unsigned long type value
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( int64  v  )  const [inline]

Parameters:
[in] v int64 type value
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( bool  v  )  const [inline]

Parameters:
[in] v bool type value
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( float  v  )  const [inline]

Parameters:
[in] v float type value
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( double  v  )  const [inline]

Parameters:
[in] v double type value
Returns:
True if the value is greater than v. Otherwise false.

bool operator> ( CDataObject v  )  const [inline]

Parameters:
[in] v pointer to CDataObject value
Returns:
True if the value is greater than v. Otherwise false.

bool operator>= ( const CValue v  )  const

Parameters:
[in] v CValue type
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( const TString &  v  )  const

Parameters:
[in] v StlString type value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( char  v  )  const [inline]

Parameters:
[in] v char type value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( unsigned char  v  )  const [inline]

Parameters:
[in] v unsigned char type value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( short  v  )  const [inline]

Parameters:
[in] v short type value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( unsigned short  v  )  const [inline]

Parameters:
[in] v unsigned short type value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( long  v  )  const [inline]

Parameters:
[in] v long type value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( unsigned long  v  )  const [inline]

Parameters:
[in] v unsigned long type value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( int64  v  )  const [inline]

Parameters:
[in] v int64 type value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( bool  v  )  const [inline]

Parameters:
[in] v bool type value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( float  v  )  const [inline]

Parameters:
[in] v float type value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( double  v  )  const [inline]

Parameters:
[in] v double type value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool operator>= ( CDataObject v  )  const [inline]

Parameters:
[in] v pointer to CDataObject value
Returns:
True if the value is greater or equal to v. Otherwise false.

bool ParseStl ( const CFormat format,
const TString &  str 
)

Parses a formatted STL string to the non-formatted value.

Parameters:
[in] format Textual format which parses a string to value. If the format is not specified, the function gets a default format, returned by CFormat::GetDefaultFormat();
[in] str Formatted string
Returns:
True, if the string has been successfully parsed. Otherwise false

EnType GetType (  )  const [inline]

Gets a value type.

Returns:
Type of the value.

unsigned char GetSerializeVertion (  )  [static]

Gets a serialization version.

Returns:
Current serialization version.

void Serialize ( CSerializer serializer  ) 

Serializes this object to CSerializer.

Serializes CValue object to the serializer. To reduce Common library dependence on external libraries (including MFC) CSerializer class have been added, which resembles CArchive class, existing in MFC library.

Parameters:
[in] serializer Object of CSerializer class