Changeset 15640

Show
Ignore:
Timestamp:
22.05.2008 14:51:26 (12 years ago)
Author:
mdewsnip
Message:

(Adding new DB support) Renamed sqliteclass to sqlitedbclass, to be a bit more accurate.

Location:
gsdl/trunk/lib
Files:
1 modified
2 moved

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/lib/Makefile.in

    r15599 r15640  
    3333ifeq ($(USE_SQLITE), 1) 
    3434SQLITE_INCLUDES = -I$(PACKAGES_DIR)/sqlite/sqlite3/linux/include 
    35 SQLITE_OBJECTS = sqliteclass.o 
    36 SQLITE_SOURCES = sqliteclass.cpp 
     35SQLITE_OBJECTS = sqlitedbclass.o 
     36SQLITE_SOURCES = sqlitedbclass.cpp 
    3737else 
    3838SQLITE_INCLUDES =  
  • gsdl/trunk/lib/sqlitedbclass.cpp

    r15637 r15640  
    11/********************************************************************** 
    22 * 
    3  * sqliteclass.cpp --  
     3 * sqlitedbclass.cpp --  
    44 * Copyright (C) 2008  DL Consulting Ltd 
    55 * 
     
    2424 *********************************************************************/ 
    2525 
    26 #include "sqliteclass.h" 
     26#include "sqlitedbclass.h" 
    2727#include "unitool.h" 
    2828 
     
    3131 
    3232 
    33 sqliteclass::~sqliteclass() 
     33sqlitedbclass::~sqlitedbclass() 
    3434{ 
    3535  closedatabase(); 
     
    3838 
    3939// returns true if opened 
    40 bool sqliteclass::opendatabase(const text_t &filename, int mode, int num_retrys,  
     40bool sqlitedbclass::opendatabase(const text_t &filename, int mode, int num_retrys,  
    4141#ifdef __WIN32__ 
    4242                   bool need_filelock 
     
    5959  if (sqlitefile == NULL) 
    6060  { 
    61     (*logout) << "ERROR: sqliteclass::opendatabase() failed on: " << filename << "\n"; 
     61    (*logout) << "ERROR: sqlitedbclass::opendatabase() failed on: " << filename << "\n"; 
    6262    return false; 
    6363  } 
     
    7272 
    7373 
    74 void sqliteclass::closedatabase() 
     74void sqlitedbclass::closedatabase() 
    7575{ 
    7676  if (sqlitefile == NULL) return; 
     
    8383 
    8484// returns true on success 
    85 bool sqliteclass::getinfo(const text_t& key, infodbclass &info) 
     85bool sqlitedbclass::getinfo(const text_t& key, infodbclass &info) 
    8686{ 
    8787  text_t sql_cmd = "SELECT value FROM data WHERE key='" + key + "'"; 
     
    107107 
    108108// returns true if exists 
    109 bool sqliteclass::exists(const text_t& key) 
     109bool sqlitedbclass::exists(const text_t& key) 
    110110{ 
    111111  text_t sql_cmd = "SELECT value FROM data WHERE key='" + key + "'"; 
     
    121121 
    122122// returns true on success 
    123 bool sqliteclass::setinfo(const text_t &key, const infodbclass &info) 
     123bool sqlitedbclass::setinfo(const text_t &key, const infodbclass &info) 
    124124{ 
    125125  text_t subkey; 
     
    196196 
    197197 
    198 void sqliteclass::deletekey (const text_t &key) 
     198void sqlitedbclass::deletekey (const text_t &key) 
    199199{ 
    200200  text_t sql_cmd = "DELETE FROM data WHERE key='" + key + "'"; 
     
    203203 
    204204 
    205 text_tarray sqliteclass::getkeys () 
     205text_tarray sqlitedbclass::getkeys () 
    206206{ 
    207207  text_tarray keys; 
     
    229229 
    230230// returns true on success 
    231 bool sqliteclass::getinfoline (text_t::iterator &here, text_t::iterator end,  
     231bool sqlitedbclass::getinfoline (text_t::iterator &here, text_t::iterator end,  
    232232                   text_t &key, text_t &value) 
    233233{ 
     
    281281// sqlexec simply executes the given sql statement - it doesn't obtain a 
    282282// result set - returns true if the sql statement was executed successfully 
    283 bool sqliteclass::sqlexec(const text_t &sql_cmd) 
     283bool sqlitedbclass::sqlexec(const text_t &sql_cmd) 
    284284{ 
    285285  if (sqlitefile == NULL) return false; 
     
    334334 
    335335// sqlgetarray executes sql and returns the result set in sql_results 
    336 bool sqliteclass::sqlgetarray(const text_t &sql_cmd, vector<text_tmap> &sql_results) 
     336bool sqlitedbclass::sqlgetarray(const text_t &sql_cmd, vector<text_tmap> &sql_results) 
    337337{ 
    338338  if (sqlitefile == NULL) return false; 
     
    367367 
    368368// returns true if exists 
    369 bool sqliteclass::sqltableexists(const text_t &table_name) 
     369bool sqlitedbclass::sqltableexists(const text_t &table_name) 
    370370{ 
    371371  text_t sql_cmd = "SELECT * FROM sqlite_master WHERE tbl_name='" + table_name + "'"; 
  • gsdl/trunk/lib/sqlitedbclass.h

    r15637 r15640  
    11/********************************************************************** 
    22 * 
    3  * sqliteclass.h --  
     3 * sqlitedbclass.h --  
    44 * Copyright (C) 2008  DL Consulting Ltd 
    55 * 
     
    2424 *********************************************************************/ 
    2525 
    26 #ifndef SQLITECLASS_H 
    27 #define SQLITECLASS_H 
     26#ifndef SQLITEDBCLASS_H 
     27#define SQLITEDBCLASS_H 
    2828 
    2929 
     
    3232 
    3333 
    34 class sqliteclass : public dbclass 
     34class sqlitedbclass : public dbclass 
    3535{ 
    3636public: 
    37   sqliteclass() { sqlitefile = NULL; } 
    38   ~sqliteclass(); 
     37  sqlitedbclass() { sqlitefile = NULL; } 
     38  ~sqlitedbclass(); 
    3939 
    4040  // returns true if opened