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

ElemDocMgr.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  *
00003  *  Original source copyright (c) 2001, Carnegie Mellon University.
00004  *  See copyright.cmu for details.
00005  *  Modifications copyright (c) 2002, University of Massachusetts.
00006  *  See copyright.umass for details.
00007  *
00008  *==========================================================================
00009 */
00010 
00011 #ifndef _ELEMDOCMGR_HPP
00012 #define _ELEMDOCMGR_HPP
00013 
00014 #include "KeyfileDocMgr.hpp"
00015 
00016 //TOC
00017 #define ELEM_TOC ".elem"
00018 #define ELEM_TOC_LEN 5
00019 
00020 // elems
00021 #define ELEM_ELS ".els"
00022 
00023 // we should really do something about this, it appears all over the toolkit
00024 #ifndef _ABC_OP
00025 #define _ABC_OP
00026 struct abc
00027 {
00028   bool operator()(char* s1, char* s2) const{
00029     return strcmp(s1, s2) < 0;
00030   }
00031 };
00032 #endif
00033 
00047 class ElemDocMgr : public KeyfileDocMgr {
00048 public:
00049 
00052   ElemDocMgr(const string &name);
00053 
00058   ElemDocMgr(string name, string mode, string source);  
00059 
00060   virtual ~ElemDocMgr();
00061 
00063   virtual char* handleBeginTag(char* tag, const char* orig, PropertyList* props);
00064 
00066   virtual char* handleEndTag(char* tag, const char* orig, PropertyList* props);
00067 
00071   virtual char* getElement(const char* docid, const char* element) const;
00072 
00074   virtual bool open(const string &manname) {
00075     IDnameext = manname;
00076     IDname = manname.substr(0, manname.length() - 5);
00077     return loadTOC();
00078   }
00079 
00080 protected:
00081   virtual void writeTOC();
00082   virtual bool loadTOC();
00083 
00084   map<char*,btl,abc> elemtable; // map for temp creating elem strings
00085 
00086   Keyfile elements;  // btree for storing elements
00087 };
00088 
00089 #endif // _ELEMDOCMGR_HPP

Generated on Wed Nov 3 12:58:54 2004 for Lemur Toolkit by doxygen1.2.18