mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 14:07:46 +00:00
More formatting and linux stuff
This commit is contained in:
parent
935d1e7382
commit
8ab5012e4d
3 changed files with 5 additions and 3 deletions
|
@ -4,6 +4,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <clocale>
|
#include <clocale>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,13 +16,13 @@ Core::Db::ResultSet::ResultSet( MYSQL_RES *res, Core::Db::Statement *par )
|
||||||
m_pStmt = par;
|
m_pStmt = par;
|
||||||
m_rowPosition = 1;
|
m_rowPosition = 1;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < m_numFields; ++i)
|
for( uint32_t i = 0; i < m_numFields; ++i )
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string fieldName( getFieldMeta(i + 1)->name );
|
std::string fieldName( getFieldMeta(i + 1)->name );
|
||||||
|
|
||||||
std::transform( fieldName.begin(), fieldName.end(), fieldName.begin(),
|
std::transform( fieldName.begin(), fieldName.end(), fieldName.begin(),
|
||||||
[](unsigned char c){ return std::toupper(c); } );
|
[]( unsigned char c ){ return std::toupper(c); } );
|
||||||
|
|
||||||
m_fieldNameToIndex[fieldName] = i;
|
m_fieldNameToIndex[fieldName] = i;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ Core::Db::ResultSet::~ResultSet()
|
||||||
mysql_free_result( m_pRes );
|
mysql_free_result( m_pRes );
|
||||||
}
|
}
|
||||||
|
|
||||||
MYSQL_FIELD* Core::Db::ResultSet::getFieldMeta( unsigned int columnIndex ) const
|
MYSQL_FIELD* Core::Db::ResultSet::getFieldMeta( uint32_t columnIndex ) const
|
||||||
{
|
{
|
||||||
return mysql_fetch_field_direct( m_pRes, columnIndex - 1 );
|
return mysql_fetch_field_direct( m_pRes, columnIndex - 1 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "mysql_util.h"
|
#include "mysql_util.h"
|
||||||
#include "DataType.h"
|
#include "DataType.h"
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
long double Util::strtold(const char *nptr, char **endptr)
|
long double Util::strtold(const char *nptr, char **endptr)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue