TreeFrogFramework  1.18
Public Member Functions | List of all members
TRedis Class Reference

#include <tredis.h>

Public Member Functions

 TRedis ()
 
 TRedis (const TRedis &other)
 
virtual ~TRedis ()
 
bool isOpen () const
 
bool exists (const QByteArray &key)
 
QByteArray get (const QByteArray &key)
 
bool set (const QByteArray &key, const QByteArray &value)
 
bool setEx (const QByteArray &key, const QByteArray &value, int seconds)
 
QByteArray getSet (const QByteArray &key, const QByteArray &value)
 
QString gets (const QByteArray &key)
 
bool sets (const QByteArray &key, const QString &value)
 
bool setsEx (const QByteArray &key, const QString &value, int seconds)
 
QString getsSets (const QByteArray &key, const QString &value)
 
bool del (const QByteArray &key)
 
int del (const QList< QByteArray > &keys)
 
int rpush (const QByteArray &key, const QList< QByteArray > &values)
 
int lpush (const QByteArray &key, const QList< QByteArray > &values)
 
QList< QByteArray > lrange (const QByteArray &key, int start, int end)
 
QByteArray lindex (const QByteArray &key, int index)
 
int rpushs (const QByteArray &key, const QStringList &values)
 
int lpushs (const QByteArray &key, const QStringList &values)
 
QStringList lranges (const QByteArray &key, int start, int end)
 
QString lindexs (const QByteArray &key, int index)
 
int llen (const QByteArray &key)
 

Detailed Description

The TRedis class provides a means of operating a Redis system.

Constructor & Destructor Documentation

TRedis::TRedis ( )

Constructs a TRedis object.

TRedis::TRedis ( const TRedis other)

Copy constructor.

virtual TRedis::~TRedis ( )
inlinevirtual

Member Function Documentation

bool TRedis::del ( const QByteArray &  key)

Removes the specified key.

A key is ignored if it does not exist.

int TRedis::del ( const QList< QByteArray > &  keys)

Removes the specified keys.

A key is ignored if it does not exist.

bool TRedis::exists ( const QByteArray &  key)

Returns true if the key exists; otherwise returns false.

QByteArray TRedis::get ( const QByteArray &  key)

Returns the value associated with the key; otherwise returns an empty bit array.

QString TRedis::gets ( const QByteArray &  key)
inline

Returns the string associated with the key; otherwise returns a null string.

QByteArray TRedis::getSet ( const QByteArray &  key,
const QByteArray &  value 
)

Atomically sets the key to the value and returns the old value stored at the key.

QString TRedis::getsSets ( const QByteArray &  key,
const QString &  value 
)
inline

Atomically sets the key to the string value and returns the old string value stored at the key.

bool TRedis::isOpen ( ) const

Returns true if the Redis connection is open; otherwise returns false.

QByteArray TRedis::lindex ( const QByteArray &  key,
int  index 
)

Returns the element at the index in the list stored at the key.

QString TRedis::lindexs ( const QByteArray &  key,
int  index 
)
inline

Returns the string at the index in the list stored at the key.

int TRedis::llen ( const QByteArray &  key)

Returns the length of the list stored at the key.

int TRedis::lpush ( const QByteArray &  key,
const QList< QByteArray > &  values 
)

Inserts all the values at the tail of the list stored at the key.

Returns the length of the list after the push operation.

int TRedis::lpushs ( const QByteArray &  key,
const QStringList &  values 
)
inline

Inserts all the string values at the tail of the list stored at the key.

Returns the length of the list after the push operation.

QList< QByteArray > TRedis::lrange ( const QByteArray &  key,
int  start,
int  end = -1 
)

Returns the specified elements of the list stored at the key.

QStringList TRedis::lranges ( const QByteArray &  key,
int  start,
int  end = -1 
)
inline

Returns the specified elements of the list stored at the key.

int TRedis::rpush ( const QByteArray &  key,
const QList< QByteArray > &  values 
)

Inserts all the values at the tail of the list stored at the key.

Returns the length of the list after the push operation.

int TRedis::rpushs ( const QByteArray &  key,
const QStringList &  values 
)
inline

Inserts all the string values at the tail of the list stored at the key.

Returns the length of the list after the push operation.

bool TRedis::set ( const QByteArray &  key,
const QByteArray &  value 
)

Sets the key to hold the value.

If the key already holds a value, it is overwritten, regardless of its type.

bool TRedis::setEx ( const QByteArray &  key,
const QByteArray &  value,
int  seconds 
)

Sets the key to hold the value and set the key to timeout after a given number of seconds.

bool TRedis::sets ( const QByteArray &  key,
const QString &  value 
)
inline

Sets the key to hold the string value.

If the key already holds a value, it is overwritten, regardless of its type.

bool TRedis::setsEx ( const QByteArray &  key,
const QString &  value,
int  seconds 
)
inline

Sets the key to hold the string value and set the key to timeout after a given number of seconds.


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