Unicorn XML Toolkit
Version 1.00.00

Namespace Som
Class CValue

class CValue {
public:
    enum {
        typeVoid,
        typeFloat,
        typeDouble,
        typeLong,
        typeShort,
        typeUnsignedLong,
        typeUnsignedShort,
        typeChar,
        typeWchar,
        typeBoolean,
        typeOctet,
        typeString,
        typeWstring,
        typeInterface
        };
public:
    CValue();
    ~CValue();
public:
    void CreateAny(const CValue &value);
    void CreateVoid();
    void CreateFloat(float fltValue);
    void CreateDouble(double dblValue);
    void CreateLong(long lngValue);
    void CreateShort(short shoValue);
    void CreateUnsignedLong(unsigned long lngValue);
    void CreateUnsignedShort(unsigned short shoValue);
    void CreateChar(char chValue);
    void CreateWchar(WCHAR chValue);
    void CreateBoolean(bool bValue);
    void CreateOctet(BYTE bytValue);
    void CreateString(const char *pszValue);
    void CreateWstring(const WCHAR *pszValue);
    void CreateInterface(CObject *pObject);
public:
    int GetType() const;
    float GetFloat() const;
    double GetDouble() const;
    long GetLong() const;
    short GetShort() const;
    unsigned long GetUnsignedLong() const;
    unsigned short GetUnsignedShort() const;
    char GetChar() const;
    WCHAR GetWchar() const;
    bool GetBoolean() const;
    BYTE GetOctet() const;
    char *GetString() const;
    WCHAR *GetWstring() const;
    CObject *GetInterface() const;
    };

The SOM value.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CObject
Constructor/Destructor Summary
CValue ();
����������Constructs the value.
~CValue ();
����������Destroys the value.

Function Summary
void CreateAny (const CValue &value);
����������Reinitializes this value, making a copy of another (source) value.
void CreateVoid ();
����������Reinitializes this value to typeVoid .
void CreateFloat (float fltValue);
����������Reinitializes this value to typeFloat .
void CreateDouble (double dblValue);
����������Reinitializes this value to typeDouble .
void CreateLong (long lngValue);
����������Reinitializes this value to typeLong .
void CreateShort (short shoValue);
����������Reinitializes this value to typeShort .
void CreateUnsignedLong (unsigned long lngValue);
����������Reinitializes this value to typeUnsignedLong .
void CreateUnsignedShort (unsigned short shoValue);
����������Reinitializes this value to typeUnsignedShort .
void CreateChar (char chValue);
����������Reinitializes this value to typeChar .
void CreateWchar (WCHAR chValue);
����������Reinitializes this value to typeWchar .
void CreateBoolean (bool bValue);
����������Reinitializes this value to typeBoolean .
void CreateOctet (BYTE bytValue);
����������Reinitializes this value to typeOctet .
void CreateString (const char *pszValue);
����������Reinitializes this value to typeString .
void CreateWstring (const WCHAR *pszValue);
����������Reinitializes this value to typeWstring .
void CreateInterface (CObject *pObject);
����������Reinitializes this value to typeInterface .
int GetType () const;
����������Returns the type code of this value.
float GetFloat () const;
����������Returns a floating point number associated with this value.
double GetDouble () const;
����������Returns a double precision number associated with this value.
long GetLong () const;
����������Returns a long integer associated with this value.
short GetShort () const;
����������Returns a short integer associated with this value.
unsigned�long GetUnsignedLong () const;
����������Returns an unsigned long integer associated with this value.
unsigned�short GetUnsignedShort () const;
����������Returns an unsigned short integer associated with this value.
char GetChar () const;
����������Returns an 8-bit character code associated with this value.
WCHAR GetWchar () const;
����������Returns a 16-bit character code associated with this value.
bool GetBoolean () const;
����������Returns a boolean associated with this value.
BYTE GetOctet () const;
����������Returns an octet associated with this value.
char�* GetString () const;
����������Returns a string of 8-bit characters associated with this value.
WCHAR�* GetWstring () const;
����������Returns a string of 16-bit characters associated with this value.
CObject�* GetInterface () const;
����������Returns an object associated with this value.

Constructor/Destructor Detail

CValue

CValue();

Constructs the value.

The value is assigned type typeVoid .

~CValue

~CValue();

Destroys the value.

If this value is of type typeString or typeWstring , the memory allocated to hold string data is freed; if this value is of type typeInterace , the SOM object associated with this value is released (applying Core::CInterface::Release to that object).

Function Detail

CreateAny

void CreateAny(const CValue &value);

Reinitializes this value, making a copy of another (source) value.

If the source value is of type typeString or typeWstring , the separate block of memory is allocated to hold a copy of string data for this value. If the source value is of type typeInterface , the proper reference counting is performed for the corresponding SOM object. The previous content of this value is destroyed.

Parameters:
value - the source value

CreateVoid

void CreateVoid();

Reinitializes this value to typeVoid .

The previous content of this value is destroyed.

CreateFloat

void CreateFloat(float fltValue);

Reinitializes this value to typeFloat .

The previous content of this value is destroyed.

Parameters:
fltValue - the floating point number to be associated with this value

CreateDouble

void CreateDouble(double dblValue);

Reinitializes this value to typeDouble .

The previous content of this value is destroyed.

Parameters:
dblValue - the double precision number to be associated with this value

CreateLong

