SqlDebug Class Reference

Inheritance diagram for SqlDebug:

SqlBase

Detailed Description

Definition at line 207 of file history_sql.cxx.

Public Member Functions

 SqlDebug ()
 ~SqlDebug ()
int SetDebug (int debug)
int Connect (const char *filename=NULL)
int Exec (const char *sql)
int Disconnect ()
bool IsConnected ()
int GetNumRows ()
int GetNumColumns ()
int Fetch ()
int Done ()
int ListTables (std::vector< std::string > *plist)
int ListColumns (const char *table, std::vector< std::string > *plist)
const char * GetColumn (int icol)

Data Fields

FILE * fp
bool fIsConnected
int fDebug


Constructor & Destructor Documentation

SqlDebug::SqlDebug (  ) 

Definition at line 216 of file history_sql.cxx.

00217    {
00218       fp = NULL;
00219       fIsConnected = false;
00220    }

SqlDebug::~SqlDebug (  ) 

Definition at line 222 of file history_sql.cxx.

00223    {
00224       if (fp)
00225          fclose(fp);
00226       fp = NULL;
00227    }


Member Function Documentation

int SqlDebug::Connect ( const char *  filename = NULL  )  [virtual]

Implements SqlBase.

Definition at line 236 of file history_sql.cxx.

00237    {
00238       if (!filename)
00239          filename = "/dev/fd/1";
00240       fp = fopen(filename, "w");
00241       assert(fp);
00242       sql_type = sql_type_mysql;
00243       fIsConnected = true;
00244       return DB_SUCCESS;
00245    }

int SqlDebug::Disconnect (  )  [virtual]

Implements SqlBase.

Definition at line 253 of file history_sql.cxx.

00254    {
00255       // do nothing
00256       fIsConnected = false;
00257       return DB_SUCCESS;
00258    }

int SqlDebug::Done (  )  [virtual]

Implements SqlBase.

Definition at line 268 of file history_sql.cxx.

00268 { return DB_SUCCESS; }

int SqlDebug::Exec ( const char *  sql  )  [virtual]

Implements SqlBase.

Definition at line 247 of file history_sql.cxx.

00248    {
00249       fprintf(fp, "%s\n", sql);
00250       return DB_SUCCESS;
00251    }

int SqlDebug::Fetch (  )  [virtual]

Implements SqlBase.

Definition at line 267 of file history_sql.cxx.

00267 { return DB_NO_MORE_SUBKEYS; }

const char* SqlDebug::GetColumn ( int  icol  )  [virtual]

Implements SqlBase.

Definition at line 271 of file history_sql.cxx.

00271 { return NULL; };

int SqlDebug::GetNumColumns (  )  [virtual]

Implements SqlBase.

Definition at line 266 of file history_sql.cxx.

00266 { return DB_SUCCESS; }

int SqlDebug::GetNumRows (  )  [virtual]

Implements SqlBase.

Definition at line 265 of file history_sql.cxx.

00265 { return DB_SUCCESS; }

bool SqlDebug::IsConnected (  )  [virtual]

Implements SqlBase.

Definition at line 260 of file history_sql.cxx.

00261    {
00262       return fIsConnected;
00263    }

int SqlDebug::ListColumns ( const char *  table,
std::vector< std::string > *  plist 
) [virtual]

Implements SqlBase.

Definition at line 270 of file history_sql.cxx.

00270 { return DB_SUCCESS; };

int SqlDebug::ListTables ( std::vector< std::string > *  plist  )  [virtual]

Implements SqlBase.

Definition at line 269 of file history_sql.cxx.

00269 { return DB_SUCCESS; };

int SqlDebug::SetDebug ( int  debug  )  [virtual]

Implements SqlBase.

Definition at line 229 of file history_sql.cxx.

00230    {
00231       int old_debug = fDebug;
00232       fDebug = debug;
00233       return old_debug;
00234    }


Field Documentation

int SqlDebug::fDebug

Definition at line 212 of file history_sql.cxx.

Referenced by SetDebug().

bool SqlDebug::fIsConnected

Definition at line 211 of file history_sql.cxx.

Referenced by Connect(), Disconnect(), IsConnected(), and SqlDebug().

FILE* SqlDebug::fp

Definition at line 210 of file history_sql.cxx.

Referenced by Connect(), Exec(), SqlDebug(), and ~SqlDebug().


Midas DOC Version 3.0.0 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel - Doxygen - Peter Green - Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Exaos Lee - Rudi Meier - Glenn Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou - Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk