Main Page   Data Structures   File List   Data Fields  

CMyMySQLPPTypeConv Class Reference

#include <MyMySQLPPTypeConv.h>


Detailed Description

Implementation of a type converter that automatically converts mysql type safe row data to the required type.

This object is returned by CMyMySQLPPRow::Get and CMyMySQLPPRow::operator[]. It automatically converts to the required type.

Example:
CMyMySQLPPResult res = ...;
CMyMySQLPPRow r = res[0];
int asint = r[1];
long aslong = r[1];
char* assstr = r[1];

So you don't need to implement any type converting by your own.

Definition at line 29 of file MyMySQLPPTypeConv.h.

Public Member Functions

 CMyMySQLPPTypeConv (void)
 Class constructor.

 CMyMySQLPPTypeConv (char *data)
 Class constructor accepting data.

 ~CMyMySQLPPTypeConv (void)
 Class destructor.

void Free (void)
 Frees up space used by this object.

void SetData (const char *data)
 Sets new data to be converted.

const char * GetData (void)
 Returns data to be converted.

int GetAsInt (void)
 Returns data converted to integer.

 operator int (void)
 Returns data converted to integer.

LPSTR GetAsString (void)
 Returns data converted to string.

 operator LPSTR (void)
 Returns data converted to integer.

double GetAsDouble (void)
 Returns data converted to double.

 operator double (void)
 Returns data converted to double.

long GetAsLong (void)
 Returns data converted to long.

 operator long (void)
 Returns data converted to long.

__int64 GetAsInt64 (void)
 Returns data converted to 64 bit integer.

 operator __int64 (void)
 Returns data converted to 64 bit integer.

UINT GetAsUInt (void)
 Returns data converted to unsigned integer.

 operator UINT (void)
 Returns data converted to unsigned integer.

LPCSTR GetAsConstString (void)
 Returns data converted to const string.

 operator LPCSTR (void)
 Returns data converted to const string.


Constructor & Destructor Documentation

CMyMySQLPPTypeConv::CMyMySQLPPTypeConv void   
 

Class constructor.

Definition at line 43 of file MyMySQLPPTypeConv.cpp.

CMyMySQLPPTypeConv::CMyMySQLPPTypeConv char *    data
 

Class constructor accepting data.

Parameters:
data to be converted

Definition at line 51 of file MyMySQLPPTypeConv.cpp.

CMyMySQLPPTypeConv::~CMyMySQLPPTypeConv void   
 

Class destructor.

Definition at line 59 of file MyMySQLPPTypeConv.cpp.

References Free().


Member Function Documentation

void CMyMySQLPPTypeConv::Free void   
 

Frees up space used by this object.

Definition at line 65 of file MyMySQLPPTypeConv.cpp.

Referenced by SetData(), and ~CMyMySQLPPTypeConv().

LPCSTR CMyMySQLPPTypeConv::GetAsConstString void   
 

Returns data converted to const string.

Returns:
Data converted to const string

Definition at line 199 of file MyMySQLPPTypeConv.cpp.

Referenced by operator LPCSTR().

double CMyMySQLPPTypeConv::GetAsDouble void   
 

Returns data converted to double.

Returns:
Data converted to double

Definition at line 127 of file MyMySQLPPTypeConv.cpp.

Referenced by operator double().

int CMyMySQLPPTypeConv::GetAsInt void   
 

Returns data converted to integer.

Returns:
Data converted to integer

Definition at line 93 of file MyMySQLPPTypeConv.cpp.

Referenced by operator int().

__int64 CMyMySQLPPTypeConv::GetAsInt64 void   
 

Returns data converted to 64 bit integer.

Returns:
Data converted to 64 bit integer

Definition at line 163 of file MyMySQLPPTypeConv.cpp.

Referenced by operator __int64().

long CMyMySQLPPTypeConv::GetAsLong void   
 

Returns data converted to long.

Returns:
Data converted to long

Definition at line 145 of file MyMySQLPPTypeConv.cpp.

Referenced by operator long().

LPSTR CMyMySQLPPTypeConv::GetAsString void   
 

Returns data converted to string.

Returns:
Data converted to string

Definition at line 111 of file MyMySQLPPTypeConv.cpp.

Referenced by operator LPSTR().

UINT CMyMySQLPPTypeConv::GetAsUInt void   
 

Returns data converted to unsigned integer.

Returns:
Data converted to unsigned integer

Definition at line 181 of file MyMySQLPPTypeConv.cpp.

Referenced by operator UINT().

const char * CMyMySQLPPTypeConv::GetData void   
 

Returns data to be converted.

Returns:
Data to be converted.

Definition at line 85 of file MyMySQLPPTypeConv.cpp.

CMyMySQLPPTypeConv::operator __int64 void   
 

Returns data converted to 64 bit integer.

Returns:
Data converted to 64 bit integer

Definition at line 173 of file MyMySQLPPTypeConv.cpp.

References GetAsInt64().

CMyMySQLPPTypeConv::operator double void   
 

Returns data converted to double.

Returns:
Data converted to double

Definition at line 137 of file MyMySQLPPTypeConv.cpp.

References GetAsDouble().

CMyMySQLPPTypeConv::operator int void   
 

Returns data converted to integer.

Returns:
Data converted to integer

Definition at line 103 of file MyMySQLPPTypeConv.cpp.

References GetAsInt().

CMyMySQLPPTypeConv::operator long void   
 

Returns data converted to long.

Returns:
Data converted to long

Definition at line 155 of file MyMySQLPPTypeConv.cpp.

References GetAsLong().

CMyMySQLPPTypeConv::operator LPCSTR void   
 

Returns data converted to const string.

Returns:
Data converted to const string

Definition at line 207 of file MyMySQLPPTypeConv.cpp.

References GetAsConstString().

CMyMySQLPPTypeConv::operator LPSTR void   
 

Returns data converted to integer.

Returns:
Data converted to integer

Definition at line 119 of file MyMySQLPPTypeConv.cpp.

References GetAsString().

CMyMySQLPPTypeConv::operator UINT void   
 

Returns data converted to unsigned integer.

Returns:
Data converted to unsigned integer

Definition at line 191 of file MyMySQLPPTypeConv.cpp.

References GetAsUInt().

void CMyMySQLPPTypeConv::SetData const char *    data
 

Sets new data to be converted.

Parameters:
data to be converted

Definition at line 75 of file MyMySQLPPTypeConv.cpp.

References Free().


The documentation for this class was generated from the following files:
Generated on Thu Feb 20 16:16:00 2003 for MyMySQL++ by doxygen1.3-rc3