Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TVVariant Class Reference

#include </home/clem/local/src/opie/noncore/apps/tableviewer/db/common.h>

Collaboration diagram for TVVariant:

Collaboration graph
[legend]
List of all members.

Public Types

enum  KeyType {
  Invalid = 0, Int, String, Date,
  Time
}

Public Member Functions

 TVVariant ()
 ~TVVariant ()
 TVVariant (const TVVariant &)
 TVVariant (QDataStream &)
 TVVariant (const QString &)
 TVVariant (const int)
 TVVariant (const QDate &)
 TVVariant (const QTime &)
TVVariantoperator= (const TVVariant &)
bool operator== (const TVVariant &) const
bool operator!= (const TVVariant &) const
bool operator< (const TVVariant &) const
bool operator> (const TVVariant &) const
bool closer (TVVariant, TVVariant)
bool close (TVVariant)
KeyType type () const
const QString typeName () const
int numTypes () const
const QString typeName (KeyType) const
bool canCast (KeyType) const
bool isValid () const
void clear ()
const QString toString () const
const QDate toDate () const
const QTime toTime () const
int toInt () const
QStringasString ()
QDateasDate ()
QTimeasTime ()
int & asInt ()
void load (QDataStream &)
void save (QDataStream &) const

Static Public Member Functions

static const QString typeToName (KeyType typ)
static KeyType nameToType (const QString &)

Private Member Functions

void detach ()

Private Attributes

TVVariantPrivated

Detailed Description

A way of abstracting void * and keeping information on the keytypes and behaviours in one place

Definition at line 53 of file common.h.


Member Enumeration Documentation

enum TVVariant::KeyType
 

Enumeration values:
Invalid 
Int 
String 
Date 
Time 

Definition at line 56 of file common.h.


Constructor & Destructor Documentation

TVVariant::TVVariant  ) 
 

Definition at line 162 of file common.cpp.

References d.

TVVariant::~TVVariant  ) 
 

Definition at line 167 of file common.cpp.

References d, and QShared::deref().

TVVariant::TVVariant const TVVariant  ) 
 

Definition at line 173 of file common.cpp.

References d.

TVVariant::TVVariant QDataStream  ) 
 

Definition at line 179 of file common.cpp.

References d.

TVVariant::TVVariant const QString  ) 
 

Definition at line 185 of file common.cpp.

References d, String, TVVariantPrivate::typ, and TVVariantPrivate::value.

TVVariant::TVVariant const   int  ) 
 

Definition at line 206 of file common.cpp.

References d, Int, TVVariantPrivate::typ, and TVVariantPrivate::value.

TVVariant::TVVariant const QDate  ) 
 

Definition at line 192 of file common.cpp.

References d, Date, TVVariantPrivate::typ, and TVVariantPrivate::value.

TVVariant::TVVariant const QTime  ) 
 

Definition at line 199 of file common.cpp.

References d, Time, TVVariantPrivate::typ, and TVVariantPrivate::value.


Member Function Documentation

QDate& TVVariant::asDate  ) 
 

Referenced by DataElem::setField().

int & TVVariant::asInt  ) 
 

Definition at line 464 of file common.cpp.

References d.

Referenced by DataElem::setField().

QString& TVVariant::asString  ) 
 

Referenced by DataElem::setField().

QTime& TVVariant::asTime  ) 
 

Referenced by DataElem::setField().

bool TVVariant::canCast KeyType  t  )  const
 

valid cast is anything to String same to same

Definition at line 479 of file common.cpp.

References d, Date, FALSE, Int, String, Time, TRUE, and TVVariantPrivate::typ.

void TVVariant::clear  ) 
 

Definition at line 240 of file common.cpp.

References TVVariantPrivate::clear(), QShared::count, d, and QShared::deref().

bool TVVariant::close TVVariant  n  ) 
 

True if n is close to this

Definition at line 648 of file common.cpp.

References Date, FALSE, Int, Invalid, QString::startsWith(), String, Time, toString(), TRUE, and type().

Referenced by DataElem::closer().

bool TVVariant::closer TVVariant  n,
TVVariant  o
 

True if n is closer to this than o

Definition at line 559 of file common.cpp.

References QString::compare(), d, Date, QDate::daysTo(), FALSE, Int, Invalid, QTime::msecsTo(), QString::startsWith(), String, Time, toDate(), toInt(), toString(), toTime(), TRUE, TVVariantPrivate::typ, and type().

Referenced by DataElem::closer().

void TVVariant::detach  )  [private]
 

Definition at line 226 of file common.cpp.

References QShared::count, d, and QShared::deref().

bool TVVariant::isValid  )  const [inline]
 

Definition at line 137 of file common.h.

