rawverse.h

00001 /******************************************************************************
00002  *  rawverse.h   - code for class 'RawVerse'- a module that reads raw text
00003  *                      files:  ot and nt using indexs ??.bks ??.cps ??.vss
00004  *                      and provides lookup and parsing functions based on
00005  *                      class VerseKey
00006  */
00007 
00008 #ifndef RAWVERSE_H
00009 #define RAWVERSE_H
00010 
00011 
00012 #include <defs.h>
00013 
00014 SWORD_NAMESPACE_START
00015 
00016 class FileDesc;
00017 class SWBuf;
00018 
00019 class SWDLLEXPORT RawVerse {
00020 
00021 
00022         static int instance;            // number of instantiated RawVerse objects or derivitives
00023 protected:
00024         FileDesc *idxfp[2];
00025         FileDesc *textfp[2];
00026 
00027         char *path;
00028         void prepText(SWBuf &buf);
00029         void doSetText(char testmt, long idxoff, const char *buf, long len = -1);
00030         void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
00031 
00032 public:
00033         static const char *nl;
00034         RawVerse(const char *ipath, int fileMode = -1);
00035         virtual ~RawVerse();
00036         void findOffset(char testmt, long idxoff, long *start,  unsigned short *end);
00037         void readText(char testmt, long start, unsigned short size, SWBuf &buf);
00038         static char createModule(const char *path);
00039 };
00040 
00041 SWORD_NAMESPACE_END
00042 #endif