Back to index

lightning-sunbird  0.9+nobinonly
icalbdbset_cxx.h
Go to the documentation of this file.
00001 /* -*- Mode: C -*- */
00002 /*======================================================================
00003  FILE: icalbdbset_cxx.h
00004  CREATOR: dml 12/12/01
00005  (C) COPYRIGHT 2001, Critical Path
00006 ======================================================================*/
00007 
00008 #ifndef ICALBDBSET_CXX_H
00009 #define ICALBDBSET_CXX_H
00010 
00011 
00012 extern "C" {
00013 #include "ical.h"
00014 #include "icalgauge.h"
00015 }
00016 
00017 #include "vcomponent.h"
00018 #include <db_cxx.h>
00019 
00020 typedef       char* string; // Will use the string library from STL
00021 
00022 class ICalBDBSet {
00023 public:
00024 
00025   ICalBDBSet();
00026   ICalBDBSet(const ICalBDBSet&);
00027   ICalBDBSet operator=(const ICalBDBSet &);
00028   ~ICalBDBSet();
00029 
00030   ICalBDBSet(const string& path, int flags);
00031 
00032 public:
00033 
00034   void free();
00035   string path();
00036 
00037   icalerrorenum add_component(VComponent* child);
00038   icalerrorenum remove_component(VComponent* child);
00039   int count_components(icalcomponent_kind kind);
00040 
00041   // Restrict the component returned by icalbdbset_first, _next to those
00042   // that pass the gauge. _clear removes the gauge 
00043   icalerrorenum select(icalgauge *gauge);
00044   void clear();
00045 
00046   // Get and search for a component by uid 
00047   VComponent* fetch(string &uid);
00048   VComponent* fetch_match(icalcomponent *c);
00049   int has_uid(string &uid);
00050 
00051   // Iterate through components. If a guage has been defined, these
00052   // will skip over components that do not pass the gauge 
00053   VComponent* get_current_component();
00054   VComponent* get_first_component();
00055   VComponent* get_next_component();
00056 
00057   VComponent* get_component();
00058 
00059 };
00060 
00061 #endif