void CreateLong(long lngValue);

Reinitializes this value to typeLong .

The previous content of this value is destroyed.

Parameters:
lngValue - the long integer to be associated with this value

CreateShort

void CreateShort(short shoValue);

Reinitializes this value to typeShort .

The previous content of this value is destroyed.

Parameters:
shoValue - the short integer to be associated with this value

CreateUnsignedLong

void CreateUnsignedLong(unsigned long lngValue);

Reinitializes this value to typeUnsignedLong .

The previous content of this value is destroyed.

Parameters:
lngValue - the unsigned long integer to be associated with this value

CreateUnsignedShort

void CreateUnsignedShort(unsigned short shoValue);

Reinitializes this value to typeUnsignedShort .

The previous content of this value is destroyed.

Parameters:
shoValue - the unsigned short integer to be associated with this value

CreateChar

void CreateChar(char chValue);

Reinitializes this value to typeChar .

The previous content of this value is destroyed.

Parameters:
chValue - the 8-bit character code to be associated with this value

CreateWchar

void CreateWchar(WCHAR chValue);

Reinitializes this value to typeWchar .

The previous content of this value is destroyed.

Parameters:
chValue - the 16-bit character code to be associated with this value

CreateBoolean

void CreateBoolean(bool bValue);

Reinitializes this value to typeBoolean .

The previous content of this value is destroyed.

Parameters:
bValue - the boolean to be associated with this value

CreateOctet

void CreateOctet(BYTE bytValue);

Reinitializes this value to typeOctet .

The previous content of this value is destroyed.

Parameters:
bytValue - the octet to be associated with this value

CreateString

void CreateString(const char *pszValue);

Reinitializes this value to typeString .

The separate block of memory is allocated to hold a copy of string data for this value. The previous content of this value is destroyed.

Parameters:
pszValue - the string of 8-bit characters to be associated with this value

CreateWstring

void CreateWstring(const WCHAR *pszValue);

Reinitializes this value to typeWstring .

The separate block of memory is allocated to hold a copy of string data for this value. The previous content of this value is destroyed.

Parameters:
pszValue - the string of 16-bit characters to be associated with this value

CreateInterface

void CreateInterface(CObject *pObject);

Reinitializes this value to typeInterface .

The proper reference counting is performed for the specified SOM object. The previous content of this value is destroyed.

Parameters:
pObject - the SOM object to be associated with this value

GetType

int GetType() const;

Returns the type code of this value.

Allowed type codes are specified by the anonymous enumeration defined by CValue class.

Returns:
the type code of this value

GetFloat

float GetFloat() const;

Returns a floating point number associated with this value.

This value must be of type typeFloat ; otherwise the result of calling this function is unspecified.

Returns:
the floating point number associated with this value

GetDouble

double GetDouble() const;

Returns a double precision number associated with this value.

This value must be of type typeDouble ; otherwise the result of calling this function is unspecified.

Returns:
the double precision number associated with this value

GetLong

long GetLong() const;

Returns a long integer associated with this value.

This value must be of type typeLong ; otherwise the result of calling this function is unspecified.

Returns:
the long integer associated with this value

GetShort

short GetShort() const;

Returns a short integer associated with this value.

This value must be of type typeShort ; otherwise the result of calling this function is unspecified.

Returns:
the short integer associated with this value

GetUnsignedLong

unsigned long GetUnsignedLong() const;

Returns an unsigned long integer associated with this value.

This value must be of type typeUnsignedLong ; otherwise the result of calling this function is unspecified.

Returns:
the unsigned long integer associated with this value

GetUnsignedShort

unsigned short GetUnsignedShort() const;

Returns an unsigned short integer associated with this value.

This value must be of type typeUnsignedShort ; otherwise the result of calling this function is unspecified.

Returns:
the unsigned short integer associated with this value

GetChar

char GetChar() const;

Returns an 8-bit character code associated with this value.

This value must be of type typeChar ; otherwise the result of calling this function is unspecified.

Returns:
the 8-bit character code associated with this value

GetWchar

WCHAR GetWchar() const;

Returns a 16-bit character code associated with this value.

This value must be of type typeWchar ; otherwise the result of calling this function is unspecified.

Returns:
the 16-bit character code associated with this value

GetBoolean

bool GetBoolean() const;

Returns a boolean associated with this value.

This value must be of type typeBoolean ; otherwise the result of calling this function is unspecified.

Returns:
the boolean associated with this value

GetOctet

BYTE GetOctet() const;

Returns an octet associated with this value.

This value must be of type typeOctet ; otherwise the result of calling this function is unspecified.

Returns:
the octet associated with this value

GetString

char *GetString() const;

Returns a string of 8-bit characters associated with this value.

The pointer to the string data attached to this value is actually returned.

This value must be of type typeString ; otherwise the result of calling this function is unspecified.

Returns:
the string of 8-bit characters associated with this value

GetWstring

WCHAR *GetWstring() const;

Returns a string of 16-bit characters associated with this value.

The pointer to the string data attached to this value is actually returned.

This value must be of type typeWstring ; otherwise the result of calling this function is unspecified.

Returns:
the string of 16-bit characters associated with this value

GetInterface

CObject *GetInterface() const;

Returns an object associated with this value.

The reference count of the object is not changed.

This value must be of type typeInterface ; otherwise the result of calling this function is unspecified.

Returns:
the object associated with this value

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.