Example #1
0
char RawLD::getEntry(long away) const
{
    uint32_t start = 0;
    uint16_t size = 0;
    char *idxbuf = 0;
    char retval = 0;

    char *buf = new char [ strlen(*key) + 6 ];
    strcpy(buf, *key);

    if (strongsPadding) strongsPad(buf);

    if (!(retval = findOffset(buf, &start, &size, away))) {
        readText(start, &size, &idxbuf, entryBuf);
        rawFilter(entryBuf, 0);    // hack, decipher
        rawFilter(entryBuf, key);
        entrySize = size;        // support getEntrySize call
        if (!key->isPersist())            // If we have our own key
            *key = idxbuf;                // reset it to entry index buffer

        stdstr(&entkeytxt, idxbuf);    // set entry key text that module 'snapped' to.
        delete [] idxbuf;
    }
    else {
        entryBuf = "";
    }

    delete [] buf;
    return retval;
}
Example #2
0
SWBuf &RawGenBook::getRawEntryBuf() const {

	__u32 offset = 0;
	__u32 size = 0;

	const TreeKey &key = getTreeKey();

	int dsize;
	key.getUserData(&dsize);
	entryBuf = "";
	if (dsize > 7) {
		memcpy(&offset, key.getUserData(), 4);
		offset = swordtoarch32(offset);

		memcpy(&size, key.getUserData() + 4, 4);
		size = swordtoarch32(size);

		entrySize = size;        // support getEntrySize call

		entryBuf.setFillByte(0);
		entryBuf.setSize(size);
		bdtfd->seek(offset, SEEK_SET);
		bdtfd->read(entryBuf.getRawData(), size);

		rawFilter(entryBuf, 0);	// hack, decipher
		rawFilter(entryBuf, &key);

//		   if (!isUnicode())
			SWModule::prepText(entryBuf);
	}

	return entryBuf;
}
Example #3
0
std::string RawGenBook::getRawEntryImpl() const {

    uint32_t offset = 0;
    uint32_t size = 0;

    TreeKey const & key_ = getTreeKey();

    int dsize;
    key_.getUserData(&dsize);
    std::string entry;
    if (dsize > 7) {
        std::memcpy(&offset, key_.getUserData(), 4);
        offset = swordtoarch32(offset);

        std::memcpy(&size, key_.getUserData() + 4, 4);
        size = swordtoarch32(size);

        entrySize = size;        // support getEntrySize call

        entry.resize(size, '\0');
        bdtfd->seek(offset, SEEK_SET);
        bdtfd->read(&entry[0u], size);

        rawFilter(entry, nullptr);    // hack, decipher
        rawFilter(entry, &key_);
    }

    return entry;
}
Example #4
0
SWBuf &RawCom4::getRawEntryBuf() const {
	long  start = 0;
	unsigned long size = 0;
	VerseKey *key = &getVerseKey();

	findOffset(key->getTestament(), key->getTestamentIndex(), &start, &size);
	entrySize = size;        // support getEntrySize call

	entryBuf = "";
	readText(key->getTestament(), start, size, entryBuf);

	rawFilter(entryBuf, 0);	// hack, decipher
	rawFilter(entryBuf, key);

//	if (!isUnicode())
		prepText(entryBuf);

	return entryBuf;
}
Example #5
0
/******************************************************************************
 * zCom::getRawEntry	- Returns the correct verse when char * cast
 *					is requested
 *
 * RET: string buffer with verse
 */
SWBuf &zCom::getRawEntryBuf() {
	long  start = 0;
	unsigned short size = 0;
	unsigned long buffnum;
	VerseKey *key = &getVerseKey();

	findOffset(key->Testament(), key->TestamentIndex(), &start, &size, &buffnum);
	entrySize = size;        // support getEntrySize call

	entryBuf = "";
	zReadText(key->Testament(), start, size, buffnum, entryBuf);

	rawFilter(entryBuf, key);

//	if (!isUnicode())
		prepText(entryBuf);

	return entryBuf;
}