1
/******************************************************************************
2
* hrefcom.cpp - code for class 'HREFCom'- a module that produces HTML HREFs
3
* pointing to actual text desired. Uses standard
4
* files: ot and nt using indexs ??.bks ??.cps ??.vss
7
* Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
8
* CrossWire Bible Society
10
* Tempe, AZ 85280-2528
12
* This program is free software; you can redistribute it and/or modify it
13
* under the terms of the GNU General Public License as published by the
14
* Free Software Foundation version 2.
16
* This program is distributed in the hope that it will be useful, but
17
* WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
* General Public License for more details.
36
/******************************************************************************
37
* HREFCom Constructor - Initializes data for instance of HREFCom
39
* ENT: iname - Internal name for module
40
* iprefix - string to prepend to each HREF (e.g. "file://mods/com/jfb/")
41
* idesc - Name to display to user for module
42
* idisp - Display object to use for displaying
45
HREFCom::HREFCom(const char *ipath, const char *iprefix, const char *iname, const char *idesc, SWDisplay *idisp) : RawVerse(ipath), SWCom(iname, idesc, idisp)
48
stdstr(&prefix, iprefix);
52
/******************************************************************************
53
* HREFCom Destructor - Cleans up instance of HREFCom
63
/******************************************************************************
64
* HREFCom::operator char * - Returns the correct verse when char * cast
67
* RET: string buffer with verse
70
SWBuf &HREFCom::getRawEntryBuf() {
77
findOffset(key->Testament(), key->TestamentIndex(), &start, &size);
78
entrySize = size; // support getEntrySize call
82
readText(key->Testament(), start, size, tmpbuf);
84
entryBuf += tmpbuf.c_str();