Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Protected Attributes | List of all members
AppSecInc::Databases::ODBC::ODBCBuffer Class Reference

An ODBC column. More...

#include <Buffer.h>

Inheritance diagram for AppSecInc::Databases::ODBC::ODBCBuffer:
AppSecInc::Databases::ODBC::ODBCColumn AppSecInc::Databases::ODBC::ODBCParameter

Public Member Functions

virtual void operator= (const ODBCBuffer &)
 copy operator, data will be copied More...
 
SQLINTEGER GetDataSize () const
 get the size of the data More...
 
int GetBufferSize () const
 get the size of the buffer More...
 
SQLSMALLINT GetType () const
 get the type of data More...
 
 ODBCBuffer ()
 constructors More...
 
 ODBCBuffer (SQLSMALLINT type, SQLINTEGER size)
 
 ODBCBuffer (const std::wstring &value)
 
 ODBCBuffer (const std::string &value)
 
 ODBCBuffer (const SYSTEMTIME &value)
 
 ODBCBuffer (const GUID &value)
 
 ODBCBuffer (bool value)
 
 ODBCBuffer (int value)
 
 ODBCBuffer (char value)
 
 ODBCBuffer (wchar_t value)
 
 ODBCBuffer (short value)
 
 ODBCBuffer (double value)
 
 ODBCBuffer (float value)
 
 ODBCBuffer (const ODBCBuffer &Buffer)
 
virtual ~ODBCBuffer ()
 
std::string ToString () const
 convert the value to a string regardless of its internal type More...
 
std::wstring ToWString () const
 convert the value to a unicode string regardless of its internal type More...
 
std::string GetStringValue () const
 get the data as a null-terminated string, disregarding fetched data size More...
 
std::wstring GetWStringValue () const
 get the data as a null-terminated unicode string, disregarding fetched data size More...
 
const std::vector< char > & GetValue () const
 get the raw data buffer More...
 
int GetIntValue () const
 get a value of type integer (SQL_INTEGER, SQL_DECIMAL, etc.) More...
 
int GetShortValue () const
 get a value of type short (SQL_SMALLINT) More...
 
bool GetBoolValue () const
 get a value of type bool (SQL_BIT) More...
 
LONGLONG GetLongLongValue () const
 get a value of type longlong (SQL_BIGINT, etc.) More...
 
GUID GetGUIDValue () const
 get a value of type uniqueidentifier More...
 
double GetDoubleValue () const
 get a value of type double More...
 
float GetFloatValue () const
 get the value of type float More...
 
char GetCharValue () const
 get a single character value More...
 
wchar_t GetVarCharValue () const
 get a single unicode character value More...
 
DATE_STRUCT GetDate () const
 get a date structure More...
 
TIME_STRUCT GetTime () const
 get a time structure More...
 
TIMESTAMP_STRUCT GetTimeStamp () const
 get a timestamp structure More...
 

Static Public Member Functions

static std::wstring SQLTypeToString (SQLSMALLINT type)
 translate a SQL type to its string representation More...
 
static SQLSMALLINT StringToSQLType (const std::wstring &type)
 translate a string to its SQL type More...
 

Static Public Attributes

static const SQLINTEGER INVALID_SIZE = 0
 invalid data size More...
 

Static Protected Member Functions

static SQLINTEGER GetSize (SQLSMALLINT type)
 returns the size for default types, zero otherwise More...
 

Protected Attributes

SQLSMALLINT _type
 column type, eg. SQL_C_CHAR More...
 
SQLINTEGER _size
 the data size after a Fetch More...
 
std::vector< char > _buffer
 the data buffer More...
 

Detailed Description

An ODBC column.

Constructor & Destructor Documentation

ODBCBuffer::ODBCBuffer ( )

constructors

ODBCBuffer::ODBCBuffer ( SQLSMALLINT  type,
SQLINTEGER  size 
)

ODBC buffer

Parameters
typeSQL type
sizecolumn size in bytes; specify zero to resize automatically to the default size for the given type
ODBCBuffer::ODBCBuffer ( const std::wstring &  value)
ODBCBuffer::ODBCBuffer ( const std::string &  value)
ODBCBuffer::ODBCBuffer ( const SYSTEMTIME &  value)
ODBCBuffer::ODBCBuffer ( const GUID &  value)
ODBCBuffer::ODBCBuffer ( bool  value)
ODBCBuffer::ODBCBuffer ( int  value)
ODBCBuffer::ODBCBuffer ( char  value)
ODBCBuffer::ODBCBuffer ( wchar_t  value)
ODBCBuffer::ODBCBuffer ( short  value)
ODBCBuffer::ODBCBuffer ( double  value)
ODBCBuffer::ODBCBuffer ( float  value)
ODBCBuffer::ODBCBuffer ( const ODBCBuffer Buffer)
ODBCBuffer::~ODBCBuffer ( )
virtual