References d, Invalid, and TVVariantPrivate::typ.

Referenced by DataElem::closer(), and DataElem::setField().

void TVVariant::load QDataStream  ) 
 

Definition at line 284 of file common.cpp.

References d, Date, Int, Invalid, oendl, ofatal, String, t, Time, TVVariantPrivate::typ, TVVariantPrivate::value, and Opie::MM::x.

Referenced by operator>>().

TVVariant::KeyType TVVariant::nameToType const QString  )  [static]
 

Definition at line 270 of file common.cpp.

References Date, Int, Invalid, qstrcmp(), String, and Time.

Referenced by DBXmlHandler::startElement().

int TVVariant::numTypes  )  const [inline]
 

Definition at line 142 of file common.h.

bool TVVariant::operator!= const TVVariant  )  const
 

Definition at line 517 of file common.cpp.

bool TVVariant::operator< const TVVariant  )  const
 

Definition at line 522 of file common.cpp.

References d, Date, FALSE, Int, Invalid, String, Time, toDate(), toInt(), toString(), toTime(), and TVVariantPrivate::typ.

TVVariant & TVVariant::operator= const TVVariant  ) 
 

Definition at line 213 of file common.cpp.

References d, QShared::deref(), and QShared::ref().

bool TVVariant::operator== const TVVariant  )  const
 

Definition at line 499 of file common.cpp.

References d, Date, FALSE, Int, Invalid, String, Time, toDate(), toInt(), toString(), toTime(), and TVVariantPrivate::typ.

bool TVVariant::operator> const TVVariant  )  const
 

Definition at line 540 of file common.cpp.

References d, Date, FALSE, Int, Invalid, String, Time, toDate(), toInt(), toString(), toTime(), and TVVariantPrivate::typ.

void TVVariant::save QDataStream  )  const
 

Definition at line 327 of file common.cpp.

References d, Date, Int, Invalid, String, Time, TVVariantPrivate::typ, type(), and TVVariantPrivate::value.

Referenced by operator<<().

const QDate TVVariant::toDate  )  const
 

Definition at line 408 of file common.cpp.

References d, Date, QDate::isValid(), parseNextNumber(), String, toString(), TVVariantPrivate::typ, and TVVariantPrivate::value.

Referenced by closer(), operator<(), operator==(), operator>(), and TVEditView::setData().

int TVVariant::toInt  )  const
 

Definition at line 395 of file common.cpp.

References d, Int, parseNextNumber(), String, TVVariantPrivate::typ, and TVVariantPrivate::value.

Referenced by closer(), operator<(), operator==(), operator>(), and TVEditView::setData().

const QString TVVariant::toString  )  const
 

Definition at line 376 of file common.cpp.

References d, Date, Int, Invalid, QString::null, QString::number(), String, Time, TVVariantPrivate::typ, and TVVariantPrivate::value.

Referenced by close(), closer(), DataElem::contains(), DataElem::endsWith(), operator<(), operator==(), operator>(), TVEditView::setData(), DataElem::startsWith(), toDate(), toTime(), and TVFilterView::updateTerm().

const QTime TVVariant::toTime  )  const
 

Definition at line 432 of file common.cpp.

References d, QTime::isValid(), parseNextNumber(), String, Time, toString(), TVVariantPrivate::typ, and TVVariantPrivate::value.

Referenced by closer(), operator<(), operator==(), operator>(), and TVEditView::setData().

TVVariant::KeyType TVVariant::type  )  const [inline]
 

Definition at line 132 of file common.h.

References d, and TVVariantPrivate::typ.

Referenced by close(), closer(), DataElem::contains(), DataElem::endsWith(), DataElem::equalTo(), DataElem::lessThan(), DataElem::moreThan(), save(), DataElem::startsWith(), and Key::type().

const QString TVVariant::typeName KeyType   )  const
 

const QString TVVariant::typeName  )  const
 

Definition at line 235 of file common.cpp.

References d, TVVariantPrivate::typ, and typeToName().

const QString TVVariant::typeToName KeyType  typ  )  [static]
 

Definition at line 252 of file common.cpp.

References Date, Int, Invalid, String, and Time.

Referenced by DBXml::saveSource(), TVKEListViewItem::text(), TVKeyEdit::TVKeyEdit(), and typeName().


Member Data Documentation

TVVariantPrivate* TVVariant::d [private]
 

Definition at line 111 of file common.h.

Referenced by canCast(), clear(), closer(), detach(), isValid(), load(), operator<(), operator=(), operator==(), operator>(), save(), toDate(), toInt(), toString(), toTime(), TVVariant(), type(), typeName(), and ~TVVariant().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:54:31 2005 for OPIE by  doxygen 1.4.2