Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

Value Class Reference

#include <tntdb/bits/value.h>

List of all members.
bool isNull () const
 return true, when value is null
bool getBool () const
 return true, when value represents boolean true.
int getInt () const
 tries to convert value into an int.
unsigned getUnsigned () const
 tries to convert value into an unsigned.
int32_t getInt32 () const
 tries to convert value into an int32_t.
uint32_t getUnsigned32 () const
 tries to convert value into an uint32_t.
int64_t getInt64 () const
 tries to convert value into an int64_t.
uint64_t getUnsigned64 () const
 tries to convert value into an uint64_t.
Decimal getDecimal () const
 tries to convert value into a Decimal.
float getFloat () const
 tries to convert value into an float.
double getDouble () const
 tries to convert value into an double.
char getChar () const
 returns the first character of the texte-representation.
std::string getString () const
 returns the value as a string.
void getString (std::string &ret) const
Blob getBlob () const
void getBlob (Blob &blob) const
 Returns the value as a blob.
Date getDate () const
 returns the value as a Date.
Time getTime () const
 returns the value as a Time.
Datetime getDatetime () const
 returns the value as a Datetime.
 operator bool () const
 operator int () const
 operator unsigned () const
 operator int64_t () const
 operator uint64_t () const
 operator Decimal () const
 operator float () const
 operator double () const
 operator char () const
 operator std::string () const
 operator Blob () const
 operator Date () const
 operator Time () const
 operator Datetime () const

Public Member Functions

 Value (IValue *value=0)
bool operator! () const
 Returns true, if this class is not connected to a actual statement.
const IValuegetImpl () const
 Returns the actual implementation-class.


Detailed Description

The class Value represents a value, which is fetched from the database.

Member Function Documentation

bool isNull (  )  const

Explicit data-access. The get-methods return the value in the requested type. If the value can't be converted to the requested type, a exception of type tntdb::TypeError is thrown.

Referenced by Row::isNull().

void getString ( std::string &  ret  )  const

fills the passed string with the value. this might be slightly more efficient than just returning a new string since one copy is saved.

Blob getBlob (  )  const

Returns the value as a blob. This is more or less an alias to getString just to stress, that the data is truly binary and not some text value.

operator bool (  )  const

Make Value-objects implicit convertable. This class defines implicit convert-operators to convert the value automatically to different types. They are identical with the corresponding get-methods.

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6