Member Function Documentation

bool AppSecInc::Databases::ODBC::ODBCBuffer::GetBoolValue ( ) const
inline

get a value of type bool (SQL_BIT)

int AppSecInc::Databases::ODBC::ODBCBuffer::GetBufferSize ( ) const
inline

get the size of the buffer

char AppSecInc::Databases::ODBC::ODBCBuffer::GetCharValue ( ) const
inline

get a single character value

SQLINTEGER AppSecInc::Databases::ODBC::ODBCBuffer::GetDataSize ( ) const
inline

get the size of the data

DATE_STRUCT AppSecInc::Databases::ODBC::ODBCBuffer::GetDate ( ) const
inline

get a date structure

double AppSecInc::Databases::ODBC::ODBCBuffer::GetDoubleValue ( ) const
inline

get a value of type double

float AppSecInc::Databases::ODBC::ODBCBuffer::GetFloatValue ( ) const
inline

get the value of type float

GUID AppSecInc::Databases::ODBC::ODBCBuffer::GetGUIDValue ( ) const
inline

get a value of type uniqueidentifier

int AppSecInc::Databases::ODBC::ODBCBuffer::GetIntValue ( ) const
inline

get a value of type integer (SQL_INTEGER, SQL_DECIMAL, etc.)

LONGLONG AppSecInc::Databases::ODBC::ODBCBuffer::GetLongLongValue ( ) const
inline

get a value of type longlong (SQL_BIGINT, etc.)

int AppSecInc::Databases::ODBC::ODBCBuffer::GetShortValue ( ) const
inline

get a value of type short (SQL_SMALLINT)

SQLINTEGER ODBCBuffer::GetSize ( SQLSMALLINT  type)
staticprotected

returns the size for default types, zero otherwise

std::string AppSecInc::Databases::ODBC::ODBCBuffer::GetStringValue ( ) const
inline

get the data as a null-terminated string, disregarding fetched data size

TIME_STRUCT AppSecInc::Databases::ODBC::ODBCBuffer::GetTime ( ) const
inline

get a time structure

TIMESTAMP_STRUCT AppSecInc::Databases::ODBC::ODBCBuffer::GetTimeStamp ( ) const
inline

get a timestamp structure

SQLSMALLINT AppSecInc::Databases::ODBC::ODBCBuffer::GetType ( ) const
inline

get the type of data

const std::vector<char>& AppSecInc::Databases::ODBC::ODBCBuffer::GetValue ( ) const
inline

get the raw data buffer

wchar_t AppSecInc::Databases::ODBC::ODBCBuffer::GetVarCharValue ( ) const
inline

get a single unicode character value

std::wstring AppSecInc::Databases::ODBC::ODBCBuffer::GetWStringValue ( ) const
inline

get the data as a null-terminated unicode string, disregarding fetched data size

void ODBCBuffer::operator= ( const ODBCBuffer value)
virtual

copy operator, data will be copied

std::wstring ODBCBuffer::SQLTypeToString ( SQLSMALLINT  type)
static

translate a SQL type to its string representation

SQLSMALLINT ODBCBuffer::StringToSQLType ( const std::wstring &  type)
static

translate a string to its SQL type

std::string ODBCBuffer::ToString ( void  ) const

convert the value to a string regardless of its internal type

std::wstring ODBCBuffer::ToWString ( ) const

convert the value to a unicode string regardless of its internal type

Member Data Documentation

std::vector<char> AppSecInc::Databases::ODBC::ODBCBuffer::_buffer
protected

the data buffer

SQLINTEGER AppSecInc::Databases::ODBC::ODBCBuffer::_size
protected

the data size after a Fetch

SQLSMALLINT AppSecInc::Databases::ODBC::ODBCBuffer::_type
protected

column type, eg. SQL_C_CHAR

const SQLINTEGER AppSecInc::Databases::ODBC::ODBCBuffer::INVALID_SIZE = 0
static

invalid data size


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


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com