VarTuple Class Reference

[Kpvm Index] [Kpvm Hierarchy] [Headers]


VarTuple is the class-representation of one of the Serialize objects' attributes (variables). More...

#include <vartuple.h>

Inherits: QObject

Public Members

Private Members


Detailed Description

It provides you the basic functions for manipulating/retrieving the VarTag (a descriptive name of the variable), the variables value and type.


VarTuple(QObject *parent=0, const char *name=0) [public]

different Constructors for all VarTypes, VarTag only or totally empty VarTuple

QString tag() const [public]

extracts the VarTag-Field This is useful for building a hashtable (qdict) on all variables

Returns:
the VarTag-Field

enum VarType (UNKNOWN=0, INT=1, LONG=2, STRING=3, FLOAT=4, DOUBLE=5) [public]

these are the known types of variables.

If you think, some type is missing, try to build your type with multipe base-types from VarType or, if you think a very common type is missing, just send me an email! :)

VarType type() const [public]

extracts the VarType-Field

Returns:
the VarType-Field as a VarTuple::VarType enum

QString valueToString() const [public]

extracts the Varibles value and returns it (ignoring its type) as a QString.

Returns:
the Value-Field as a QString

void setValue(int var) [public]

sets the internal Value and Type of this VarTuple-object according to the given var

Parameters:
var is the variable to set. The type is detected automatically.

void storeValueTo(int &var) [public]

sets the internal Value and Type of this VarTuple-object according to the given var

Parameters:
var is the variable to write in. The type is detected automatically. If not, you have to store it into a known type and then convert it by normal ways. Don't use casts, as storeValueTo can't store the value back to a casted value!

QString data() const [public]

generates a QString looking like VarTag:VarType:Value.

With data you can easily build all needed variable-Tuples for VarTuple::objState

Returns:
the VarTag:VarType:Value QString

void setData(QString varTuple) [public]

sets the Contents according to the given QString looking like VarTag:VarType:Value

With setData you can easily retrieve variable-Tuples from serialized objects for Serialize setObjState

Parameters:
varTuple the VarTag:VarType:Value QString

  • Author: Michael Kropfberger <michael.kropfberger@gmx.net>
  • Documentation generated by mike@kermit on Mon Jun 29 21:55:33 MEST 1998
Kdoc