home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_01 / 1001026a < prev    next >
Text File  |  1991-11-17  |  2KB  |  79 lines

  1. /////////////////////////////////////////////////////
  2. //
  3. //  PINCLASS.H
  4. //  Pinacle File Manager Class
  5. ////////////////////////////////////////////////////
  6.  
  7. #ifndef PINCLASS_H
  8. #define PINCLASS_H
  9.  
  10. extern "C" {
  11. #include <pinnacle.h>
  12. }
  13. #include "string.h"
  14. #include "listclas.h"
  15.  
  16. class Pfm_List: public D_List  {
  17. protected:
  18.     DB db;
  19.     DBTAB table;
  20.     DBCOL default_key;
  21.     DBSEARCH default_dbsearch;
  22.     Boolean is_at_top, // Flags
  23.             is_at_bottom,
  24.             needs_closed;
  25.     char *buffer;
  26.     size_t max_buffer_size;
  27. public:
  28. // Constructors and Destructors
  29.         Pfm_List(char *database, char *table_name,
  30.                  size_t mbs = 1024);
  31.         Pfm_List(DB &open_db, char *table_name,
  32.                   size_t mbs = 1024);
  33.         Pfm_List(DB &open_db, DBTAB &db_table,
  34.                  size_t mbs = 1024);
  35.     virtual ~Pfm_List();
  36.  
  37. // Database Specific Methods
  38.     DB DBHandle() {return db;}
  39.     DBTAB TableHandle() {return table;}
  40.  
  41.  
  42. //  List Status
  43.         virtual Boolean at_top()
  44.         { return( is_at_top); }
  45.         virtual Boolean at_end()
  46.         { return( is_at_bottom); }
  47.     long virtual tell();
  48.  
  49. //  List Navigation
  50.         virtual Boolean find(void *key),
  51.         find(void *key, char *relation),
  52.         find(char *col, char *relation, void *key);
  53.     virtual void prev(), next(), top(), end();
  54.     virtual Boolean findnext(), findprev();
  55.  
  56. //  Interface to and from List
  57.     virtual void add();
  58.         virtual void replace(char *field,
  59.                              char *value);
  60.         virtual void replace(char *field,
  61.                               long value);
  62.         virtual void replace(char *field,
  63.                             double value);
  64. //  virtual void replace(char *field, void *value);
  65.         virtual void replace(void *member){ };
  66.         // Not truly defined.
  67.     virtual void remove();
  68.         virtual void *current()
  69.         {return (void *)buffer; }
  70.         long virtual total()
  71.         { return ((long) DB_CountRows(table));}
  72.     virtual char *get(char *field, char *value);
  73.     virtual long get(char *field, long &value);
  74.     virtual double get(char *field, double &value);
  75.     virtual void *get(char *field, void *value);
  76.     
  77. };
  78. #endif
  79.