Otclient  14/8/2020
DBResult Class Reference

#include <database.h>

Inheritance diagram for DBResult:
Collaboration diagram for DBResult:

Public Member Functions

 DBResult ()
 
virtual ~DBResult ()
 
virtual int32 getDataInt (const std::string &)
 
virtual int64 getDataLong (const std::string &)
 
virtual std::string getDataString (const std::string &)
 
virtual const char * getDataStream (const std::string &, uint64 &)
 
virtual void free ()
 
virtual bool next ()
 
virtual int getRowCount ()
 
- Public Member Functions inherited from LuaObject
 LuaObject ()
 
virtual ~LuaObject ()
 
template<typename T >
void connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false)
 
template<typename... T>
int luaCallLuaField (const std::string &field, const T &... args)
 
template<typename R , typename... T>
callLuaField (const std::string &field, const T &... args)
 
template<typename... T>
void callLuaField (const std::string &field, const T &... args)
 
bool hasLuaField (const std::string &field)
 Returns true if the lua field exists. More...
 
template<typename T >
void setLuaField (const std::string &key, const T &value)
 Sets a field in this lua object. More...
 
template<typename T >
getLuaField (const std::string &key)
 Gets a field from this lua object. More...
 
void releaseLuaFieldsTable ()
 Release fields table reference. More...
 
void luaSetField (const std::string &key)
 Sets a field from this lua object, the value must be on the stack. More...
 
void luaGetField (const std::string &key)
 Gets a field from this lua object, the result is pushed onto the stack. More...
 
void luaGetMetatable ()
 Get object's metatable. More...
 
void luaGetFieldsTable ()
 Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More...
 
int getUseCount ()
 
std::string getClassName ()
 Returns the derived class name, its the same name used in Lua. More...
 
LuaObjectPtr asLuaObject ()
 
void operator= (const LuaObject &)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Detailed Description

Definition at line 153 of file database.h.

Constructor & Destructor Documentation

◆ DBResult()

DBResult::DBResult ( )
inline

Definition at line 156 of file database.h.

◆ ~DBResult()

virtual DBResult::~DBResult ( )
inlinevirtual

Definition at line 157 of file database.h.

Member Function Documentation

◆ free()

virtual void DBResult::free ( )
inlinevirtual

Result freeing

Reimplemented in MySQLResult.

Definition at line 185 of file database.h.

Here is the caller graph for this function:

◆ getDataInt()

virtual int32 DBResult::getDataInt ( const std::string &  )
inlinevirtual

Get the Integer value of a field in database

Returns
The Integer value of the selected field and row
Parameters
sThe name of the field

Reimplemented in MySQLResult.

Definition at line 163 of file database.h.

Here is the caller graph for this function:

◆ getDataLong()

virtual int64 DBResult::getDataLong ( const std::string &  )
inlinevirtual

Get the Long value of a field in database

Returns
The Long value of the selected field and row
Parameters
sThe name of the field

Reimplemented in MySQLResult.

Definition at line 169 of file database.h.

Here is the caller graph for this function:

◆ getDataStream()

virtual const char* DBResult::getDataStream ( const std::string &  ,
uint64  
)
inlinevirtual

Get the blob of a field in database

Returns
a PropStream that is initiated with the blob data field, if not exist it returns NULL.
Parameters
sThe name of the field

Reimplemented in MySQLResult.

Definition at line 181 of file database.h.

◆ getDataString()

virtual std::string DBResult::getDataString ( const std::string &  )
inlinevirtual

Get the String of a field in database

Returns
The String of the selected field and row
Parameters
sThe name of the field

Reimplemented in MySQLResult.

Definition at line 175 of file database.h.

Here is the caller graph for this function:

◆ getRowCount()

virtual int DBResult::getRowCount ( )
inlinevirtual

Returned the number of rows from result

Returns
integer value of row amount, 0 if result is empty.

Reimplemented in MySQLResult.

Definition at line 195 of file database.h.

Here is the caller graph for this function:

◆ next()

virtual bool DBResult::next ( )
inlinevirtual

Moves to next result in set

Returns
true if moved, false if there are no more results.

Reimplemented in MySQLResult.

Definition at line 190 of file database.h.

Here is the caller graph for this function:

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