44 RawFiles::RawFiles(
const char *ipath,
const char *iname,
const char *idesc,
SWDisplay *idisp,
SWTextEncoding enc,
SWTextDirection dir,
SWTextMarkup mark,
const char* ilang) :
RawVerse(ipath,
FileMgr::RDWR),
SWCom(iname, idesc, idisp, enc, dir, mark, ilang)
76 unsigned short size = 0;
89 if (datafile->
getFd() > 0) {
91 char *tmpBuf =
new char [ size + 1 ];
92 memset(tmpBuf, 0, size + 1);
94 datafile->
read(tmpBuf, size);
116 len = (len<0)?strlen(inbuf):len;
136 if (datafile->
getFd() > 0) {
137 datafile->
write(inbuf, len);
163 doSetText(key->getTestament(), key->getTestamentIndex(), tmpbuf.
c_str());
188 static SWBuf incfile;
194 if (datafile->
getFd() != -1) {
195 if (datafile->
read(&number, 4) != 4) number = 0;
205 datafile->
write(&number, 4);
213 char *incfile =
new char [ strlen (path) + 16 ];
220 sprintf(incfile,
"%s/incfile", path);
223 datafile->
write(&zero, 4);
static char createModule(const char *path)
virtual bool isWritable() const
#define SWORD_NAMESPACE_START
long seek(long offset, int whence)
FileDesc * open(const char *path, int mode, bool tryDowngrade)
const VerseKey & getVerseKeyConst(const SWKey *key=0) const
static unsigned int RDONLY
virtual void deleteEntry()
static unsigned int TRUNC
virtual void setEntry(const char *inbuf, long len=-1)
void findOffset(char testmt, long idxoff, long *start, unsigned short *end) const
virtual void linkEntry(const SWKey *linkKey)
virtual SWBuf & getRawEntryBuf() const
const char * getNextFilename()
long write(const void *buf, long count)
void close(FileDesc *file)
const char * c_str() const
void readText(char testmt, long start, unsigned short size, SWBuf &buf) const
static char createModule(const char *path, const char *v11n="KJV")
RawFiles(const char *ipath, const char *iname=0, const char *idesc=0, SWDisplay *idisp=0, SWTextEncoding encoding=ENC_UNKNOWN, SWTextDirection dir=DIRECTION_LTR, SWTextMarkup markup=FMT_UNKNOWN, const char *ilang=0)
static unsigned int CREAT
virtual long getTestamentIndex() const
static unsigned int WRONLY
long read(void *buf, long count)
void doSetText(char testmt, long idxoff, const char *buf, long len=-1)
#define SWORD_NAMESPACE_END
SWBuf & setFormatted(const char *format,...)
VerseKey & getVerseKey(SWKey *key=0)
virtual char getTestament() const
static FileMgr * getSystemFileMgr()