Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

cMySQL Class Reference

cMySQL processes all operations related to MySQL. More...

#include <cMySQL.h>

Inheritance diagram for cMySQL:

cSqlBaseIf List of all members.

Public Member Functions

 cMySQL (void)
 ~cMySQL (void)
Bool Connect (void)
 Return TRUE if success.

void Close (void)
 Close SQL connection.

Int ErrorNum (void)
 Return the error number for the most recently executed query.

list< string > GetDatabaseList (void)
 Get databases list.

Bool CreateDatabase (string sDbName)
 Create Database.

Bool DeleteDatabase (string sDbName)
 Delete Database.

Bool SelectDatabase (string sDbName)
 Select database.

void CreateTables (void)
 Create all tables of a database.

list< list< string > > GetFileList (void)
 Get a File List with their General information.

list< list< string > > GetMovieList (void)
 Get a Movie List with their General information.

list< list< string > > GetSoftwareList (void)
 Get a Software List with their General information.

list< list< string > > GetMusicList (void)
 Get a Music List with their General information.

list< string > GetFileRowResult (const string sMd4)
 Get a row data of FILE table.

list< string > GetMovieRowResult (const string sMd4)
 Get a row data of MOVIE table.

list< string > GetSoftwareRowResult (const string sMd4)
 Get a row data of SOFTWARE table.

list< string > GetMusicRowResult (const string sMd4)
 Get a row data of MUSIC table.

Bool InsertNewEntry2File (cFile *File)
 INSERT new entry into FILE tabel.

Bool InsertNewEntry2Movie (cMovie *Movie)
 INSERT new entry into MOVIE table.

Bool InsertNewEntry2Music (cMusic *Music)
 INSERT new entry into MUSIC table.

Bool InsertNewEntry2Software (cSoftware *Software)
 INSERT new entry into SOFTWARE table.

Bool IsMd4Found (const string sMd4)
 Is Md4 is found in FILE table.

const string GetCategory (const string sMd4)
 Get category string from FILE table.

Bool UpdateFile (cFile *pFile)
 UPDATE FILE table.

Bool UpdateMovie (cMovie *pMovie)
 UPDATE MOVIE table.

Bool UpdateSoftware (cSoftware *pSoftware)
 UPDATE SOFTWARE table.

Bool UpdateMusic (cMusic *pMusic)
 UPDATE MUSIC table.

Bool DeleteFromFile (const string sMd4)
 DELETE entry from FILE table.

Bool DeleteFromMovie (const string sMd4)
 DELETE entry from MOVIE table.

Bool DeleteFromSoftware (const string sMd4)
 DELETE entry from SOFTWARE table.

Bool DeleteFromMusic (const string sMd4)
 DELETE entry from MUSIC table.


Private Member Functions

Bool Init (void)
 Return TRUE if success.

Bool Query (string sQuery)
 Note: You should not add a terminating semicolon in sQuery.

list< list< string > > GetQueryTableResult (void)
 Note: Query() has to execute before this function.

list< string > GetQueryRowResult (void)
 Get the result of the 1st row. Note: Query() has to execute before this function.

list< string > GetQueryColResult (void)
 Get the result of the 1st col(field). Note: Query() has to execute before this function.

Bool CompareList (const list< string > lFirst, const list< string > lSecond)
 Don't need to sort. It is already in order.

Bool CompareTable (const string sTableName, list< string > lFixColNames)
list< list< string > > GetGeneralInfoListOf (string sSqlCategory)

Private Attributes

MYSQL_RES * SQLResult
MYSQL_ROW SQLRow
cFileSqlString FileSqlString
cMovieSqlString MovieSqlString
cSoftwareSqlString SoftwareSqlString
cMusicSqlString MusicSqlString

Static Private Attributes

MYSQL SQLConnection

Detailed Description

cMySQL processes all operations related to MySQL.

Author:
Xuan Ngo
Date:
Last Modified:
Version:
0.2
Since:
Sun Nov 23 02:46:06 2003
Bug:

Test:

Todo:
Warning:
Any warnings about using this class.


Constructor & Destructor Documentation

cMySQL::cMySQL void   ) 
 

cMySQL::~cMySQL void   ) 
 


Member Function Documentation

void cMySQL::Close void   )  [virtual]
 

Close SQL connection.

Implements cSqlBaseIf.

Bool cMySQL::CompareList const list< string >  lFirst,
const list< string >  lSecond
[private]
 

Don't need to sort. It is already in order.

Bool cMySQL::CompareTable const string  sTableName,
list< string >  lFixColNames
[private]
 

Bool cMySQL::Connect void   )  [virtual]
 

Return TRUE if success.

Implements cSqlBaseIf.

Bool cMySQL::CreateDatabase string  sDbName  )  [virtual]
 

Create Database.

Implements cSqlBaseIf.

void cMySQL::CreateTables void   )  [virtual]
 

Create all tables of a database.

Implements cSqlBaseIf.

Bool cMySQL::DeleteDatabase string  sDbName  )  [virtual]
 

Delete Database.

Implements cSqlBaseIf.

