Ignore:
Timestamp:
2008-05-20T11:11:51+12:00 (16 years ago)
Author:
mdewsnip
Message:

(Adding new DB support) Added a bunch more functions into the dbclass interface, so we can use it with the userdb class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/lib/dbclass.h

    r15557 r15585  
    5454  virtual ~dbclass();
    5555
    56   void setlogout (ostream *logout_arg) { logout = logout_arg; }
     56  void setlogout(ostream *logout_arg) { logout = logout_arg; }
    5757
    5858  // returns true if opened
     
    6060  virtual void closedatabase() = 0;
    6161
     62  // returns true if exists
     63  virtual bool exists(const text_t& key) = 0;
     64
    6265  // returns true on success
    63   virtual bool getinfo (const text_t& key, infodbclass &info) = 0;
     66  virtual bool getinfo(const text_t& key, infodbclass &info) = 0;
     67
     68  // returns true on success
     69  virtual bool setinfo(const text_t &key, const infodbclass &info) = 0;
    6470
    6571  // replaces the .c, .p, .n, .l syntax (child, parent, next, previous)
    6672  // it expects child, parent, etc. to exist if syntax has been used
    6773  // so you should test before using
    68   virtual text_t translate_OID (const text_t &OID, infodbclass &info) = 0;
     74  virtual text_t translate_OID(const text_t &OID, infodbclass &info) = 0;
     75
     76  // getfirstkey and getnextkey are used for traversing the database
     77  // no insertions or deletions should be carried out while traversing
     78  // the database. when there are no keys left to visit in the database
     79  // an empty string is returned.
     80  virtual text_t getfirstkey() = 0;
     81  virtual text_t getnextkey(const text_t &key) = 0;
     82
     83  virtual void deletekey(const text_t &key) = 0;
    6984
    7085protected:
Note: See TracChangeset for help on using the changeset viewer.