Skip to content

Commit

Permalink
update doxygen comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
aoym committed Mar 19, 2016
1 parent 24a2eb1 commit 5259df5
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 18 deletions.
4 changes: 3 additions & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = TreeFrog Framework
PROJECT_NUMBER = 1.9
PROJECT_NUMBER = 1.11
PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = doc
Expand Down Expand Up @@ -102,6 +102,7 @@ FILE_PATTERNS =
RECURSIVE = NO
EXCLUDE = src/test \
src/trash \
src/tpreforkapplicationserver.h \
src/directcontroller.h \
src/tabstractlogstream.h \
src/taccesslog.h \
Expand Down Expand Up @@ -143,6 +144,7 @@ EXCLUDE = src/test \
src/tmongocursor.h \
src/tmongomapper.h \
src/tmongoobject.h \
src/tredisdriver.h \
src/tcriteriamongoconverter.h \
src/thttpbuffer.h \
src/thttpsendbuffer.h \
Expand Down
2 changes: 1 addition & 1 deletion defaults/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ EnableHttpMethodOverride=false

# Sets the timeout in seconds during which a keep-alive HTTP connection
# will stay open on the server side. The zero value disables keep-alive
# client connections.
# client connections.
HttpKeepAliveTimeout=10

# Forces some libraries to be loaded before all others. It means to set
Expand Down
102 changes: 88 additions & 14 deletions src/tredis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ const TRedisDriver *TRedis::driver() const
#endif
}


/*!
Returns true if the Redis connection is open; otherwise
returns false.
*/
bool TRedis::isOpen() const
{
return (driver()) ? driver()->isOpen() : false;
}


