home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / business / printcar / printcar.exe / src / DB / Database.h < prev    next >
C/C++ Source or Header  |  2000-06-10  |  1KB  |  58 lines

  1. //
  2. //  $Id: Database.h,v 1.4 2000/06/10 00:20:02 sergey Exp $
  3. //
  4.  
  5. #ifndef _Database_h_
  6. #define _Database_h_
  7.  
  8.  
  9. namespace DB
  10. {
  11.     class AppInfo;
  12.     class Record;
  13.  
  14.     //
  15.     // Data Manager wrapper class
  16.     //
  17.     class Database
  18.     {
  19.     public:
  20.         Database();
  21.         ~Database();
  22.  
  23.     // this object can't be copied
  24.     private:
  25.         Database(const Database&);
  26.         Database& operator =(const Database&);
  27.  
  28.     // operations
  29.     public:
  30.         bool open(int cardNo, const char* databaseName, int mode);
  31.         void close();
  32.  
  33.         bool readAppInfo(AppInfo& appInfo) const;
  34.  
  35.         int recordCount() const;
  36.         bool readRecord(int index, Record& record) const;
  37.  
  38.     // attributes
  39.  
  40.         bool isOpened() const           { return _openRef != 0; }
  41.  
  42.         bool isRecord(int index) const  { return 0 <= index && index < recordCount(); }
  43.         bool isDeletedRecord(int index) const;
  44.  
  45.     // implementation
  46.     protected:
  47.         DmOpenRef openRef() const   { return _openRef; }
  48.  
  49.     // data members
  50.     private:
  51.         int _cardNo;
  52.         DmOpenRef _openRef;
  53.     };
  54. }
  55. // namespace DB
  56.  
  57. #endif // _Database_h_
  58.