00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef NULL
00013 #define NULL 0
00014 #endif
00015
00016 #ifndef _TEXTHANDLER_HPP
00017 #define _TEXTHANDLER_HPP
00018
00019
00036
00037
00038
00039
00040
00041
00042 class TextHandler {
00043
00044 public:
00045 TextHandler() {
00046 textHandler = NULL;
00047 }
00048
00050 virtual void foundDoc(char * docno) {
00051 docno = handleDoc(docno);
00052 if (textHandler != NULL)
00053 textHandler->foundDoc(docno);
00054 }
00056 virtual void foundWord(char * word) {
00057 word = handleWord(word);
00058 if (textHandler != NULL)
00059 textHandler->foundWord(word);
00060 }
00062 virtual void setTextHandler(TextHandler * th) {
00063 textHandler = th;
00064 }
00065
00067 virtual char * handleDoc(char * docno) { return docno; }
00069 virtual char * handleWord(char * word) { return word; }
00070
00071 protected:
00073 TextHandler * textHandler;
00074 };
00075
00076 #endif
00077