/*!
Returns true if the \a key exists; otherwise returns false.
*/
bool TRedis::exists(const QByteArray &key)
{
if (!driver()) {
Expand All @@ -88,7 +93,10 @@ bool TRedis::exists(const QByteArray &key)
return (res && resp.value(0).toInt() == 1);
}


/*!
Returns the value associated with the \a key; otherwise
returns an empty bit array.
*/
QByteArray TRedis::get(const QByteArray &key)
{
if (!driver()) {
Expand All @@ -101,7 +109,10 @@ QByteArray TRedis::get(const QByteArray &key)
return (res) ? resp.value(0).toByteArray() : QByteArray();
}


/*!
Sets the \a key to hold the \a value. If the key already holds a
value, it is overwritten, regardless of its type.
*/
bool TRedis::set(const QByteArray &key, const QByteArray &value)
{
if (!driver()) {
Expand All @@ -113,7 +124,10 @@ bool TRedis::set(const QByteArray &key, const QByteArray &value)
return driver()->request(command, resp);
}


/*!
Sets the \a key to hold the \a value and set the key to timeout
after a given number of \a seconds.
*/
bool TRedis::setEx(const QByteArray &key, const QByteArray &value, int seconds)
{
if (!driver()) {
Expand All @@ -125,7 +139,10 @@ bool TRedis::setEx(const QByteArray &key, const QByteArray &value, int seconds)
return driver()->request(command, resp);
}


/*!
Atomically sets the \a key to the \a value and returns the old value
stored at the \a key.
*/
QByteArray TRedis::getSet(const QByteArray &key, const QByteArray &value)
{
if (!driver()) {
Expand All @@ -138,15 +155,21 @@ QByteArray TRedis::getSet(const QByteArray &key, const QByteArray &value)
return (res) ? resp.value(0).toByteArray() : QByteArray();
}


/*!
Removes the specified \a key. A key is ignored if it does
not exist.
*/
bool TRedis::del(const QByteArray &key)
{
QList<QByteArray> keys = { key };
int count = del(keys);
return (count == 1);
}


/*!
Removes the specified \a keys. A key is ignored if it does
not exist.
*/
int TRedis::del(const QList<QByteArray> &keys)
{
if (!driver()) {
Expand All @@ -161,7 +184,7 @@ int TRedis::del(const QList<QByteArray> &keys)
}

/*!
Inserts all the \a values at the tail of the list stored at key.
Inserts all the \a values at the tail of the list stored at the \a key.
Returns the length of the list after the push operation.
*/
int TRedis::rpush(const QByteArray &key, const QList<QByteArray> &values)
Expand All @@ -178,7 +201,7 @@ int TRedis::rpush(const QByteArray &key, const QList<QByteArray> &values)
}

/*!
Inserts all the \a values at the tail of the list stored at key.
Inserts all the \a values at the tail of the list stored at the \a key.
Returns the length of the list after the push operation.
*/
int TRedis::lpush(const QByteArray &key, const QList<QByteArray> &values)
Expand All @@ -194,8 +217,10 @@ int TRedis::lpush(const QByteArray &key, const QList<QByteArray> &values)
return (res) ? resp.value(0).toInt() : 0;
}


QList<QByteArray> TRedis::lrange(const QByteArray &key, int start, int end)
/*!
Returns the specified elements of the list stored at the \a key.
*/
QList<QByteArray> TRedis::lrange(const QByteArray &key, int start, int end = -1)
{
if (!driver()) {
return QList<QByteArray>();
Expand All @@ -213,7 +238,9 @@ QList<QByteArray> TRedis::lrange(const QByteArray &key, int start, int end)
return ret;
}


/*!
Returns the element at the \a index in the list stored at the \a key.
*/
QByteArray TRedis::lindex(const QByteArray &key, int index)
{
if (!driver()) {
Expand All @@ -227,7 +254,7 @@ QByteArray TRedis::lindex(const QByteArray &key, int index)
}

/*!
Returns the length of the list stored at key.
Returns the length of the list stored at the \a key.
*/
int TRedis::llen(const QByteArray &key)
{
Expand Down Expand Up @@ -260,3 +287,50 @@ QStringList TRedis::toStringList(const QList<QByteArray> &values)
}
return ret;
}


/*!
\fn QString TRedis::gets(const QByteArray &key)
Returns the string associated with the \a key; otherwise returns a
null string.
*/

/*!
\fn bool TRedis::sets(const QByteArray &key, const QString &value)
Sets the \a key to hold the string \a value. If the key already holds
a value, it is overwritten, regardless of its type.
*/

/*!
\fn bool TRedis::setsEx(const QByteArray &key, const QString &value, int seconds)
Sets the \a key to hold the string \a value and set the key to timeout
after a given number of \a seconds.
*/

/*!
\fn QString TRedis::getsSets(const QByteArray &key, const QString &value)
Atomically sets the \a key to the string \a value and returns the old string
value stored at the \a key.
*/

/*!
\fn int TRedis::rpushs(const QByteArray &key, const QStringList &values);
Inserts all the string \a values at the tail of the list stored at the
\a key. Returns the length of the list after the push operation.
*/

/*!
\fn int TRedis::lpushs(const QByteArray &key, const QStringList &values);
Inserts all the string \a values at the tail of the list stored at the
\a key. Returns the length of the list after the push operation.
*/

/*!
\fn QStringList TRedis::lranges(const QByteArray &key, int start, int end);
Returns the specified elements of the list stored at the \a key.
*/

/*!
\fn QString TRedis::lindexs(const QByteArray &key, int index);
Returns the string at the \a index in the list stored at the \a key.
*/
2 changes: 1 addition & 1 deletion src/tredis.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ inline int TRedis::lpushs(const QByteArray &key, const QStringList &values)
return lpush(key, toByteArrayList(values));
}

inline QStringList TRedis::lranges(const QByteArray &key, int start, int end)
inline QStringList TRedis::lranges(const QByteArray &key, int start, int end = -1)
{
return toStringList(lrange(key, start, end));
}
Expand Down
2 changes: 2 additions & 0 deletions src/tsqljoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/*!
\class TSqlJoin
\brief The TSqlJoin class represents JOIN clause for combination
to a record of other table.
*/


Expand Down
4 changes: 3 additions & 1 deletion src/tsqlormapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,9 @@ inline int TSqlORMapper<T>::removeAll(const TCriteria &cri)
return res ? sqlQuery.numRowsAffected() : -1;
}


/*!
Sets a JOIN clause for \a column to \a join.
*/
template <class T>
template <class C> inline void TSqlORMapper<T>::setJoin(int column, const TSqlJoin<C> &join)
{
Expand Down

0 comments on commit 5259df5

Please sign in to comment.