TAiwVariant Class Reference

API published in: S60 3rd Ed FP 2

Link against: servicehandler.lib


#include <
aiwvariant.h>

Detailed Description

Variant data class to hold a value of a
TAiwGenericParam instance.

The variant contains a data type and a value. This class is attached to TAiwGenericParam instance which holds the semantic type of the value.

See also:
TAiwGenericParam

Public Member Functions

 TAiwVariant ()
 Default constructor.
 TAiwVariant (TInt32 aValue)
 Constructor from a value.
 TAiwVariant (const TUid &aValue)
 Constructor from a value.
 TAiwVariant (const TTime &aValue)
 Constructor from a value.
 TAiwVariant (const TDesC &aValue)
 Constructor from a value.
 TAiwVariant (const HBufC *aValue)
 Constructor from a value.
 TAiwVariant (const TDesC8 &aValue)
 Constructor from a value.
 TAiwVariant (const RFile &aValue)
 Constructor from a value.
IMPORT_C TAiwVariant (const TAiwVariant &aSrc)
 Copy constructor.
IMPORT_C TAiwVariantoperator= (const TAiwVariant &aValue)
 Assignment operator.
TVariantTypeId TypeId () const
 Returns the type id of data this variant object is holding.
TBool IsEmpty () const
 Returns ETrue if this variant is empty (it does not hold any value).
IMPORT_C TBool Get (TInt32 &aValue) const
 Retrieves the value held by this variant.
IMPORT_C TBool Get (TUid &aValue) const
 Retrieves the value held by this variant.
IMPORT_C TBool Get (TPtrC &aValue) const
 Retrieves the value held by this variant.
IMPORT_C TBool Get (TTime &aValue) const
 Retrieves the value held by this variant.
IMPORT_C TBool Get (TPtrC8 &aValue) const
 Retrieves the value held by this variant.
IMPORT_C TBool Get (RFile &aValue) const
 Retrieves the value held by this variant.
IMPORT_C TInt32 AsTInt32 () const
 Returns the value held by this variant.
IMPORT_C TUid AsTUid () const
 Returns the value held by this variant.
IMPORT_C TPtrC AsDes () const
 Returns the value held by this variant.
IMPORT_C TTime AsTTime () const
 Returns the value held by this variant.
IMPORT_C TPtrC8 AsData () const
 Returns the value held by this variant.
IMPORT_C RFile AsFileHandle () const
 Returns the value held by this variant.
IMPORT_C void Reset ()
 Deletes possibly set value and resets this variant to empty.
IMPORT_C void Set (TInt32 aValue)
 Sets integer value to this variant.
IMPORT_C void Set (const TUid &aValue)
 Sets unique ID value to this variant.
IMPORT_C void Set (const TTime &aValue)
 Sets date and time value to this variant.
IMPORT_C void Set (const TDesC &aValue)
 Sets constant text reference to this variant.
void Set (const HBufC *aValue)
 Sets constant text reference to this variant.
IMPORT_C void Set (const TDesC8 &aValue)
 Sets constant 8-bit text reference to this variant.
IMPORT_C void Set (const RFile &aValue)
 Sets RFile file handle to this variant.
TAiwVariantoperator= (const TTime &aValue)
 Assignment operator for the variant.
TAiwVariantoperator= (const TUid &aValue)
 Assignment operator for the variant.
TAiwVariantoperator= (TInt32 aValue)
 Assignment operator for the variant.
TAiwVariantoperator= (const TDesC &aValue)
 Assignment operator for the variant.
TAiwVariantoperator= (const HBufC *aValue)
 Assignment operator for the variant.
TAiwVariantoperator= (const TDesC8 &aValue)
 Assignment operator for the variant.
TAiwVariantoperator= (const RFile &aValue)
 Assignment operator for the variant.

Friends

class TAiwGenericParam
 TAiwGenericParam needs access to private streaming and copying methods.
IMPORT_C TBool operator== (const TAiwVariant &aLhs, const TAiwVariant &aRhs)
 Returns ETrue if two variants are equal.

Data Structures

struct  SInt64
 POD storage for a 64-bit integer.
union  UData

Constructor & Destructor Documentation

TAiwVariant::TAiwVariant  )  [inline]
 

Default constructor.

Initializes this variant to be empty.

Postcondition:
IsEmpty()
TAiwVariant::TAiwVariant TInt32  aValue  )  [inline]
 

Constructor from a value.

Parameters:
aValue The value to set for this variant object.
TAiwVariant::TAiwVariant const TUid &  aValue  )  [inline]
 

Constructor from a value.

Parameters:
aValue The value to set for this variant object.
TAiwVariant::TAiwVariant const TTime &  aValue  )  [inline]
 

Constructor from a value.

Parameters:
aValue The value to set for this variant object.
TAiwVariant::TAiwVariant const TDesC &  aValue  )  [inline]
 

Constructor from a value.

Parameters:
aValue The value to set for this variant object.
TAiwVariant::TAiwVariant const HBufC *  aValue  )  [inline]
 

Constructor from a value.

Parameters:
aValue The value to set for this variant object.
TAiwVariant::TAiwVariant const TDesC8 &  aValue  )  [inline]
 

Constructor from a value.

Parameters:
aValue The value to set for this variant object.
TAiwVariant::TAiwVariant const RFile &  aValue  )  [inline]
 

Constructor from a value.

Parameters:
aValue The value to set for this variant object.
IMPORT_C TAiwVariant::TAiwVariant const TAiwVariant aSrc  ) 
 

Copy constructor.

Does not take ownership of data.

Parameters:
aSrc The source object.

Member Function Documentation

IMPORT_C TPtrC8 TAiwVariant::AsData  )  const
 

Returns the value held by this variant.

Returns:
The value held by this variant. If the data type does not match the function, the default initialized data is returned.
IMPORT_C TPtrC TAiwVariant::AsDes  )  const
 

Returns the value held by this variant.

Returns:
The value held by this variant. If the data type does not match the function, the default initialized data is returned.
IMPORT_C RFile TAiwVariant::AsFileHandle  )  const
 

Returns the value held by this variant.

Returns:
The value held by this variant. If the data type does not match the function, the default initialized data is returned.
IMPORT_C TInt32 TAiwVariant::AsTInt32  )  const
 

Returns the value held by this variant.

Returns:
The value held by this variant. If the data type does not match the function, the default initialized data is returned.
IMPORT_C TTime TAiwVariant::AsTTime  )  const
 

Returns the value held by this variant.

Returns:
The value held by this variant. If the data type does not match the function, the default initialized data is returned.
IMPORT_C TUid TAiwVariant::AsTUid  )  const
 

Returns the value held by this variant.

Returns:
The value held by this variant. If the data type does not match the function, the default initialized data is returned.
IMPORT_C TBool TAiwVariant::Get RFile &  aValue  )  const
 

Retrieves the value held by this variant.

Parameters:
aValue If this variant's type does not match the parameter type, the parameter will not be modified.
Returns:
ETrue if aValue was set, EFalse if types did not match.
IMPORT_C TBool TAiwVariant::Get TPtrC8 &  aValue  )  const
 

Retrieves the value held by this variant.

Parameters:
aValue If this variant's type does not match the parameter type, the parameter will not be modified.
Returns:
ETrue if aValue was set, EFalse if types did not match.
IMPORT_C TBool TAiwVariant::Get TTime &  aValue  )  const
 

Retrieves the value held by this variant.

Parameters:
aValue If this variant's type does not match the parameter type, the parameter will not be modified.
Returns:
ETrue if aValue was set, EFalse if types did not match.
IMPORT_C TBool TAiwVariant::Get TPtrC &  aValue  )  const
 

Retrieves the value held by this variant.

Parameters:
aValue If this variant's type does not match the parameter type, the parameter will not be modified.
Returns:
ETrue if aValue was set, EFalse if types did not match.
IMPORT_C TBool TAiwVariant::Get TUid &  aValue  )  const
 

Retrieves the value held by this variant.

Parameters:
aValue If this variant's type does not match the parameter type, the parameter will not be modified.
Returns:
ETrue if aValue was set, EFalse if types did not match.
IMPORT_C TBool TAiwVariant::Get TInt32 &  aValue  )  const
 

Retrieves the value held by this variant.

Parameters:
aValue If this variant's type does not match the parameter type, the parameter will not be modified.
Returns:
ETrue if aValue was set, EFalse if types did not match.
TBool TAiwVariant::IsEmpty  )  const [inline]
 

Returns ETrue if this variant is empty (it does not hold any value).

TAiwVariant& TAiwVariant::operator= const RFile &  aValue  )  [inline]
 

Assignment operator for the variant.

Parameters:
aValue The source object.
TAiwVariant& TAiwVariant::operator= const TDesC8 &  aValue  )  [inline]
 

Assignment operator for the variant.

Parameters:
aValue The source object.
TAiwVariant& TAiwVariant::operator= const HBufC *  aValue  )  [inline]
 

Assignment operator for the variant.

Parameters:
aValue The source object.
TAiwVariant& TAiwVariant::operator= const TDesC &  aValue  )  [inline]
 

Assignment operator for the variant.

Parameters:
aValue The source object.
TAiwVariant& TAiwVariant::operator= TInt32  aValue  )  [inline]
 

Assignment operator for the variant.

Parameters:
aValue The source object.
TAiwVariant& TAiwVariant::operator= const TUid &  aValue  )  [inline]
 

Assignment operator for the variant.

Parameters:
aValue The source object.
TAiwVariant& TAiwVariant::operator= const TTime &  aValue  )  [inline]
 

Assignment operator for the variant.

Parameters:
aValue The source object.
IMPORT_C TAiwVariant& TAiwVariant::operator= const TAiwVariant aValue  ) 
 

Assignment operator.

Does not take ownership of data.

Parameters:
aValue The source object.
IMPORT_C void TAiwVariant::Reset  ) 
 

Deletes possibly set value and resets this variant to empty.

Postcondition:
IsEmpty()
IMPORT_C void TAiwVariant::Set const RFile &  aValue  ) 
 

Sets RFile file handle to this variant.

Parameters:
aValue File handle for this variant object to hold.
Postcondition:
*this == aValue
IMPORT_C void TAiwVariant::Set const TDesC8 &  aValue  ) 
 

Sets constant 8-bit text reference to this variant.

Parameters:
aValue Text value for this variant object to hold.
Postcondition:
*this == aValue
void TAiwVariant::Set const HBufC *  aValue  )  [inline]
 

Sets constant text reference to this variant.

Parameters:
aValue Text value for this variant object to hold. Ownership is not taken.
IMPORT_C void TAiwVariant::Set const TDesC &  aValue  ) 
 

Sets constant text reference to this variant.

Parameters:
aValue Text value for this variant object to hold.
Postcondition:
*this == aValue
IMPORT_C void TAiwVariant::Set const TTime &  aValue  ) 
 

Sets date and time value to this variant.

The previous value is overwritten.

Parameters:
aValue Value for this variant object to hold.
Postcondition:
*this == aValue
IMPORT_C void TAiwVariant::Set const TUid &  aValue  ) 
 

Sets unique ID value to this variant.

The previous value is overwritten.

Parameters:
aValue Value for this variant object to hold.
Postcondition:
*this == aValue
IMPORT_C void TAiwVariant::Set TInt32  aValue  ) 
 

Sets integer value to this variant.

The previous value is overwritten.

Parameters:
aValue Value for this variant object to hold.
Postcondition:
*this == aValue
TVariantTypeId TAiwVariant::TypeId  )  const [inline]
 

Returns the type id of data this variant object is holding.


Friends And Related Function Documentation

IMPORT_C TBool operator== const TAiwVariant aLhs,
const TAiwVariant aRhs
[friend]
 

Returns ETrue if two variants are equal.

Parameters:
aLhs Left hand side.
aRhs Right hand side.
Returns:
ETrue if equal, EFalse otherwise.
friend class TAiwGenericParam [friend]
 

TAiwGenericParam needs access to private streaming and copying methods.


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

Copyright © Nokia Corporation 2001-2008
Back to top