Bool cMySQL::DeleteFromFile const string  sMd4  )  [virtual]
 

DELETE entry from FILE table.

Implements cSqlBaseIf.

Bool cMySQL::DeleteFromMovie const string  sMd4  )  [virtual]
 

DELETE entry from MOVIE table.

Implements cSqlBaseIf.

Bool cMySQL::DeleteFromMusic const string  sMd4  )  [virtual]
 

DELETE entry from MUSIC table.

Implements cSqlBaseIf.

Bool cMySQL::DeleteFromSoftware const string  sMd4  )  [virtual]
 

DELETE entry from SOFTWARE table.

Implements cSqlBaseIf.

Int cMySQL::ErrorNum void   )  [virtual]
 

Return the error number for the most recently executed query.

Implements cSqlBaseIf.

const string cMySQL::GetCategory const string  sMd4  )  [virtual]
 

Get category string from FILE table.

Implements cSqlBaseIf.

list< string > cMySQL::GetDatabaseList void   )  [virtual]
 

Get databases list.

Implements cSqlBaseIf.

list< list< string > > cMySQL::GetFileList void   )  [virtual]
 

Get a File List with their General information.

Implements cSqlBaseIf.

list< string > cMySQL::GetFileRowResult const string  sMd4  )  [virtual]
 

Get a row data of FILE table.

Implements cSqlBaseIf.

list< list< string > > cMySQL::GetGeneralInfoListOf string  sSqlCategory  )  [private]
 

list< list< string > > cMySQL::GetMovieList void   )  [virtual]
 

Get a Movie List with their General information.

Implements cSqlBaseIf.

list< string > cMySQL::GetMovieRowResult const string  sMd4  )  [virtual]
 

Get a row data of MOVIE table.

Implements cSqlBaseIf.

list< list< string > > cMySQL::GetMusicList void   )  [virtual]
 

Get a Music List with their General information.

Implements cSqlBaseIf.

list< string > cMySQL::GetMusicRowResult const string  sMd4  )  [virtual]
 

Get a row data of MUSIC table.

Implements cSqlBaseIf.

list< string > cMySQL::GetQueryColResult void   )  [private]
 

Get the result of the 1st col(field). Note: Query() has to execute before this function.

list< string > cMySQL::GetQueryRowResult void   )  [private]
 

Get the result of the 1st row. Note: Query() has to execute before this function.

list< list< string > > cMySQL::GetQueryTableResult void   )  [private]
 

Note: Query() has to execute before this function.

list< list< string > > cMySQL::GetSoftwareList void   )  [virtual]
 

Get a Software List with their General information.

Implements cSqlBaseIf.

list< string > cMySQL::GetSoftwareRowResult const string  sMd4  )  [virtual]
 

Get a row data of SOFTWARE table.

Implements cSqlBaseIf.

Bool cMySQL::Init void   )  [private]
 

Return TRUE if success.

Bool cMySQL::InsertNewEntry2File cFile File  )  [virtual]
 

INSERT new entry into FILE tabel.

Implements cSqlBaseIf.

Bool cMySQL::InsertNewEntry2Movie cMovie Movie  )  [virtual]
 

INSERT new entry into MOVIE table.

Implements cSqlBaseIf.

Bool cMySQL::InsertNewEntry2Music cMusic Music  )  [virtual]
 

INSERT new entry into MUSIC table.

Implements cSqlBaseIf.

Bool cMySQL::InsertNewEntry2Software cSoftware Software  )  [virtual]
 

INSERT new entry into SOFTWARE table.

Implements cSqlBaseIf.

Bool cMySQL::IsMd4Found const string  sMd4  )  [virtual]
 

Is Md4 is found in FILE table.

Implements cSqlBaseIf.

Bool cMySQL::Query string  sQuery  )  [private]
 

Note: You should not add a terminating semicolon in sQuery.

Bool cMySQL::SelectDatabase string  sDbName  )  [virtual]
 

Select database.

Implements cSqlBaseIf.

Bool cMySQL::UpdateFile cFile pFile  )  [virtual]
 

UPDATE FILE table.

Implements cSqlBaseIf.

Bool cMySQL::UpdateMovie cMovie pMovie  )  [virtual]
 

UPDATE MOVIE table.

Implements cSqlBaseIf.

Bool cMySQL::UpdateMusic cMusic pMusic  )  [virtual]
 

UPDATE MUSIC table.

Implements cSqlBaseIf.

Bool cMySQL::UpdateSoftware cSoftware pSoftware  )  [virtual]
 

UPDATE SOFTWARE table.

Implements cSqlBaseIf.


Member Data Documentation

cFileSqlString cMySQL::FileSqlString [private]
 

cMovieSqlString cMySQL::MovieSqlString [private]
 

cMusicSqlString cMySQL::MusicSqlString [private]
 

cSoftwareSqlString cMySQL::SoftwareSqlString [private]
 

MYSQL cMySQL::SQLConnection [static, private]
 

MYSQL_RES* cMySQL::SQLResult [private]
 

MYSQL_ROW cMySQL::SQLRow [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 25 01:15:18 2004 for eDonkeyFilesManager by doxygen 1.3.2