Various Cleanups (shared/Database/)

This commit is contained in:
Schmoozerd 2012-07-19 21:57:32 +02:00
parent 9753625fd1
commit c334cd5ea4
25 changed files with 508 additions and 508 deletions

View file

@ -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;
};