Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Protected Attributes

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

List of all members.

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

static const SQLINTEGER INVALID_SIZE = 0
 invalid data size

Static Protected Member Functions

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

Protected Attributes

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

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) [static, protected]

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

the data size after a Fetch

column type, eg. SQL_C_CHAR

invalid data size


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


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