[sword-svn] r1864 - in trunk: . bindings/corba/java
bindings/corba/orbitcpp include src/keys src/mgr src/modules
src/modules/comments src/modules/comments/hrefcom
src/modules/comments/rawcom src/modules/comments/rawfiles
src/modules/comments/zcom src/modules/common
src/modules/filters src/modules/genbook/rawgenbook
src/modules/lexdict src/modules/lexdict/rawld
src/modules/lexdict/rawld4 src/modules/lexdict/zld
src/modules/texts src/modules/texts/rawtext src/modules/texts/ztext
scribe at crosswire.org
scribe at crosswire.org
Sat Nov 19 23:06:42 MST 2005
Author: scribe
Date: 2005-11-19 23:06:40 -0700 (Sat, 19 Nov 2005)
New Revision: 1864
Modified:
trunk/ChangeLog
trunk/bindings/corba/java/Makefile
trunk/bindings/corba/orbitcpp/testclient.cpp
trunk/include/canon.h
trunk/include/cipherfil.h
trunk/include/echomod.h
trunk/include/encfiltmgr.h
trunk/include/filemgr.h
trunk/include/gbfosis.h
trunk/include/greeklexattribs.h
trunk/include/installmgr.h
trunk/include/localemgr.h
trunk/include/papyriplain.h
trunk/include/rawcom.h
trunk/include/rawfiles.h
trunk/include/rawgenbook.h
trunk/include/rawld.h
trunk/include/rawld4.h
trunk/include/rawstr.h
trunk/include/rawstr4.h
trunk/include/rawtext.h
trunk/include/rawverse.h
trunk/include/stringmgr.h
trunk/include/strkey.h
trunk/include/swbasicfilter.h
trunk/include/swcipher.h
trunk/include/swcom.h
trunk/include/swconfig.h
trunk/include/swfilter.h
trunk/include/swfiltermgr.h
trunk/include/swgenbook.h
trunk/include/swld.h
trunk/include/swlocale.h
trunk/include/swmgr.h
trunk/include/swmodule.h
trunk/include/swoptfilter.h
trunk/include/swsearchable.h
trunk/include/swtext.h
trunk/include/thmlvariants.h
trunk/include/treekey.h
trunk/include/treekeyidx.h
trunk/include/utf8transliterator.h
trunk/include/utilstr.h
trunk/include/versekey.h
trunk/include/zcom.h
trunk/include/zipcomprs.h
trunk/include/zld.h
trunk/include/zstr.h
trunk/include/ztext.h
trunk/include/zverse.h
trunk/src/keys/listkey.cpp
trunk/src/keys/swkey.cpp
trunk/src/keys/treekeyidx.cpp
trunk/src/keys/versekey.cpp
trunk/src/mgr/encfiltmgr.cpp
trunk/src/mgr/filemgr.cpp
trunk/src/mgr/installmgr.cpp
trunk/src/mgr/localemgr.cpp
trunk/src/mgr/markupfiltmgr.cpp
trunk/src/mgr/swlocale.cpp
trunk/src/mgr/swmgr.cpp
trunk/src/modules/comments/hrefcom/hrefcom.cpp
trunk/src/modules/comments/rawcom/rawcom.cpp
trunk/src/modules/comments/rawfiles/rawfiles.cpp
trunk/src/modules/comments/swcom.cpp
trunk/src/modules/comments/zcom/zcom.cpp
trunk/src/modules/common/rawstr.cpp
trunk/src/modules/common/rawstr4.cpp
trunk/src/modules/common/rawverse.cpp
trunk/src/modules/common/zstr.cpp
trunk/src/modules/common/zverse.cpp
trunk/src/modules/filters/cipherfil.cpp
trunk/src/modules/filters/gbfplain.cpp
trunk/src/modules/filters/gbfrtf.cpp
trunk/src/modules/filters/gbfthml.cpp
trunk/src/modules/filters/latin1utf16.cpp
trunk/src/modules/filters/plainhtml.cpp
trunk/src/modules/filters/rtfhtml.cpp
trunk/src/modules/filters/swbasicfilter.cpp
trunk/src/modules/filters/swoptfilter.cpp
trunk/src/modules/filters/thmlgbf.cpp
trunk/src/modules/filters/thmlplain.cpp
trunk/src/modules/filters/unicodertf.cpp
trunk/src/modules/filters/utf16utf8.cpp
trunk/src/modules/filters/utf8arshaping.cpp
trunk/src/modules/filters/utf8bidireorder.cpp
trunk/src/modules/filters/utf8html.cpp
trunk/src/modules/filters/utf8latin1.cpp
trunk/src/modules/filters/utf8nfc.cpp
trunk/src/modules/filters/utf8nfkd.cpp
trunk/src/modules/filters/utf8transliterator.cpp
trunk/src/modules/filters/utf8utf16.cpp
trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp
trunk/src/modules/lexdict/rawld/rawld.cpp
trunk/src/modules/lexdict/rawld4/rawld4.cpp
trunk/src/modules/lexdict/swld.cpp
trunk/src/modules/lexdict/zld/zld.cpp
trunk/src/modules/swmodule.cpp
trunk/src/modules/texts/rawtext/rawtext.cpp
trunk/src/modules/texts/swtext.cpp
trunk/src/modules/texts/ztext/ztext.cpp
trunk/usrinst.sh
Log:
Cleaned up headers to remove unnecessary includes
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/ChangeLog 2005-11-20 06:06:40 UTC (rev 1864)
@@ -1,6 +1,9 @@
API ChangeLog (see the ChangeLog in each 'apps' directory for
app specific changes
+19-Nov-2005 Troy A. Griffitts <scribe at crosswire.org>
+ Cleaned up headers to remove unnecessary includes
+
26-Oct-2005 Martin Gruner <mgruner at crosswire.org>
Added Arabic locale from Mina Magdy.
Modified: trunk/bindings/corba/java/Makefile
===================================================================
--- trunk/bindings/corba/java/Makefile 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/bindings/corba/java/Makefile 2005-11-20 06:06:40 UTC (rev 1864)
@@ -1,15 +1,12 @@
TOMCAT_HOME=/usr/local/tomcat
-JAVA_HOME=/usr/java/j2sdk1.4.2_09
-instdir=/home/scribe/src/swordweb
-JAVA=${JAVA_HOME}/bin/java
-JAVACC=${JAVA_HOME}/bin/javac
+instdir=/home/swordweb/livehtml
all: src/org/crosswire/sword/orb/SWMgr.java classes/org/crosswire/sword/orb/SwordOrb.class
src/org/crosswire/sword/orb/SWMgr.java: ../swordorb.idl
idlj -pkgTranslate swordorb org.crosswire.sword.orb -td src ../swordorb.idl
classes/org/crosswire/sword/orb/SwordOrb.class: src/org/crosswire/sword/orb/SwordOrb.java
- ${JAVACC} -classpath ${TOMCAT_HOME}/common/lib/servlet-api.jar -d classes -sourcepath src src/org/crosswire/sword/orb/*.java src/org/crosswire/util/*.java
+ javac -classpath ${TOMCAT_HOME}/common/lib/servlet-api.jar -d classes -sourcepath src src/org/crosswire/sword/orb/*.java src/org/crosswire/util/*.java
clean:
Modified: trunk/bindings/corba/orbitcpp/testclient.cpp
===================================================================
--- trunk/bindings/corba/orbitcpp/testclient.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/bindings/corba/orbitcpp/testclient.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -7,12 +7,16 @@
int main (int argc, char *argv[])
{
- if (argc != 2) {
- std::cerr << "Usage:" << std::endl << " " << argv[0] << " <IOR>" << std::endl << std::endl;
+ if (argc != 2)
+ {
+ std::cerr << "Usage:" << std::endl
+ << " " << argv[0] << " IOR" << std::endl
+ << std::endl;
return -1;
}
- try {
+ try
+ {
// Initialize ORBit
CORBA::ORB_ptr orb = CORBA::ORB_init(argc, argv, "orbit-local-orb");
@@ -40,28 +44,19 @@
std::cout << "\n";
}
*/
-// swordorb::StringList *localeNames = mgr->getAvailableLocales();
-// for (int i = 0; i < localeNames->length(); i++) {
-// std::cout << (*localeNames)[i] << "\n";
-// }
-// mgr->setDefaultLocale("de");
+ swordorb::StringList *localeNames = mgr->getAvailableLocales();
+ for (int i = 0; i < localeNames->length(); i++) {
+ std::cout << (*localeNames)[i] << "\n";
+ }
+ mgr->setDefaultLocale("de");
mgr->setJavascript(true);
-// mgr->setGlobalOption("Textual Variants", "Secondary Reading");
- mgr->setGlobalOption("Strong's Numbers", "Off");
- module = mgr->getModuleByName("LXXM");
- std::cout << "Mod Desc: " << module->getDescription() << "\n";
-
-//int i = 0;
-//for (module->begin(); i < 5; i++, module->next()) {
-// std::cout << "KeyText: " << module->getKeyText() << "\n";
- module->setKeyText("PsSol/18/2");
-// module->getRenderText();
- std::cout << "KeyText: " << module->getKeyText() << "\n";
- std::cout << "--------------\n";
- std::cout << "Raw: " << module->getRawEntry() << "\n";
- std::cout << "--------------\n";
- std::cout << "Render: " << module->getRenderText() << "\n";
-//}
+ mgr->setGlobalOption("Textual Variants", "Secondary Reading");
+ module = mgr->getModuleByName("LXX");
+ for (module->setKeyText("is.53.4"); !module->error(); module->next()) {
+ std::cout << "KeyText: " << module->getKeyText() << "\n";
+ std::cout << "Text: " << module->getRenderText() << "\n";
+ break;
+ }
/*
swordorb::SearchHitList *searchResults;
bool lucene = module->hasSearchFramework();
@@ -71,8 +66,8 @@
}
*/
-// mgr->setGlobalOption("Greek Accents", "Off");
-// std::cout << "\nFiltered text: " << mgr->filterText("Greek Accents", "ὁ θεὸς") << "\n";
+ mgr->setGlobalOption("Greek Accents", "Off");
+ std::cout << "\nFiltered text: " << mgr->filterText("Greek Accents", "ὁ θεὸς") << "\n";
} catch(const CORBA::Exception& ex) {
Modified: trunk/include/canon.h
===================================================================
--- trunk/include/canon.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/canon.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,9 +24,6 @@
* and chapmax
*/
-#include <defs.h>
-//SWORD_NAMESPACE_START
-
struct sbook
VerseKey::otbooks[] = {
{"Genesis", "Gen", 50},
@@ -698,4 +695,3 @@
, {sizeof (VerseKey::ntbks) / sizeof(long), sizeof (VerseKey::ntcps) / sizeof(long)}
};
-//SWORD_NAMESPACE_END
Modified: trunk/include/cipherfil.h
===================================================================
--- trunk/include/cipherfil.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/cipherfil.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -22,10 +22,11 @@
#define CIPHERFIL_H
#include <swfilter.h>
-#include <swcipher.h>
SWORD_NAMESPACE_START
+class SWCipher;
+
class SWDLLEXPORT CipherFilter:public SWFilter {
SWCipher *cipher;
public:
Modified: trunk/include/echomod.h
===================================================================
--- trunk/include/echomod.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/echomod.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,7 +24,6 @@
#define ECHOMOD_H
#include <swtext.h>
-#include <versekey.h>
#include <defs.h>
Modified: trunk/include/encfiltmgr.h
===================================================================
--- trunk/include/encfiltmgr.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/encfiltmgr.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -26,6 +26,8 @@
SWORD_NAMESPACE_START
+class SWFilter;
+
/** This class is like a normal SWMgr,
* but you can additonally specify which encoding
* you want to use.
Modified: trunk/include/filemgr.h
===================================================================
--- trunk/include/filemgr.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/filemgr.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -26,11 +26,11 @@
#include <fcntl.h>
#include <defs.h>
-#include <swbuf.h>
#include <swcacher.h>
SWORD_NAMESPACE_START
+class SWBuf;
class SWDLLEXPORT FileMgr;
Modified: trunk/include/gbfosis.h
===================================================================
--- trunk/include/gbfosis.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/gbfosis.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -23,6 +23,7 @@
#include <swfilter.h>
#include <stack>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/include/greeklexattribs.h
===================================================================
--- trunk/include/greeklexattribs.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/greeklexattribs.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -21,13 +21,13 @@
#ifndef GREEKLEXATTRIBS_H
#define GREEKLEXATTRIBS_H
-#include <swfilter.h>
+#include <swoptfilter.h>
SWORD_NAMESPACE_START
/** this filter converts ThML text to plain text
*/
-class SWDLLEXPORT GreekLexAttribs : public SWFilter {
+class SWDLLEXPORT GreekLexAttribs : public SWOptionFilter {
public:
GreekLexAttribs();
virtual char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0);
Modified: trunk/include/installmgr.h
===================================================================
--- trunk/include/installmgr.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/installmgr.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -5,12 +5,13 @@
#include <swbuf.h>
#include <map>
#include <set>
-#include <ftptrans.h>
SWORD_NAMESPACE_START
class SWMgr;
class SWConfig;
+class FTPTransport;
+class StatusReporter;
/** TODO: document
*/
@@ -66,7 +67,7 @@
virtual int refreshRemoteSource(InstallSource *is);
virtual bool getCipherCode(const char *modName, SWConfig *config);
void setFTPPassive(bool passive) { this->passive = passive; }
- void terminate() { if (transport) transport->terminate(); }
+ void terminate();
/************************************************************************
* isDefaultModule - allows an installation to provide a set of modules
Modified: trunk/include/localemgr.h
===================================================================
--- trunk/include/localemgr.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/localemgr.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -25,13 +25,13 @@
#include <map>
#include <list>
-#include <swconfig.h>
-#include <swlocale.h>
#include <defs.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
+class SWLocale;
typedef std::list<SWBuf> StringList;
typedef std::map < SWBuf, SWLocale *, std::less < SWBuf > > LocaleMap;
Modified: trunk/include/papyriplain.h
===================================================================
--- trunk/include/papyriplain.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/papyriplain.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -21,13 +21,13 @@
#ifndef PapyriPLAIN_H
#define PapyriPLAIN_H
-#include <swfilter.h>
+#include <swoptfilter.h>
SWORD_NAMESPACE_START
/** This filter converts Papyri text to plain text
*/
-class SWDLLEXPORT PapyriPlain : public SWFilter {
+class SWDLLEXPORT PapyriPlain : public SWOptionFilter {
public:
PapyriPlain();
virtual char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0);
Modified: trunk/include/rawcom.h
===================================================================
--- trunk/include/rawcom.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/rawcom.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -30,7 +30,7 @@
SWORD_NAMESPACE_START
-class SWDLLEXPORT RawCom:public RawVerse, public SWCom {
+class SWDLLEXPORT RawCom : public RawVerse, public SWCom {
public:
@@ -47,9 +47,7 @@
virtual void decrement(int steps) { increment(-steps); }
// write interface ----------------------------
- virtual bool isWritable() {
- return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR));
- }
+ virtual bool isWritable();
static char createModule(const char *path) { return RawVerse::createModule(path); }
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
Modified: trunk/include/rawfiles.h
===================================================================
--- trunk/include/rawfiles.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/rawfiles.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -49,9 +49,7 @@
/** Is the module writable? :)
* @return yes or no
*/
- virtual bool isWritable() {
- return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR));
- }
+ virtual bool isWritable();
/** Creates a new module
* @param path The first parameter is path of the new module
Modified: trunk/include/rawgenbook.h
===================================================================
--- trunk/include/rawgenbook.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/rawgenbook.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,12 +24,13 @@
#define RAWGENBOOK_H
#include <swgenbook.h>
-#include <filemgr.h>
#include <defs.h>
SWORD_NAMESPACE_START
+class FileDesc;
+
class SWDLLEXPORT RawGenBook : public SWGenBook {
char *path;
FileDesc *bdtfd;
@@ -44,9 +45,7 @@
virtual ~RawGenBook();
virtual SWBuf &getRawEntryBuf();
// write interface ----------------------------
- virtual bool isWritable() {
- return ((bdtfd->getFd() > 0) && ((bdtfd->mode & FileMgr::RDWR) == FileMgr::RDWR));
- }
+ virtual bool isWritable();
static char createModule(const char *ipath);
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
virtual void linkEntry(const SWKey * linkKey); // Link current module entry to other module entry
Modified: trunk/include/rawld.h
===================================================================
--- trunk/include/rawld.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/rawld.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -48,7 +48,7 @@
virtual void increment(int steps = 1);
virtual void decrement(int steps = 1) { increment(-steps); }
// write interface ----------------------------
- virtual bool isWritable() { return ((idxfd->getFd() > 0) && ((idxfd->mode & FileMgr::RDWR) == FileMgr::RDWR)); }
+ virtual bool isWritable();
static char createModule(const char *path) { return RawStr::createModule (path); }
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
Modified: trunk/include/rawld4.h
===================================================================
--- trunk/include/rawld4.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/rawld4.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -48,9 +48,7 @@
virtual void increment(int steps = 1);
virtual void decrement(int steps = 1) { increment(-steps); }
// write interface ----------------------------
- virtual bool isWritable() {
- return ((idxfd->getFd() > 0) && ((idxfd->mode & FileMgr::RDWR) == FileMgr::RDWR));
- }
+ virtual bool isWritable();
static char createModule(const char *path) { return RawStr4::createModule(path); }
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
Modified: trunk/include/rawstr.h
===================================================================
--- trunk/include/rawstr.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/rawstr.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -26,11 +26,12 @@
#define RAWSTR_H
#include <defs.h>
-#include <filemgr.h>
-#include <swbuf.h>
SWORD_NAMESPACE_START
+class SWBuf;
+class FileDesc;
+
class SWDLLEXPORT RawStr {
static int instance; // number of instantiated RawStr objects or derivitives
char *path;
Modified: trunk/include/rawstr4.h
===================================================================
--- trunk/include/rawstr4.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/rawstr4.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -25,12 +25,13 @@
#ifndef RAWSTR4_H
#define RAWSTR4_H
-#include <filemgr.h>
-#include <swbuf.h>
#include <defs.h>
SWORD_NAMESPACE_START
+class FileDesc;
+class SWBuf;
+
class SWDLLEXPORT RawStr4 {
static int instance; // number of instantiated RawStr4 objects or derivitives
char *path;
Modified: trunk/include/rawtext.h
===================================================================
--- trunk/include/rawtext.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/rawtext.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,13 +24,14 @@
#define RAWTEXT_H
#include <rawverse.h>
-#include <rawstr.h>
#include <swtext.h>
#include <defs.h>
SWORD_NAMESPACE_START
+class RawStr;
+
class SWDLLEXPORT RawText : public SWText, public RawVerse {
RawStr *fastSearch[2];
@@ -50,7 +51,7 @@
virtual bool hasSearchFramework() { return true; }
virtual ListKey &search(const char *istr, int searchType = 0, int flags = 0, SWKey * scope = 0, bool * justCheckIfSupported = 0, void (*percent)(char, void *) = &SWModule::nullPercent, void *percentUserData = 0);
// write interface ----------------------------
- virtual bool isWritable() { return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR)); }
+ virtual bool isWritable();
static char createModule(const char *path) { return RawVerse::createModule(path); }
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
Modified: trunk/include/rawverse.h
===================================================================
--- trunk/include/rawverse.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/rawverse.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,15 +8,17 @@
#ifndef RAWVERSE_H
#define RAWVERSE_H
-#include <filemgr.h>
-#include <fcntl.h>
#include <defs.h>
-#include <swbuf.h>
SWORD_NAMESPACE_START
+class FileDesc;
+class SWBuf;
+
class SWDLLEXPORT RawVerse {
+
+
static int instance; // number of instantiated RawVerse objects or derivitives
protected:
FileDesc *idxfp[2];
Modified: trunk/include/stringmgr.h
===================================================================
--- trunk/include/stringmgr.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/stringmgr.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,7 +24,7 @@
#ifndef STRINGMGR_H
#define STRINGMGR_H
-#include <swbuf.h>
+#include <defs.h>
SWORD_NAMESPACE_START
Modified: trunk/include/strkey.h
===================================================================
--- trunk/include/strkey.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/strkey.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,7 +24,6 @@
#define STRKEY_H
#include <swkey.h>
-#include <swmacs.h>
#include <defs.h>
Modified: trunk/include/swbasicfilter.h
===================================================================
--- trunk/include/swbasicfilter.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swbasicfilter.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -26,7 +26,7 @@
#define SWBASICFILTER_H
#include <swfilter.h>
-#include <map>
+#include <swbuf.h>
SWORD_NAMESPACE_START
@@ -56,6 +56,8 @@
*/
class SWDLLEXPORT SWBasicFilter : public SWFilter {
+class Private;
+
char *tokenStart;
char *tokenEnd;
char *escStart;
@@ -70,6 +72,8 @@
bool passThruUnknownEsc;
char processStages;
+
+ Private *p;
public:
SWBasicFilter();
@@ -89,10 +93,6 @@
static const char FINALIZE; // flag for indicating processing after char loop
- typedef std::map<SWBuf, SWBuf> DualStringMap;
- DualStringMap tokenSubMap;
- DualStringMap escSubMap;
-
/** Sets the beginning of escape sequence (by default "&").*/
void setEscapeStart(const char *escStart);
Modified: trunk/include/swcipher.h
===================================================================
--- trunk/include/swcipher.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swcipher.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -22,7 +22,7 @@
#ifndef SWCIPHER_H
#define SWCIPHER_H
-#include "sapphire.h"
+#include <sapphire.h>
#include <defs.h>
Modified: trunk/include/swcom.h
===================================================================
--- trunk/include/swcom.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swcom.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,18 +24,19 @@
#define SWCOM_H
#include <swmodule.h>
-#include <versekey.h>
#include <defs.h>
SWORD_NAMESPACE_START
+class VerseKey;
+class SWKey;
+
/** The basis for all commentary modules
*/
class SWDLLEXPORT SWCom : public SWModule {
- // for conversion if we have been set with a different internal key type
- mutable VerseKey tmpVK;
+ mutable VerseKey *tmpVK;
protected:
VerseKey &getVerseKey() const;
@@ -51,7 +52,7 @@
SWTextMarkup mark = FMT_UNKNOWN, const char* ilang = 0);
virtual ~SWCom();
- virtual SWKey *CreateKey() { return new VerseKey(); }
+ virtual SWKey *CreateKey();
virtual long Index() const;
virtual long Index(long iindex);
Modified: trunk/include/swconfig.h
===================================================================
--- trunk/include/swconfig.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swconfig.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -23,8 +23,6 @@
#ifndef SWCONFIG_H
#define SWCONFIG_H
-#include <stdio.h>
-
#include <map>
#include <defs.h>
Modified: trunk/include/swfilter.h
===================================================================
--- trunk/include/swfilter.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swfilter.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,17 +24,14 @@
#define SWFILTER_H
#include <defs.h>
-#include <swbuf.h>
-#include <list>
-#include <swkey.h>
SWORD_NAMESPACE_START
-/**
-* The type definitoin for option types
-*/
-typedef std::list < SWBuf > StringList;
+class SWKey;
+class SWBuf;
+class SWModule;
+
class SWModule;
/** Base class for all filters in sword.
@@ -45,38 +42,6 @@
public:
virtual ~SWFilter() {}
- /** gets the name of the option of this filter
- * @return option name
- */
- virtual const char *getOptionName () { return 0; }
-
- /** gets a short explanation of the option of this filter;
- * it could be presented to the user in frontend programs
- * @return option tip/explanation
- */
- virtual const char *getOptionTip () { return 0; }
-
- /** returns a list of the possible option values
- *
- * @return list of option values
- */
- virtual StringList getOptionValues () {
- StringList options;
- return options;
- }
-
- /** @return The value of the current option.
- */
- virtual const char *getOptionValue () { return 0; }
-
- /** sets the value of the option of this filter,
- * e.g maybe a strong's filter mioght be set to "on" / "off" -
- * that would mean to show or not to show the strongs in the text,
- * see also getOptionValues()
- * @param ival the new option value
- */
- virtual void setOptionValue (const char * ival) { }
-
/** This is the main filter function
* @param text The text to be filtered/converted
* @param key Current key That was used.
Modified: trunk/include/swfiltermgr.h
===================================================================
--- trunk/include/swfiltermgr.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swfiltermgr.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -23,15 +23,12 @@
#ifndef SWFILTERMGR_H
#define SWFILTERMGR_H
-#include <sys/types.h>
-#include <swmodule.h>
+#include <defs.h>
#include <swconfig.h>
-#include <swlog.h>
-#include <defs.h>
-
SWORD_NAMESPACE_START
+class SWModule;
class SWMgr;
/** Class to manage different kinds of filters.
@@ -42,43 +39,48 @@
SWMgr *parentMgr;
public:
- SWFilterMgr ();
- virtual ~SWFilterMgr ();
+ SWFilterMgr();
+ virtual ~SWFilterMgr();
virtual void setParentMgr(SWMgr *parentMgr);
virtual SWMgr *getParentMgr();
- virtual void AddGlobalOptions (SWModule * module, ConfigEntMap & section,
- ConfigEntMap::iterator start,
+ virtual void AddGlobalOptions(SWModule *module, ConfigEntMap §ion, ConfigEntMap::iterator start,
ConfigEntMap::iterator end);
- virtual void AddLocalOptions (SWModule * module, ConfigEntMap & section,
- ConfigEntMap::iterator start,
+ virtual void AddLocalOptions(SWModule *module, ConfigEntMap §ion, ConfigEntMap::iterator start,
ConfigEntMap::iterator end);
+
/**
* Adds the encoding filters which are defined in "section" to the SWModule object "module".
* @param module To this module the encoding filter(s) are added
* @param section We use this section to get a list of filters we should apply to the module
*/
- virtual void AddEncodingFilters (SWModule * module, ConfigEntMap & section);
+ virtual void AddEncodingFilters(SWModule *module, ConfigEntMap §ion);
+
+
/**
* Adds the render filters which are defined in "section" to the SWModule object "module".
* @param module To this module the render filter(s) are added
* @param section We use this section to get a list of filters we should apply to the module
*/
- virtual void AddRenderFilters (SWModule * module, ConfigEntMap & section);
+ virtual void AddRenderFilters(SWModule *module, ConfigEntMap §ion);
+
+
/**
* Adds the strip filters which are defined in "section" to the SWModule object "module".
* @param module To this module the strip filter(s) are added
* @param section We use this section to get a list of filters we should apply to the module
*/
- virtual void AddStripFilters (SWModule * module, ConfigEntMap & section);
+ virtual void AddStripFilters(SWModule *module, ConfigEntMap §ion);
+
+
/**
* Adds the raw filters which are defined in "section" to the SWModule object "module".
* @param module To this module the raw filter(s) are added
* @param section We use this section to get a list of filters we should apply to the module
*/
- virtual void AddRawFilters (SWModule * module, ConfigEntMap & section);
+ virtual void AddRawFilters(SWModule *module, ConfigEntMap §ion);
};
SWORD_NAMESPACE_END
Modified: trunk/include/swgenbook.h
===================================================================
--- trunk/include/swgenbook.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swgenbook.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -23,7 +23,6 @@
#define SWGENBOOK_H
#include <swmodule.h>
-#include <treekeyidx.h>
#include <defs.h>
Modified: trunk/include/swld.h
===================================================================
--- trunk/include/swld.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swld.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,7 +24,6 @@
#define SWLD_H
#include <swmodule.h>
-#include <strkey.h>
#include <defs.h>
@@ -45,7 +44,7 @@
SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
virtual ~SWLD();
- virtual SWKey *CreateKey() { return new StrKey(); }
+ virtual SWKey *CreateKey();
/** Sets/gets module KeyText, getting from saved text if key is persistent
*
Modified: trunk/include/swlocale.h
===================================================================
--- trunk/include/swlocale.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swlocale.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -23,15 +23,12 @@
#ifndef SWLOCALE_H
#define SWLOCALE_H
-#include <map>
-#include <swconfig.h>
-#include <versekey.h>
#include <defs.h>
SWORD_NAMESPACE_START
+class SWConfig;
static const int ENDOFABBREVS = -2;
-typedef std::map < SWBuf, SWBuf, std::less < SWBuf > >LookupMap;
/** SWLocale is used for the localisation of the booknames
* The SWLocale is a class which holds the information of one language.
@@ -40,8 +37,13 @@
* Another functions useful for frontend developers is @see getDescription.
*/
class SWDLLEXPORT SWLocale {
- LookupMap lookupTable;
+
+class Private;
+
+ Private *p;
+
SWConfig *localeSource;
+
char *name;
char *description;
char *encoding;
Modified: trunk/include/swmgr.h
===================================================================
--- trunk/include/swmgr.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swmgr.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -51,21 +51,28 @@
#ifndef SWMGR_H
#define SWMGR_H
-#include <sys/types.h>
#include <map>
#include <list>
-#include <swmodule.h>
+#include <swbuf.h>
#include <swconfig.h>
-#include <swlog.h>
-#include <swfiltermgr.h>
#include <defs.h>
SWORD_NAMESPACE_START
+class SWModule;
+class SWFilter;
+class SWOptionFilter;
+class SWFilterMgr;
+class SWBuf;
+class SWKey;
+
typedef std::map < SWBuf, SWModule *, std::less < SWBuf > >ModMap;
typedef std::map < SWBuf, SWFilter * >FilterMap;
+typedef std::map < SWBuf, SWOptionFilter * >OptionFilterMap;
typedef std::list < SWBuf >StringList;
+typedef std::list < SWFilter* >FilterList;
+typedef std::list < SWOptionFilter* >OptionFilterList;
/** SWMgr exposes an installed module set
*
@@ -76,9 +83,11 @@
*/
class FileDesc;
+class SWOptionFilter;
class SWDLLEXPORT SWMgr {
+
private:
bool mgrModeMultiMod;
bool augmentHome;
@@ -90,15 +99,15 @@
SWConfig *mysysconfig;
SWConfig *homeConfig;
void CreateMods(bool multiMod = false);
- SWModule *CreateMod(const char *name, const char *driver, ConfigEntMap & section);
+ SWModule *CreateMod(const char *name, const char *driver, ConfigEntMap §ion);
void DeleteMods();
char configType; // 0 = file; 1 = directory
- FilterMap optionFilters;
+ OptionFilterMap optionFilters;
FilterMap cipherFilters;
SWFilter *gbfplain;
SWFilter *thmlplain;
SWFilter *osisplain;
- SWFilter *transliterator;
+ SWOptionFilter *transliterator;
FilterList cleanupFilters;
StringList options;
virtual void init(); // use to initialize before loading modules
Modified: trunk/include/swmodule.h
===================================================================
--- trunk/include/swmodule.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swmodule.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -25,11 +25,8 @@
#define SWMODULE_H
#include <swdisp.h>
-#include <swkey.h>
#include <listkey.h>
-#include <swfilter.h>
#include <swconfig.h>
-#include <swbuf.h>
#include <swcacher.h>
#include <swsearchable.h>
@@ -37,10 +34,12 @@
#include <list>
#include <defs.h>
-#include <multimapwdef.h>
SWORD_NAMESPACE_START
+class SWOptionFilter;
+class SWFilter;
+
#define SEARCHFLAG_MATCHWHOLEENTRY 4096
#define SWMODULE_OPERATORS \
@@ -57,6 +56,7 @@
typedef std::list < SWFilter * >FilterList;
+typedef std::list < SWOptionFilter * >OptionFilterList;
typedef std::map < SWBuf, SWBuf, std::less < SWBuf > > AttributeValue;
typedef std::map < SWBuf, AttributeValue, std::less < SWBuf > > AttributeList;
typedef std::map < SWBuf, AttributeList, std::less < SWBuf > > AttributeTypeList;
@@ -125,7 +125,7 @@
FilterList *renderFilters;
/** filters to be executed to change markup to user prefs */
- FilterList *optionFilters;
+ OptionFilterList *optionFilters;
/** filters to be executed to decode text for display */
FilterList *encodingFilters;
@@ -435,17 +435,19 @@
*/
virtual void setPosition(SW_POSITION pos);
+ /** OptionFilterBuffer a text buffer
+ * @param filters the FilterList of filters to iterate
+ * @param buf the buffer to filter
+ * @param key key location from where this buffer was extracted
+ */
+ virtual void filterBuffer(OptionFilterList *filters, SWBuf &buf, SWKey *key);
+
/** FilterBuffer a text buffer
* @param filters the FilterList of filters to iterate
* @param buf the buffer to filter
* @param key key location from where this buffer was extracted
*/
- virtual void filterBuffer(FilterList *filters, SWBuf &buf, SWKey *key) {
- FilterList::iterator it;
- for (it = filters->begin(); it != filters->end(); it++) {
- (*it)->processText(buf, key, this);
- }
- }
+ virtual void filterBuffer(FilterList *filters, SWBuf &buf, SWKey *key);
/** Adds a RenderFilter to this module's renderFilters queue.
* Render Filters are called when the module is asked to produce
@@ -576,7 +578,7 @@
* @param newfilter the filter to add
* @return *this
*/
- virtual SWModule &AddOptionFilter(SWFilter *newfilter) {
+ virtual SWModule &AddOptionFilter(SWOptionFilter *newfilter) {
optionFilters->push_back(newfilter);
return *this;
}
Modified: trunk/include/swoptfilter.h
===================================================================
--- trunk/include/swoptfilter.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swoptfilter.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -22,9 +22,17 @@
#define SWOPTFILTER_H
#include <swfilter.h>
+#include <swbuf.h>
+#include <list>
SWORD_NAMESPACE_START
+/**
+* The type definitoin for option types
+*/
+typedef std::list < SWBuf > StringList;
+
+
/** Base class for all option filters.
*/
class SWDLLEXPORT SWOptionFilter : public SWFilter {
@@ -35,13 +43,41 @@
const StringList *optValues;
bool option;
public:
+
+ SWOptionFilter();
SWOptionFilter(const char *oName, const char *oTip, const StringList *oValues);
virtual ~SWOptionFilter();
+
+
+ /** gets the name of the option of this filter
+ * @return option name
+ */
virtual const char *getOptionName() { return optName; }
+
+ /** gets a short explanation of the option of this filter;
+ * it could be presented to the user in frontend programs
+ * @return option tip/explanation
+ */
virtual const char *getOptionTip() { return optTip; }
+
+ /** returns a list of the possible option values
+ *
+ * @return list of option values
+ */
+ virtual StringList getOptionValues() { return *optValues; }
+
+ /** @return The value of the current option.
+ */
+ virtual const char *getOptionValue();
+
+ /** sets the value of the option of this filter,
+ * e.g maybe a strong's filter mioght be set to "on" / "off" -
+ * that would mean to show or not to show the strongs in the text,
+ * see also getOptionValues()
+ * @param ival the new option value
+ */
virtual void setOptionValue(const char *ival);
- virtual const char *getOptionValue();
- virtual StringList getOptionValues() { return *optValues; }
+
};
SWORD_NAMESPACE_END
Modified: trunk/include/swsearchable.h
===================================================================
--- trunk/include/swsearchable.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swsearchable.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,10 +24,12 @@
#define SWSEARCHABLE_H
#include <defs.h>
-#include <listkey.h>
SWORD_NAMESPACE_START
+class ListKey;
+class SWKey;
+
/** used to provide an interface for objects that be searched.
*/
class SWDLLEXPORT SWSearchable {
Modified: trunk/include/swtext.h
===================================================================
--- trunk/include/swtext.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/swtext.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,19 +24,19 @@
#define SWTEXT_H
#include <swmodule.h>
-#include <versekey.h>
-#include <listkey.h>
#include <defs.h>
SWORD_NAMESPACE_START
+class VerseKey;
+
/** The basis for all text modules
*/
class SWDLLEXPORT SWText : public SWModule {
// for conversion if we have been set with a different internal key type
- mutable VerseKey tmpVK;
+ mutable VerseKey *tmpVK;
protected:
VerseKey &getVerseKey() const;
Modified: trunk/include/thmlvariants.h
===================================================================
--- trunk/include/thmlvariants.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/thmlvariants.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -21,14 +21,13 @@
#ifndef THMLVARIANTS_H
#define THMLVARIANTS_H
-#include <swfilter.h>
-#include <swmodule.h>
+#include <swoptfilter.h>
SWORD_NAMESPACE_START
/** This Filter shows/hides textual variants
*/
-class SWDLLEXPORT ThMLVariants : public SWFilter {
+class SWDLLEXPORT ThMLVariants : public SWOptionFilter {
char option;
static const char primary[];
Modified: trunk/include/treekey.h
===================================================================
--- trunk/include/treekey.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/treekey.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,7 +24,6 @@
#define TREEKEY_H
#include <swkey.h>
-#include <swmacs.h>
#include <defs.h>
Modified: trunk/include/treekeyidx.h
===================================================================
--- trunk/include/treekeyidx.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/treekeyidx.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -25,10 +25,11 @@
#include <treekey.h>
#include <sysdata.h>
-#include <filemgr.h>
SWORD_NAMESPACE_START
+class FileDesc;
+
/**
* Class TreeKeyIdx
* The TreeKey implementation used for all tree-based modules in Sword, such as GenBooks.
Modified: trunk/include/utf8transliterator.h
===================================================================
--- trunk/include/utf8transliterator.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/utf8transliterator.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -25,8 +25,7 @@
#define NUMSCRIPTS 50
#define NUMTARGETSCRIPTS NUMSCRIPTS-3//6
-#include <swfilter.h>
-#include <swmodule.h>
+#include <swoptfilter.h>
#include <unicode/unistr.h>
@@ -37,11 +36,13 @@
SWORD_NAMESPACE_START
+class SWModule;
+
struct SWTransData {
UnicodeString resource;
UTransDirection dir;
};
-typedef std::map <const UnicodeString, SWTransData> SWTransMap;
+typedef std::map<const UnicodeString, SWTransData> SWTransMap;
typedef std::pair<UnicodeString, SWTransData> SWTransPair;
// Chris, please add more javadoc-style documentation in this header file
@@ -50,7 +51,7 @@
/** This Filter uses ICU for transliteration
*/
-class SWDLLEXPORT UTF8Transliterator : public SWFilter {
+class SWDLLEXPORT UTF8Transliterator : public SWOptionFilter {
private:
char option;
Modified: trunk/include/utilstr.h
===================================================================
--- trunk/include/utilstr.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/utilstr.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -22,8 +22,6 @@
#ifndef UTILSTR_H
#define UTILSTR_H
-#include <swbuf.h>
-#include <stringmgr.h>
#include <defs.h>
SWORD_NAMESPACE_START
Modified: trunk/include/versekey.h
===================================================================
--- trunk/include/versekey.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/versekey.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -26,7 +26,6 @@
#include <swkey.h>
#include <swmacs.h>
#include <listkey.h>
-#include <ctype.h>
#include <defs.h>
@@ -72,7 +71,8 @@
* Class VerseKey
* The SWKey implementation used for verse based modules like Bibles or commentaries.
*/
-class SWDLLEXPORT VerseKey:public SWKey {
+class SWDLLEXPORT VerseKey : public SWKey {
+
class LocaleCache {
public:
char *name;
@@ -350,7 +350,7 @@
* @return if unchanged -> value of autonorm,
* if changed -> previous value of autonorm
*/
- virtual char AutoNormalize(char iautonorm = MAXPOS (char));
+ virtual char AutoNormalize(char iautonorm = MAXPOS(char));
/** Sets/gets flag that tells VerseKey to include
* chapter/book/testament/module headings
@@ -360,7 +360,7 @@
* @return if unchanged -> value of headings,
* if changed -> previous value of headings
*/
- virtual char Headings(char iheadings = MAXPOS (char));
+ virtual char Headings(char iheadings = MAXPOS(char));
virtual long NewIndex() const;
Modified: trunk/include/zcom.h
===================================================================
--- trunk/include/zcom.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/zcom.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -23,15 +23,13 @@
#ifndef ZCOM_H
#define ZCOM_H
-#include <rawverse.h>
#include <swcom.h>
-#include <swcomprs.h>
#include <defs.h>
SWORD_NAMESPACE_START
-class SWDLLEXPORT zCom:public zVerse, public SWCom {
+class SWDLLEXPORT zCom : public zVerse, public SWCom {
VerseKey *lastWriteKey;
bool sameBlock(VerseKey * lastWriteKey, VerseKey * key);
@@ -51,9 +49,7 @@
virtual void decrement(int steps = 1) { increment(-steps); }
// write interface ----------------------------
- virtual bool isWritable() {
- return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR));
- }
+ virtual bool isWritable();
static char createModule(const char *path, int blockBound) {
return zVerse::createModule(path, blockBound);
}
Modified: trunk/include/zipcomprs.h
===================================================================
--- trunk/include/zipcomprs.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/zipcomprs.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -28,14 +28,15 @@
SWORD_NAMESPACE_START
-class SWDLLEXPORT ZipCompress:public SWCompress
-{
+class SWDLLEXPORT ZipCompress : public SWCompress {
+
protected:
public:
- ZipCompress ();
- virtual ~ ZipCompress ();
- virtual void Encode (void);
- virtual void Decode (void);
+ ZipCompress();
+ virtual ~ZipCompress();
+
+ virtual void Encode(void);
+ virtual void Decode(void);
};
SWORD_NAMESPACE_END
Modified: trunk/include/zld.h
===================================================================
--- trunk/include/zld.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/zld.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -47,9 +47,7 @@
virtual void decrement(int steps = 1) { increment(-steps); }
// write interface ----------------------------
- virtual bool isWritable() {
- return ((idxfd->getFd() > 0) && ((idxfd->mode & FileMgr::RDWR) == FileMgr::RDWR));
- }
+ virtual bool isWritable();
static char createModule(const char *path) {
return zStr::createModule(path);
}
Modified: trunk/include/zstr.h
===================================================================
--- trunk/include/zstr.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/zstr.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -25,14 +25,14 @@
#ifndef ZSTR_H
#define ZSTR_H
-#include <filemgr.h>
-#include <swbuf.h>
#include <defs.h>
SWORD_NAMESPACE_START
class SWCompress;
class EntriesBlock;
+class FileDesc;
+class SWBuf;
class SWDLLEXPORT zStr {
Modified: trunk/include/ztext.h
===================================================================
--- trunk/include/ztext.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/ztext.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -24,9 +24,7 @@
#define ZTEXT_H
#include <zverse.h>
-#include <rawstr.h>
#include <swtext.h>
-//#include <swcomprs.h>
#include <defs.h>
@@ -66,7 +64,7 @@
virtual void decrement(int steps = 1) { increment(-steps); }
// write interface ----------------------------
- virtual bool isWritable() { return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR)); }
+ virtual bool isWritable();
static char createModule(const char *path, int blockBound) {
return zVerse::createModule(path, blockBound);
}
Modified: trunk/include/zverse.h
===================================================================
--- trunk/include/zverse.h 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/include/zverse.h 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,15 +8,14 @@
#ifndef ZVERSE_H
#define ZVERSE_H
-#include <filemgr.h>
-#include <fcntl.h>
-#include <rawverse.h>
-#include <swcomprs.h>
-
#include <defs.h>
SWORD_NAMESPACE_START
+class FileDesc;
+class SWCompress;
+class SWBuf;
+
class SWDLLEXPORT zVerse {
SWCompress *compressor;
@@ -46,8 +45,10 @@
char nl;
- zVerse(const char *ipath, int fileMode = FileMgr::RDONLY, int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0);
+ // fileMode default = RDONLY
+ zVerse(const char *ipath, int fileMode = -1, int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0);
virtual ~zVerse();
+
void findOffset(char testmt, long idxoff, long *start, unsigned short *end);
void zReadText(char testmt, long start, unsigned short size, SWBuf &buf);
virtual void rawZFilter(SWBuf &buf, char direction = 0) {}
Modified: trunk/src/keys/listkey.cpp
===================================================================
--- trunk/src/keys/listkey.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/keys/listkey.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <swkey.h>
#include <listkey.h>
+#include <string.h>
SWORD_NAMESPACE_START
Modified: trunk/src/keys/swkey.cpp
===================================================================
--- trunk/src/keys/swkey.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/keys/swkey.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -6,6 +6,7 @@
#include <swkey.h>
#include <utilstr.h>
+#include <string.h>
SWORD_NAMESPACE_START
Modified: trunk/src/keys/treekeyidx.cpp
===================================================================
--- trunk/src/keys/treekeyidx.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/keys/treekeyidx.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -27,6 +27,8 @@
#include <swlog.h>
#include <utilstr.h>
+#include <filemgr.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/keys/versekey.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -13,6 +13,7 @@
#include <swlog.h>
#include <versekey.h>
#include <localemgr.h>
+#include <swlocale.h>
#include <roman.h>
SWORD_NAMESPACE_START
Modified: trunk/src/mgr/encfiltmgr.cpp
===================================================================
--- trunk/src/mgr/encfiltmgr.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/mgr/encfiltmgr.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -29,6 +29,7 @@
#include <utf8latin1.h>
#include <utf8utf16.h>
#include <utf8html.h>
+#include <swmodule.h>
#include <swmgr.h>
Modified: trunk/src/mgr/filemgr.cpp
===================================================================
--- trunk/src/mgr/filemgr.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/mgr/filemgr.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -29,6 +29,7 @@
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
+#include <swbuf.h>
#if !defined(__GNUC__) && !defined(_WIN32_WCE)
#include <io.h>
#include <direct.h>
Modified: trunk/src/mgr/installmgr.cpp
===================================================================
--- trunk/src/mgr/installmgr.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/mgr/installmgr.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -101,6 +101,8 @@
}
+void InstallMgr::terminate() { if (transport) transport->terminate(); }
+
int InstallMgr::removeModule(SWMgr *manager, const char *moduleName) {
SectionMap::iterator module;
ConfigEntMap::iterator fileBegin;
Modified: trunk/src/mgr/localemgr.cpp
===================================================================
--- trunk/src/mgr/localemgr.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/mgr/localemgr.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -33,6 +33,8 @@
#include <stringmgr.h>
#include <filemgr.h>
#include <localemgr.h>
+#include <swlocale.h>
+#include <swlog.h>
SWORD_NAMESPACE_START
Modified: trunk/src/mgr/markupfiltmgr.cpp
===================================================================
--- trunk/src/mgr/markupfiltmgr.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/mgr/markupfiltmgr.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -38,6 +38,7 @@
#include <gbfwebif.h>
#include <thmlwebif.h>
#include <osiswebif.h>
+#include <swmodule.h>
#include <markupfiltmgr.h>
Modified: trunk/src/mgr/swlocale.cpp
===================================================================
--- trunk/src/mgr/swlocale.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/mgr/swlocale.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -22,10 +22,23 @@
#include <swlocale.h>
#include <utilstr.h>
+#include <map>
+#include <swconfig.h>
+#include <versekey.h>
SWORD_NAMESPACE_START
+typedef std::map < SWBuf, SWBuf, std::less < SWBuf > >LookupMap;
+
+// I have bridge patterns, but this hides swconfig and map from lots o stuff
+class SWLocale::Private {
+public:
+ LookupMap lookupTable;
+};
+
+
SWLocale::SWLocale(const char * ifilename) {
+ p = new Private;
ConfigEntMap::iterator confEntry;
name = 0;
@@ -72,19 +85,20 @@
delete [] BMAX;
delete [] books;
}
+ delete p;
}
const char *SWLocale::translate(const char *text) {
LookupMap::iterator entry;
- entry = lookupTable.find(text);
+ entry = p->lookupTable.find(text);
- if (entry == lookupTable.end()) {
+ if (entry == p->lookupTable.end()) {
ConfigEntMap::iterator confEntry;
confEntry = localeSource->Sections["Text"].find(text);
if (confEntry == localeSource->Sections["Text"].end())
- lookupTable.insert(LookupMap::value_type(text, text));
+ p->lookupTable.insert(LookupMap::value_type(text, text));
else {//valid value found
/*
- If Encoding==Latin1 and we have a StringHelper, convert to UTF-8
@@ -94,21 +108,21 @@
*/
/* if (StringHelper::getSystemStringHelper()) {
if (!strcmp(encoding, "UTF-8")) {
- lookupTable.insert(LookupMap::value_type(text, (*confEntry).second.c_str()));
+ p->lookupTable.insert(LookupMap::value_type(text, (*confEntry).second.c_str()));
}
else { //latin1 expected, convert to UTF-8
SWBuf t((*confEntry).second.c_str());
t = StringHelper::getSystemStringHelper()->latin2unicode( t );
- lookupTable.insert(LookupMap::value_type(text, t.c_str()));
+ p->lookupTable.insert(LookupMap::value_type(text, t.c_str()));
}
}
else { //no stringhelper, just insert. Nothing we can do*/
- lookupTable.insert(LookupMap::value_type(text, (*confEntry).second.c_str()));
+ p->lookupTable.insert(LookupMap::value_type(text, (*confEntry).second.c_str()));
// }
}
- entry = lookupTable.find(text);
+ entry = p->lookupTable.find(text);
}
return (*entry).second.c_str();
}
Modified: trunk/src/mgr/swmgr.cpp
===================================================================
--- trunk/src/mgr/swmgr.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/mgr/swmgr.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -32,6 +32,7 @@
#include <swmgr.h>
#include <rawtext.h>
+#include <filemgr.h>
#include <rawgenbook.h>
#include <rawcom.h>
#include <hrefcom.h>
@@ -72,6 +73,8 @@
#include <utf8hebrewpoints.h>
#include <greeklexattribs.h>
#include <swfiltermgr.h>
+#include <swcipher.h>
+#include <swoptfilter.h>
#include <swlog.h>
@@ -110,7 +113,7 @@
#endif
void SWMgr::init() {
- SWFilter *tmpFilter = 0;
+ SWOptionFilter *tmpFilter = 0;
configPath = 0;
prefixPath = 0;
configType = 0;
@@ -123,105 +126,105 @@
optionFilters.clear();
cleanupFilters.clear();
tmpFilter = new ThMLVariants();
- optionFilters.insert(FilterMap::value_type("ThMLVariants", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("ThMLVariants", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new GBFStrongs();
- optionFilters.insert(FilterMap::value_type("GBFStrongs", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("GBFStrongs", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new GBFFootnotes();
- optionFilters.insert(FilterMap::value_type("GBFFootnotes", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("GBFFootnotes", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new GBFRedLetterWords();
- optionFilters.insert(FilterMap::value_type("GBFRedLetterWords", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("GBFRedLetterWords", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new GBFMorph();
- optionFilters.insert(FilterMap::value_type("GBFMorph", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("GBFMorph", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new GBFHeadings();
- optionFilters.insert(FilterMap::value_type("GBFHeadings", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("GBFHeadings", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new OSISHeadings();
- optionFilters.insert(FilterMap::value_type("OSISHeadings", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("OSISHeadings", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new OSISStrongs();
- optionFilters.insert(FilterMap::value_type("OSISStrongs", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("OSISStrongs", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new OSISMorph();
- optionFilters.insert(FilterMap::value_type("OSISMorph", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("OSISMorph", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new OSISLemma();
- optionFilters.insert(FilterMap::value_type("OSISLemma", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("OSISLemma", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new OSISFootnotes();
- optionFilters.insert(FilterMap::value_type("OSISFootnotes", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("OSISFootnotes", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new OSISScripref();
- optionFilters.insert(FilterMap::value_type("OSISScripref", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("OSISScripref", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new OSISRedLetterWords();
- optionFilters.insert(FilterMap::value_type("OSISRedLetterWords", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("OSISRedLetterWords", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new ThMLStrongs();
- optionFilters.insert(FilterMap::value_type("ThMLStrongs", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("ThMLStrongs", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new ThMLFootnotes();
- optionFilters.insert(FilterMap::value_type("ThMLFootnotes", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("ThMLFootnotes", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new ThMLMorph();
- optionFilters.insert(FilterMap::value_type("ThMLMorph", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("ThMLMorph", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new ThMLHeadings();
- optionFilters.insert(FilterMap::value_type("ThMLHeadings", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("ThMLHeadings", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new ThMLLemma();
- optionFilters.insert(FilterMap::value_type("ThMLLemma", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("ThMLLemma", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new ThMLScripref();
- optionFilters.insert(FilterMap::value_type("ThMLScripref", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("ThMLScripref", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new UTF8GreekAccents();
- optionFilters.insert(FilterMap::value_type("UTF8GreekAccents", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("UTF8GreekAccents", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new UTF8HebrewPoints();
- optionFilters.insert(FilterMap::value_type("UTF8HebrewPoints", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("UTF8HebrewPoints", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new UTF8Cantillation();
- optionFilters.insert(FilterMap::value_type("UTF8Cantillation", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("UTF8Cantillation", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new GreekLexAttribs();
- optionFilters.insert(FilterMap::value_type("GreekLexAttribs", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("GreekLexAttribs", tmpFilter));
cleanupFilters.push_back(tmpFilter);
tmpFilter = new PapyriPlain();
- optionFilters.insert(FilterMap::value_type("PapyriPlain", tmpFilter));
+ optionFilters.insert(OptionFilterMap::value_type("PapyriPlain", tmpFilter));
cleanupFilters.push_back(tmpFilter);
// UTF8Transliterator needs to be handled differently because it should always available as an option, for all modules
#ifdef _ICU_
transliterator = new UTF8Transliterator();
- optionFilters.insert(FilterMap::value_type("UTF8Transliterator", transliterator));
+ optionFilters.insert(OptionFilterMap::value_type("UTF8Transliterator", transliterator));
options.push_back(transliterator->getOptionName());
cleanupFilters.push_back(transliterator);
#endif
@@ -835,7 +838,7 @@
void SWMgr::AddGlobalOptions(SWModule *module, ConfigEntMap §ion, ConfigEntMap::iterator start, ConfigEntMap::iterator end) {
for (;start != end; start++) {
- FilterMap::iterator it;
+ OptionFilterMap::iterator it;
it = optionFilters.find((*start).second);
if (it != optionFilters.end()) {
module->AddOptionFilter((*it).second); // add filter to module and option as a valid option
@@ -859,7 +862,7 @@
char SWMgr::filterText(const char *filterName, SWBuf &text, const SWKey *key, const SWModule *module)
{
char retVal = -1;
- for (FilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
+ for (OptionFilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
if ((*it).second->getOptionName()) {
if (!stricmp(filterName, (*it).second->getOptionName()))
retVal = it->second->processText(text, key, module); // add filter to module
@@ -872,7 +875,7 @@
void SWMgr::AddLocalOptions(SWModule *module, ConfigEntMap §ion, ConfigEntMap::iterator start, ConfigEntMap::iterator end)
{
for (;start != end; start++) {
- FilterMap::iterator it;
+ OptionFilterMap::iterator it;
it = optionFilters.find((*start).second);
if (it != optionFilters.end()) {
module->AddOptionFilter((*it).second); // add filter to module
@@ -888,7 +891,7 @@
void SWMgr::AddStripFilters(SWModule *module, ConfigEntMap §ion, ConfigEntMap::iterator start, ConfigEntMap::iterator end)
{
for (;start != end; start++) {
- FilterMap::iterator it;
+ OptionFilterMap::iterator it;
it = optionFilters.find((*start).second);
if (it != optionFilters.end()) {
module->AddStripFilter((*it).second); // add filter to module
@@ -1124,7 +1127,7 @@
void SWMgr::setGlobalOption(const char *option, const char *value)
{
- for (FilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
+ for (OptionFilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
if ((*it).second->getOptionName()) {
if (!stricmp(option, (*it).second->getOptionName()))
(*it).second->setOptionValue(value);
@@ -1135,7 +1138,7 @@
const char *SWMgr::getGlobalOption(const char *option)
{
- for (FilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
+ for (OptionFilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
if ((*it).second->getOptionName()) {
if (!stricmp(option, (*it).second->getOptionName()))
return (*it).second->getOptionValue();
@@ -1147,7 +1150,7 @@
const char *SWMgr::getGlobalOptionTip(const char *option)
{
- for (FilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
+ for (OptionFilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
if ((*it).second->getOptionName()) {
if (!stricmp(option, (*it).second->getOptionName()))
return (*it).second->getOptionTip();
@@ -1166,7 +1169,7 @@
StringList SWMgr::getGlobalOptionValues(const char *option)
{
StringList options;
- for (FilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
+ for (OptionFilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
if ((*it).second->getOptionName()) {
if (!stricmp(option, (*it).second->getOptionName())) {
options = (*it).second->getOptionValues();
Modified: trunk/src/modules/comments/hrefcom/hrefcom.cpp
===================================================================
--- trunk/src/modules/comments/hrefcom/hrefcom.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/comments/hrefcom/hrefcom.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -13,6 +13,7 @@
#include <rawverse.h>
#include <hrefcom.h>
#include <swbuf.h>
+#include <versekey.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/comments/rawcom/rawcom.cpp
===================================================================
--- trunk/src/modules/comments/rawcom/rawcom.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/comments/rawcom/rawcom.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,8 +8,10 @@
#include <stdio.h>
#include <fcntl.h>
+#include <filemgr.h>
#include <rawverse.h>
#include <rawcom.h>
+#include <versekey.h>
SWORD_NAMESPACE_START
@@ -36,6 +38,9 @@
}
+bool RawCom::isWritable() {
+ return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR));
+}
/******************************************************************************
* RawCom::getRawEntry() - Returns the correct verse when char * cast
* is requested
Modified: trunk/src/modules/comments/rawfiles/rawfiles.cpp
===================================================================
--- trunk/src/modules/comments/rawfiles/rawfiles.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/comments/rawfiles/rawfiles.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -12,6 +12,7 @@
#include <rawverse.h>
#include <rawfiles.h>
#include <filemgr.h>
+#include <versekey.h>
SWORD_NAMESPACE_START
@@ -37,6 +38,14 @@
}
+/** Is the module writable? :)
+* @return yes or no
+*/
+bool RawFiles::isWritable() {
+ return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR));
+}
+
+
/******************************************************************************
* RawFiles::getRawEntry - Returns the correct verse when char * cast
* is requested
Modified: trunk/src/modules/comments/swcom.cpp
===================================================================
--- trunk/src/modules/comments/swcom.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/comments/swcom.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -5,6 +5,7 @@
#include <swcom.h>
#include <localemgr.h>
+#include <versekey.h>
SWORD_NAMESPACE_START
@@ -16,9 +17,10 @@
* idisp - Display object to use for displaying
*/
-SWCom::SWCom(const char *imodname, const char *imoddesc, SWDisplay *idisp, SWTextEncoding enc, SWTextDirection dir, SWTextMarkup mark, const char* ilang): SWModule(imodname, imoddesc, idisp, "Commentaries", enc, dir, mark, ilang), tmpVK() {
+SWCom::SWCom(const char *imodname, const char *imoddesc, SWDisplay *idisp, SWTextEncoding enc, SWTextDirection dir, SWTextMarkup mark, const char* ilang): SWModule(imodname, imoddesc, idisp, "Commentaries", enc, dir, mark, ilang) {
delete key;
key = CreateKey();
+ tmpVK = new VerseKey();
}
@@ -27,9 +29,13 @@
*/
SWCom::~SWCom() {
+ delete tmpVK;
}
+SWKey *SWCom::CreateKey() { return new VerseKey(); }
+
+
long SWCom::Index() const {
VerseKey *key = 0;
SWTRY {
@@ -89,9 +95,9 @@
}
}
if (!key) {
- tmpVK.setLocale(LocaleMgr::getSystemLocaleMgr()->getDefaultLocaleName());
- tmpVK = *(this->key);
- return tmpVK;
+ tmpVK->setLocale(LocaleMgr::getSystemLocaleMgr()->getDefaultLocaleName());
+ (*tmpVK) = *(this->key);
+ return (*tmpVK);
}
else return *key;
}
Modified: trunk/src/modules/comments/zcom/zcom.cpp
===================================================================
--- trunk/src/modules/comments/zcom/zcom.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/comments/zcom/zcom.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -9,7 +9,9 @@
#include <fcntl.h>
#include <zverse.h>
+#include <versekey.h>
#include <zcom.h>
+#include <filemgr.h>
SWORD_NAMESPACE_START
@@ -41,6 +43,12 @@
delete lastWriteKey;
}
+
+bool zCom::isWritable() {
+ return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR));
+}
+
+
/******************************************************************************
* zCom::getRawEntry - Returns the correct verse when char * cast
* is requested
Modified: trunk/src/modules/common/rawstr.cpp
===================================================================
--- trunk/src/modules/common/rawstr.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/common/rawstr.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -15,6 +15,9 @@
#include <rawstr.h>
#include <sysdata.h>
#include <swlog.h>
+#include <filemgr.h>
+#include <swbuf.h>
+#include <stringmgr.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/common/rawstr4.cpp
===================================================================
--- trunk/src/modules/common/rawstr4.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/common/rawstr4.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -15,6 +15,9 @@
#include <rawstr4.h>
#include <sysdata.h>
#include <swlog.h>
+#include <filemgr.h>
+#include <swbuf.h>
+#include <stringmgr.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/common/rawverse.cpp
===================================================================
--- trunk/src/modules/common/rawverse.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/common/rawverse.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -15,6 +15,8 @@
#include <rawverse.h>
#include <versekey.h>
#include <sysdata.h>
+#include <filemgr.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/common/zstr.cpp
===================================================================
--- trunk/src/modules/common/zstr.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/common/zstr.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -16,6 +16,9 @@
#include <sysdata.h>
#include <entriesblk.h>
#include <swlog.h>
+#include <stringmgr.h>
+#include <filemgr.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/common/zverse.cpp
===================================================================
--- trunk/src/modules/common/zverse.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/common/zverse.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -17,6 +17,8 @@
#include <zverse.h>
#include <sysdata.h>
#include <swbuf.h>
+#include <filemgr.h>
+#include <swcomprs.h>
SWORD_NAMESPACE_START
@@ -41,6 +43,9 @@
zVerse::zVerse(const char *ipath, int fileMode, int blockType, SWCompress *icomp)
{
+ // this line, instead of just defaulting, to keep FileMgr out of header
+ if (fileMode == -1) fileMode = FileMgr::RDONLY;
+
SWBuf buf;
nl = '\n';
Modified: trunk/src/modules/filters/cipherfil.cpp
===================================================================
--- trunk/src/modules/filters/cipherfil.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/cipherfil.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -6,6 +6,8 @@
#include <stdlib.h>
#include <cipherfil.h>
+#include <swcipher.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/gbfplain.cpp
===================================================================
--- trunk/src/modules/filters/gbfplain.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/gbfplain.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <gbfplain.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/gbfrtf.cpp
===================================================================
--- trunk/src/modules/filters/gbfrtf.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/gbfrtf.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -7,6 +7,7 @@
#include <gbfrtf.h>
#include <utilstr.h>
#include <ctype.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/gbfthml.cpp
===================================================================
--- trunk/src/modules/filters/gbfthml.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/gbfthml.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <gbfthml.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/latin1utf16.cpp
===================================================================
--- trunk/src/modules/filters/latin1utf16.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/latin1utf16.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <latin1utf16.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/plainhtml.cpp
===================================================================
--- trunk/src/modules/filters/plainhtml.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/plainhtml.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -16,6 +16,7 @@
***************************************************************************/
#include <plainhtml.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/rtfhtml.cpp
===================================================================
--- trunk/src/modules/filters/rtfhtml.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/rtfhtml.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <rtfhtml.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/swbasicfilter.cpp
===================================================================
--- trunk/src/modules/filters/swbasicfilter.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/swbasicfilter.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -27,15 +27,29 @@
#include <stdio.h>
#include <stdarg.h>
#include <utilstr.h>
+#include <stringmgr.h>
+#include <map>
SWORD_NAMESPACE_START
+typedef std::map<SWBuf, SWBuf> DualStringMap;
+
+// I hate bridge patterns but this isolates std::map from a ton of filters
+class SWBasicFilter::Private {
+public:
+ DualStringMap tokenSubMap;
+ DualStringMap escSubMap;
+};
+
const char SWBasicFilter::INITIALIZE = 1;
const char SWBasicFilter::PRECHAR = 2;
const char SWBasicFilter::POSTCHAR = 4;
const char SWBasicFilter::FINALIZE = 8;
SWBasicFilter::SWBasicFilter() {
+
+ p = new Private;
+
processStages = 0;
tokenStart = 0;
tokenEnd = 0;
@@ -54,6 +68,23 @@
}
+SWBasicFilter::~SWBasicFilter() {
+ if (tokenStart)
+ delete [] tokenStart;
+
+ if (tokenEnd)
+ delete [] tokenEnd;
+
+ if (escStart)
+ delete [] escStart;
+
+ if (escEnd)
+ delete [] escEnd;
+
+ delete p;
+}
+
+
void SWBasicFilter::setPassThruUnknownToken(bool val) {
passThruUnknownToken = val;
}
@@ -74,37 +105,22 @@
}
-SWBasicFilter::~SWBasicFilter() {
- if (tokenStart)
- delete [] tokenStart;
-
- if (tokenEnd)
- delete [] tokenEnd;
-
- if (escStart)
- delete [] escStart;
-
- if (escEnd)
- delete [] escEnd;
-}
-
-
void SWBasicFilter::addTokenSubstitute(const char *findString, const char *replaceString) {
char *buf = 0;
if (!tokenCaseSensitive) {
stdstr(&buf, findString);
toupperstr(buf);
- tokenSubMap[buf] = replaceString;
+ p->tokenSubMap[buf] = replaceString;
delete [] buf;
}
- else tokenSubMap[findString] = replaceString;
+ else p->tokenSubMap[findString] = replaceString;
}
void SWBasicFilter::removeTokenSubstitute(const char *findString) {
- if (tokenSubMap.find(findString) != tokenSubMap.end()) {
- tokenSubMap.erase( tokenSubMap.find(findString) );
+ if (p->tokenSubMap.find(findString) != p->tokenSubMap.end()) {
+ p->tokenSubMap.erase( p->tokenSubMap.find(findString) );
}
}
@@ -114,15 +130,15 @@
if (!escStringCaseSensitive) {
stdstr(&buf, findString);
toupperstr(buf);
- escSubMap.insert(DualStringMap::value_type(buf, replaceString));
+ p->escSubMap.insert(DualStringMap::value_type(buf, replaceString));
delete [] buf;
}
- else escSubMap.insert(DualStringMap::value_type(findString, replaceString));
+ else p->escSubMap.insert(DualStringMap::value_type(findString, replaceString));
}
void SWBasicFilter::removeEscapeStringSubstitute(const char *findString) {
- if (escSubMap.find(findString) != escSubMap.end()) {
- escSubMap.erase( escSubMap.find(findString) );
+ if (p->escSubMap.find(findString) != p->escSubMap.end()) {
+ p->escSubMap.erase( p->escSubMap.find(findString) );
}
}
@@ -133,12 +149,12 @@
char *tmp = 0;
stdstr(&tmp, token);
toupperstr(tmp);
- it = tokenSubMap.find(tmp);
+ it = p->tokenSubMap.find(tmp);
delete [] tmp;
} else
- it = tokenSubMap.find(token);
+ it = p->tokenSubMap.find(token);
- if (it != tokenSubMap.end()) {
+ if (it != p->tokenSubMap.end()) {
buf += it->second.c_str();
return true;
}
@@ -152,12 +168,12 @@
char *tmp = 0;
stdstr(&tmp, escString);
toupperstr(tmp);
- it = escSubMap.find(tmp);
+ it = p->escSubMap.find(tmp);
delete [] tmp;
} else
- it = escSubMap.find(escString);
+ it = p->escSubMap.find(escString);
- if (it != escSubMap.end()) {
+ if (it != p->escSubMap.end()) {
buf += it->second.c_str();
return true;
}
Modified: trunk/src/modules/filters/swoptfilter.cpp
===================================================================
--- trunk/src/modules/filters/swoptfilter.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/swoptfilter.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -10,6 +10,14 @@
SWORD_NAMESPACE_START
+SWOptionFilter::SWOptionFilter() {
+ static StringList empty;
+ static char *empty2 = "";
+ optName = empty2;
+ optTip = empty2;
+ optValues = ∅
+}
+
SWOptionFilter::SWOptionFilter(const char *oName, const char *oTip, const StringList *oValues) {
optName = oName;
optTip = oTip;
Modified: trunk/src/modules/filters/thmlgbf.cpp
===================================================================
--- trunk/src/modules/filters/thmlgbf.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/thmlgbf.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <thmlgbf.h>
#include <utilstr.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/thmlplain.cpp
===================================================================
--- trunk/src/modules/filters/thmlplain.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/thmlplain.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <thmlplain.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/unicodertf.cpp
===================================================================
--- trunk/src/modules/filters/unicodertf.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/unicodertf.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <unicodertf.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/utf16utf8.cpp
===================================================================
--- trunk/src/modules/filters/utf16utf8.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/utf16utf8.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <utf16utf8.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/utf8arshaping.cpp
===================================================================
--- trunk/src/modules/filters/utf8arshaping.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/utf8arshaping.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -11,6 +11,7 @@
#include <utilstr.h>
#include <utf8arshaping.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/utf8bidireorder.cpp
===================================================================
--- trunk/src/modules/filters/utf8bidireorder.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/utf8bidireorder.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -11,6 +11,7 @@
#include <utilstr.h>
#include <utf8bidireorder.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/utf8html.cpp
===================================================================
--- trunk/src/modules/filters/utf8html.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/utf8html.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <utf8html.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/utf8latin1.cpp
===================================================================
--- trunk/src/modules/filters/utf8latin1.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/utf8latin1.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <utf8latin1.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/utf8nfc.cpp
===================================================================
--- trunk/src/modules/filters/utf8nfc.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/utf8nfc.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -11,6 +11,7 @@
#include <utilstr.h>
#include <utf8nfc.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/utf8nfkd.cpp
===================================================================
--- trunk/src/modules/filters/utf8nfkd.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/utf8nfkd.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -11,6 +11,7 @@
#include <utilstr.h>
#include <utf8nfkd.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/filters/utf8transliterator.cpp
===================================================================
--- trunk/src/modules/filters/utf8transliterator.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/utf8transliterator.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -13,6 +13,7 @@
#include <unicode/ucnv.h>
#include <unicode/uchar.h>
#include <utf8transliterator.h>
+#include <swmodule.h>
#ifndef _ICUSWORD_
#include "unicode/resbund.h"
Modified: trunk/src/modules/filters/utf8utf16.cpp
===================================================================
--- trunk/src/modules/filters/utf8utf16.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/filters/utf8utf16.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <utf8utf16.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
Modified: trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp
===================================================================
--- trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -10,6 +10,9 @@
#include <rawgenbook.h>
#include <rawstr.h>
#include <utilstr.h>
+#include <filemgr.h>
+#include <sysdata.h>
+#include <treekeyidx.h>
SWORD_NAMESPACE_START
@@ -59,6 +62,11 @@
}
+bool RawGenBook::isWritable() {
+ return ((bdtfd->getFd() > 0) && ((bdtfd->mode & FileMgr::RDWR) == FileMgr::RDWR));
+}
+
+
/******************************************************************************
* RawGenBook::getRawEntry - Returns the correct verse when char * cast
* is requested
Modified: trunk/src/modules/lexdict/rawld/rawld.cpp
===================================================================
--- trunk/src/modules/lexdict/rawld/rawld.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/lexdict/rawld/rawld.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -11,6 +11,7 @@
#include <utilstr.h>
#include <rawstr.h>
#include <rawld.h>
+#include <filemgr.h>
SWORD_NAMESPACE_START
@@ -37,6 +38,11 @@
}
+bool RawLD::isWritable() {
+ return ((idxfd->getFd() > 0) && ((idxfd->mode & FileMgr::RDWR) == FileMgr::RDWR));
+}
+
+
/******************************************************************************
* RawLD::strongsPad - Pads a key if (it-1) is 100% digits to 5 places
* allows for final to be alpha, e.g. '123B'
Modified: trunk/src/modules/lexdict/rawld4/rawld4.cpp
===================================================================
--- trunk/src/modules/lexdict/rawld4/rawld4.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/lexdict/rawld4/rawld4.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <fcntl.h>
+#include <filemgr.h>
#include <utilstr.h>
#include <rawstr4.h>
#include <rawld4.h>
@@ -37,6 +38,11 @@
}
+bool RawLD4::isWritable() {
+ return ((idxfd->getFd() > 0) && ((idxfd->mode & FileMgr::RDWR) == FileMgr::RDWR));
+}
+
+
/******************************************************************************
* RawLD4::strongsPad - Pads a key if (it-1) is 100% digits to 5 places
* allows for final to be alpha, e.g. '123B'
Modified: trunk/src/modules/lexdict/swld.cpp
===================================================================
--- trunk/src/modules/lexdict/swld.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/lexdict/swld.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -4,6 +4,7 @@
*/
#include <swld.h>
+#include <strkey.h>
SWORD_NAMESPACE_START
@@ -35,6 +36,9 @@
}
+SWKey *SWLD::CreateKey() { return new StrKey(); }
+
+
/******************************************************************************
* SWLD::KeyText - Sets/gets module KeyText, getting from saved text if key is
* persistent
Modified: trunk/src/modules/lexdict/zld/zld.cpp
===================================================================
--- trunk/src/modules/lexdict/zld/zld.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/lexdict/zld/zld.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -11,6 +11,7 @@
#include <utilstr.h>
#include <zstr.h>
#include <zld.h>
+#include <filemgr.h>
SWORD_NAMESPACE_START
@@ -37,6 +38,11 @@
}
+bool zLD::isWritable() {
+ return ((idxfd->getFd() > 0) && ((idxfd->mode & FileMgr::RDWR) == FileMgr::RDWR));
+}
+
+
/******************************************************************************
* zLD::strongsPad - Pads a key if it is 100% digits to 5 places
*
Modified: trunk/src/modules/swmodule.cpp
===================================================================
--- trunk/src/modules/swmodule.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/swmodule.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -11,6 +11,7 @@
#include <swfilter.h>
#include <versekey.h> // KLUDGE for Search
#include <treekeyidx.h> // KLUDGE for Search
+#include <swoptfilter.h>
#include <filemgr.h>
#ifndef _MSC_VER
#include <iostream>
@@ -27,6 +28,8 @@
SWDisplay SWModule::rawdisp;
+typedef std::list<SWBuf> StringList;
+
/******************************************************************************
* SWModule Constructor - Initializes data for instance of SWModule
*
@@ -59,7 +62,7 @@
stripFilters = new FilterList();
rawFilters = new FilterList();
renderFilters = new FilterList();
- optionFilters = new FilterList();
+ optionFilters = new OptionFilterList();
encodingFilters = new FilterList();
skipConsecutiveLinks = true;
procEntAttr = true;
@@ -886,7 +889,7 @@
// turn all filters to default values
StringList filterSettings;
- for (FilterList::iterator filter = optionFilters->begin(); filter != optionFilters->end(); filter++) {
+ for (OptionFilterList::iterator filter = optionFilters->begin(); filter != optionFilters->end(); filter++) {
filterSettings.push_back((*filter)->getOptionValue());
(*filter)->setOptionValue(*((*filter)->getOptionValues().begin()));
@@ -1157,7 +1160,7 @@
// reset option filters back to original values
StringList::iterator origVal = filterSettings.begin();
- for (FilterList::iterator filter = optionFilters->begin(); filter != optionFilters->end(); filter++) {
+ for (OptionFilterList::iterator filter = optionFilters->begin(); filter != optionFilters->end(); filter++) {
(*filter)->setOptionValue(*origVal++);
}
@@ -1167,6 +1170,29 @@
#endif
}
+/** OptionFilterBuffer a text buffer
+ * @param filters the FilterList of filters to iterate
+ * @param buf the buffer to filter
+ * @param key key location from where this buffer was extracted
+ */
+void SWModule::filterBuffer(OptionFilterList *filters, SWBuf &buf, SWKey *key) {
+ OptionFilterList::iterator it;
+ for (it = filters->begin(); it != filters->end(); it++) {
+ (*it)->processText(buf, key, this);
+ }
+}
+/** FilterBuffer a text buffer
+ * @param filters the FilterList of filters to iterate
+ * @param buf the buffer to filter
+ * @param key key location from where this buffer was extracted
+ */
+void SWModule::filterBuffer(FilterList *filters, SWBuf &buf, SWKey *key) {
+ FilterList::iterator it;
+ for (it = filters->begin(); it != filters->end(); it++) {
+ (*it)->processText(buf, key, this);
+ }
+}
+
SWORD_NAMESPACE_END
Modified: trunk/src/modules/texts/rawtext/rawtext.cpp
===================================================================
--- trunk/src/modules/texts/rawtext/rawtext.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/texts/rawtext/rawtext.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -11,6 +11,8 @@
#include <utilstr.h>
#include <rawverse.h>
#include <rawtext.h>
+#include <filemgr.h>
+#include <versekey.h>
#include <regex.h> // GNU
#include <map>
@@ -78,6 +80,11 @@
}
+bool RawText::isWritable() {
+ return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR));
+}
+
+
/******************************************************************************
* RawText::getRawEntry - Returns the correct verse when char * cast
* is requested
Modified: trunk/src/modules/texts/swtext.cpp
===================================================================
--- trunk/src/modules/texts/swtext.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/texts/swtext.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -5,6 +5,7 @@
#include <swtext.h>
#include <listkey.h>
#include <localemgr.h>
+#include <versekey.h>
SWORD_NAMESPACE_START
@@ -16,7 +17,8 @@
* idisp - Display object to use for displaying
*/
-SWText::SWText(const char *imodname, const char *imoddesc, SWDisplay *idisp, SWTextEncoding enc, SWTextDirection dir, SWTextMarkup mark, const char* ilang): SWModule(imodname, imoddesc, idisp, "Biblical Texts", enc, dir, mark, ilang), tmpVK() {
+SWText::SWText(const char *imodname, const char *imoddesc, SWDisplay *idisp, SWTextEncoding enc, SWTextDirection dir, SWTextMarkup mark, const char* ilang): SWModule(imodname, imoddesc, idisp, "Biblical Texts", enc, dir, mark, ilang) {
+ tmpVK = new VerseKey();
delete key;
key = CreateKey();
skipConsecutiveLinks = false;
@@ -28,6 +30,7 @@
*/
SWText::~SWText() {
+ delete tmpVK;
}
@@ -99,9 +102,9 @@
}
}
if (!key) {
- tmpVK.setLocale(LocaleMgr::getSystemLocaleMgr()->getDefaultLocaleName());
- tmpVK = *(this->key);
- return tmpVK;
+ tmpVK->setLocale(LocaleMgr::getSystemLocaleMgr()->getDefaultLocaleName());
+ (*tmpVK) = *(this->key);
+ return (*tmpVK);
}
else return *key;
}
Modified: trunk/src/modules/texts/ztext/ztext.cpp
===================================================================
--- trunk/src/modules/texts/ztext/ztext.cpp 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/src/modules/texts/ztext/ztext.cpp 2005-11-20 06:06:40 UTC (rev 1864)
@@ -8,6 +8,8 @@
#include <stdio.h>
#include <fcntl.h>
#include <sysdata.h>
+#include <versekey.h>
+#include <filemgr.h>
#include <ztext.h>
@@ -48,6 +50,9 @@
}
+bool zText::isWritable() { return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR)); }
+
+
/******************************************************************************
* zText::getRawEntry - Returns the current verse buffer
*
Modified: trunk/usrinst.sh
===================================================================
--- trunk/usrinst.sh 2005-10-27 08:47:42 UTC (rev 1863)
+++ trunk/usrinst.sh 2005-11-20 06:06:40 UTC (rev 1864)
@@ -1,15 +1,16 @@
#!/bin/sh
OPTIONS="--prefix=/usr $OPTIONS"
+OPTIONS="--disable-shared $OPTIONS"
OPTIONS="--without-conf $OPTIONS"
OPTIONS="--sysconfdir=/etc $OPTIONS"
+OPTIONS="--with-icu $OPTIONS"
+#OPTIONS="--with-vcl $OPTIONS"
+OPTIONS="--enable-debug $OPTIONS"
+#OPTIONS="--enable-profile $OPTIONS"
OPTIONS="--with-lucene $OPTIONS"
-OPTIONS="--with-icu $OPTIONS"
#OPTIONS="--without-curl $OPTIONS"
#OPTIONS="--enable-tests $OPTIONS"
-#OPTIONS="--enable-profile $OPTIONS"
-OPTIONS="--enable-debug $OPTIONS"
-OPTIONS="--disable-shared $OPTIONS"
OPTIONS="--disable-utilities $OPTIONS"
More information about the sword-cvs
mailing list