Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

ActiveDB.h

Go to the documentation of this file.
00001 #ifndef _ActiveDB_h_
00002 #define _ActiveDB_h_
00003 
00004 #include <ctype.h>
00005 
00006 #include <iostream>
00007 
00008 #include "NVcontainer.h"
00009 #include "NSError.h"
00010 #include "GroupInfo.h"
00011 
00012 #include "VirtualIterator.h"
00013 
00014 class ActiveDB {
00015       protected:
00016         ActiveDB();
00017       public:
00018         virtual ~ ActiveDB();
00019         // Used for set
00020         enum {
00021                 update_only = 0x01
00022         };
00023 
00024         enum {
00025                 m_active, m_times
00026         };
00027 
00028         enum {
00029                 F_STORE_READONLY = 0x1,
00030                 F_CLEAR = 0x2
00031         };
00032 
00033         virtual void clear(void) = 0;
00034         virtual int is_empty(void) = 0;
00035 
00036         virtual void add(GroupInfo & gi) = 0;
00037         virtual void set(GroupInfo & gi, int flags = 0) = 0;
00038 
00039         /* get(group,gi)
00040          * Returns information of the newsgroup >group<.
00041          * The space for gi must be allocated by the caller.
00042          */
00043         virtual int get(const char *group, GroupInfo * gi) = 0;
00044         virtual int hasgroup(const char *group) = 0;
00045 
00046         virtual void read(std::istream & is, const char *filter,
00047                           int flags = 0) = 0;
00048         virtual void write(std::ostream & os, nvtime_t ctime =
00049                            0, int mode = m_active, const char *filter =
00050                            NULL) = 0;
00051 
00052         virtual void setmtime(unsigned long tm, int force = 0) = 0;
00053         virtual void getmtime(unsigned long *tm) = 0;
00054 
00055         virtual Iter < GroupInfo > begin() = 0;
00056         virtual Iter < GroupInfo > end() = 0;
00057 };
00058 
00059 #endif

Generated on Sun Oct 24 21:08:17 2004 for NewsCache by doxygen 1.3.6-20040222