20 static SQLINTEGER
GetSize(SQLSMALLINT type);
63 std::wstring
GetWStringValue()
const {
return std::wstring(reinterpret_cast<const wchar_t *>(& *
_buffer.begin())); }
85 DATE_STRUCT
GetDate()
const {
return * (DATE_STRUCT *) & *
_buffer.begin(); }
87 TIME_STRUCT
GetTime()
const {
return * (TIME_STRUCT *) & *
_buffer.begin(); }
int GetShortValue() const
get a value of type short (SQL_SMALLINT)
Definition: Buffer.h:69
wchar_t GetVarCharValue() const
get a single unicode character value
Definition: Buffer.h:83
bool GetBoolValue() const
get a value of type bool (SQL_BIT)
Definition: Buffer.h:71
char GetCharValue() const
get a single character value
Definition: Buffer.h:81
SQLSMALLINT _type
column type, eg. SQL_C_CHAR
Definition: Buffer.h:14
std::string ToString() const
convert the value to a string regardless of its internal type
Definition: Buffer.cpp:159
LONGLONG GetLongLongValue() const
get a value of type longlong (SQL_BIGINT, etc.)
Definition: Buffer.h:73
std::vector< char > _buffer
the data buffer
Definition: Buffer.h:18
static const SQLINTEGER INVALID_SIZE
invalid data size
Definition: Buffer.h:23
virtual ~ODBCBuffer()
Definition: Buffer.cpp:153
TIMESTAMP_STRUCT GetTimeStamp() const
get a timestamp structure
Definition: Buffer.h:89
float GetFloatValue() const
get the value of type float
Definition: Buffer.h:79
GUID GetGUIDValue() const
get a value of type uniqueidentifier
Definition: Buffer.h:75
DATE_STRUCT GetDate() const
get a date structure
Definition: Buffer.h:85
int GetIntValue() const
get a value of type integer (SQL_INTEGER, SQL_DECIMAL, etc.)
Definition: Buffer.h:67
virtual void operator=(const ODBCBuffer &)
copy operator, data will be copied
Definition: Buffer.cpp:146
int GetBufferSize() const
get the size of the buffer
Definition: Buffer.h:29
TIME_STRUCT GetTime() const
get a time structure
Definition: Buffer.h:87
std::string GetStringValue() const
get the data as a null-terminated string, disregarding fetched data size
Definition: Buffer.h:61
double GetDoubleValue() const
get a value of type double
Definition: Buffer.h:77
const std::vector< char > & GetValue() const
get the raw data buffer
Definition: Buffer.h:65
SQLINTEGER GetDataSize() const
get the size of the data
Definition: Buffer.h:27
static SQLINTEGER GetSize(SQLSMALLINT type)
returns the size for default types, zero otherwise
Definition: Buffer.cpp:291
SQLINTEGER _size
the data size after a Fetch
Definition: Buffer.h:16
std::wstring GetWStringValue() const
get the data as a null-terminated unicode string, disregarding fetched data size
Definition: Buffer.h:63
ODBCBuffer()
constructors
Definition: Buffer.cpp:6
std::wstring ToWString() const
convert the value to a unicode string regardless of its internal type
Definition: Buffer.cpp:225
An ODBC column.
Definition: Buffer.h:10
static SQLSMALLINT StringToSQLType(const std::wstring &type)
translate a string to its SQL type
Definition: Buffer.cpp:365
SQLSMALLINT GetType() const
get the type of data
Definition: Buffer.h:31
static std::wstring SQLTypeToString(SQLSMALLINT type)
translate a SQL type to its string representation
Definition: Buffer.cpp:378