mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 04:37:02 +00:00
Various Cleanups (shared/Database/)
This commit is contained in:
parent
9753625fd1
commit
c334cd5ea4
25 changed files with 508 additions and 508 deletions
|
|
@ -33,15 +33,15 @@ class MANGOS_DLL_SPEC QueryResult
|
|||
|
||||
virtual bool NextRow() = 0;
|
||||
|
||||
Field *Fetch() const { return mCurrentRow; }
|
||||
Field* Fetch() const { return mCurrentRow; }
|
||||
|
||||
const Field & operator [] (int index) const { return mCurrentRow[index]; }
|
||||
const Field& operator [](int index) const { return mCurrentRow[index]; }
|
||||
|
||||
uint32 GetFieldCount() const { return mFieldCount; }
|
||||
uint64 GetRowCount() const { return mRowCount; }
|
||||
|
||||
protected:
|
||||
Field *mCurrentRow;
|
||||
Field* mCurrentRow;
|
||||
uint32 mFieldCount;
|
||||
uint64 mRowCount;
|
||||
};
|
||||
|
|
@ -56,20 +56,20 @@ class MANGOS_DLL_SPEC QueryNamedResult
|
|||
|
||||
// compatible interface with QueryResult
|
||||
bool NextRow() { return mQuery->NextRow(); }
|
||||
Field *Fetch() const { return mQuery->Fetch(); }
|
||||
Field* Fetch() const { return mQuery->Fetch(); }
|
||||
uint32 GetFieldCount() const { return mQuery->GetFieldCount(); }
|
||||
uint64 GetRowCount() const { return mQuery->GetRowCount(); }
|
||||
Field const& operator[] (int index) const { return (*mQuery)[index]; }
|
||||
Field const& operator[](int index) const { return (*mQuery)[index]; }
|
||||
|
||||
// named access
|
||||
Field const& operator[] (const std::string &name) const { return mQuery->Fetch()[GetField_idx(name)]; }
|
||||
Field const& operator[](const std::string& name) const { return mQuery->Fetch()[GetField_idx(name)]; }
|
||||
QueryFieldNames const& GetFieldNames() const { return mFieldNames; }
|
||||
|
||||
uint32 GetField_idx(const std::string &name) const
|
||||
uint32 GetField_idx(const std::string& name) const
|
||||
{
|
||||
for(size_t idx = 0; idx < mFieldNames.size(); ++idx)
|
||||
for (size_t idx = 0; idx < mFieldNames.size(); ++idx)
|
||||
{
|
||||
if(mFieldNames[idx] == name)
|
||||
if (mFieldNames[idx] == name)
|
||||
return idx;
|
||||
}
|
||||
MANGOS_ASSERT(false && "unknown field name");
|
||||
|
|
@ -77,7 +77,7 @@ class MANGOS_DLL_SPEC QueryNamedResult
|
|||
}
|
||||
|
||||
protected:
|
||||
QueryResult *mQuery;
|
||||
QueryResult* mQuery;
|
||||
QueryFieldNames mFieldNames;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue