392 char errorStatus =
findOffset(ikey, &start, &size, 0, &idxoff);
396 len = (len < 0) ? strlen(buf) : len;
399 if (strcmp(key, dbKey) < 0) {
401 else if (strcmp(key, dbKey) > 0) {
402 if (errorStatus != (
char)-2)
406 else if ((!strcmp(key, dbKey)) && (len>0)) {
408 tmpbuf =
new char [ size + 2 ];
409 memset(tmpbuf, 0, size + 2);
413 for (ch = tmpbuf; *ch; ch++) {
419 memmove(tmpbuf, ch, size - (
unsigned long)(ch-tmpbuf));
422 if (!strncmp(tmpbuf,
"@LINK", 5) && (len > 0)) {
423 for (ch = tmpbuf; *ch; ch++) {
429 findOffset(tmpbuf + 8, &start, &size, 0, &idxoff);
439 shiftSize = endoff - idxoff;
442 idxBytes =
new char [ shiftSize ];
447 outbuf =
new char [ len + strlen(key) + 5 ];
448 sprintf(outbuf,
"%s%c%c", key, 13, 10);
449 size = strlen(outbuf);
450 memcpy(outbuf + size, buf, len);
451 size = outsize = size + (
SW_u32)len;
long seek(long offset, int whence)
signed char findOffset(const char *key, SW_u32 *start, SW_u32 *size, long away=0, SW_u32 *idxoff=0) const
long write(const void *buf, long count)
signed char trunc(FileDesc *file)
char * toupperstr_utf8(char *t, unsigned int max=0)
SWORD_NAMESPACE_START char * stdstr(char **ipstr, const char *istr, unsigned int memPadFactor=1)
void getIDXBufDat(long ioffset, char **buf) const
long read(void *buf, long count)
static FileMgr * getSystemFileMgr()