00001
00002
00003
00004
00005
00006
00007
00008 #ifndef RAWVERSE_H
00009 #define RAWVERSE_H
00010
00011 #include <filemgr.h>
00012 #include <fcntl.h>
00013
00014 #include <defs.h>
00015 #include <swbuf.h>
00016
00017 SWORD_NAMESPACE_START
00018
00019 class SWDLLEXPORT RawVerse {
00020 static int instance;
00021 protected:
00022 FileDesc *idxfp[2];
00023 FileDesc *textfp[2];
00024
00025 char *path;
00026 void prepText(SWBuf &buf);
00027 void doSetText(char testmt, long idxoff, const char *buf, long len = -1);
00028 void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
00029
00030 public:
00031 static const char *nl;
00032 RawVerse(const char *ipath, int fileMode = -1);
00033 virtual ~RawVerse();
00034 void findOffset(char testmt, long idxoff, long *start, unsigned short *end);
00035 void readText(char testmt, long start, unsigned short size, SWBuf &buf);
00036 static char createModule(const char *path);
00037 };
00038
00039 SWORD_NAMESPACE_END
00040 #endif