136 void setSystemLogLevel(
SWConfig *sysConf,
const char *logLevel = 0) {
137 SWBuf logLevelString = logLevel;
139 SWBuf logLocation = (sysConf ?
"[SWORD] section of sword.conf" :
"SWORD_LOGLEVEL");
141 ConfigEntMap::iterator entry;
142 if ((entry = sysConf->
getSection(
"SWORD").find(
"LogLevel")) != sysConf->
getSection(
"SWORD").end()) {
143 logLevelString = entry->second;
146 if (logLevelString.
length()) {
157 SWLOGTI(
"Setting log level from %s to %s", logLocation.
c_str(), logLevelString.
c_str());
178 optionFilters.insert(OptionFilterMap::value_type(
"ThMLVariants", tmpFilter));
182 optionFilters.insert(OptionFilterMap::value_type(
"GBFStrongs", tmpFilter));
186 optionFilters.insert(OptionFilterMap::value_type(
"GBFFootnotes", tmpFilter));
190 optionFilters.insert(OptionFilterMap::value_type(
"GBFRedLetterWords", tmpFilter));
194 optionFilters.insert(OptionFilterMap::value_type(
"GBFMorph", tmpFilter));
198 optionFilters.insert(OptionFilterMap::value_type(
"GBFHeadings", tmpFilter));
202 optionFilters.insert(OptionFilterMap::value_type(
"OSISHeadings", tmpFilter));
206 optionFilters.insert(OptionFilterMap::value_type(
"OSISStrongs", tmpFilter));
210 optionFilters.insert(OptionFilterMap::value_type(
"OSISMorph", tmpFilter));
214 optionFilters.insert(OptionFilterMap::value_type(
"OSISLemma", tmpFilter));
218 optionFilters.insert(OptionFilterMap::value_type(
"OSISFootnotes", tmpFilter));
222 optionFilters.insert(OptionFilterMap::value_type(
"OSISScripref", tmpFilter));
226 optionFilters.insert(OptionFilterMap::value_type(
"OSISRedLetterWords", tmpFilter));
230 optionFilters.insert(OptionFilterMap::value_type(
"OSISMorphSegmentation", tmpFilter));
234 optionFilters.insert(OptionFilterMap::value_type(
"OSISGlosses", tmpFilter));
235 optionFilters.insert(OptionFilterMap::value_type(
"OSISRuby", tmpFilter));
239 optionFilters.insert(OptionFilterMap::value_type(
"OSISXlit", tmpFilter));
243 optionFilters.insert(OptionFilterMap::value_type(
"OSISEnum", tmpFilter));
247 optionFilters.insert(OptionFilterMap::value_type(
"OSISVariants", tmpFilter));
251 optionFilters.insert(OptionFilterMap::value_type(
"ThMLStrongs", tmpFilter));
255 optionFilters.insert(OptionFilterMap::value_type(
"ThMLFootnotes", tmpFilter));
259 optionFilters.insert(OptionFilterMap::value_type(
"ThMLMorph", tmpFilter));
263 optionFilters.insert(OptionFilterMap::value_type(
"ThMLHeadings", tmpFilter));
267 optionFilters.insert(OptionFilterMap::value_type(
"ThMLLemma", tmpFilter));
271 optionFilters.insert(OptionFilterMap::value_type(
"ThMLScripref", tmpFilter));
275 optionFilters.insert(OptionFilterMap::value_type(
"UTF8GreekAccents", tmpFilter));
279 optionFilters.insert(OptionFilterMap::value_type(
"UTF8HebrewPoints", tmpFilter));
283 optionFilters.insert(OptionFilterMap::value_type(
"UTF8ArabicPoints", tmpFilter));
287 optionFilters.insert(OptionFilterMap::value_type(
"UTF8Cantillation", tmpFilter));
291 optionFilters.insert(OptionFilterMap::value_type(
"GreekLexAttribs", tmpFilter));
295 optionFilters.insert(OptionFilterMap::value_type(
"PapyriPlain", tmpFilter));
324 extraFilters.insert(FilterMap::value_type(
"RTFHTML", f));
331 #if defined(__GNUC__)
332 #pragma GCC diagnostic push
333 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
358 #if defined(__GNUC__)
359 #pragma GCC diagnostic pop
369 commonInit(iconfig, isysconfig, autoload, filterMgr, multiMod);
373 #if defined(__GNUC__)
374 #pragma GCC diagnostic push
375 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
391 int len = (int)path.
length();
392 if ((len < 1) || ((iConfigPath[len-1] !=
'\\') && (iConfigPath[len-1] !=
'/')))
394 SWLOGTI(
"Checking at provided path: %s...", path.
c_str());
408 SWLOGTI(
"Config not found at provided path.");
417 #if defined(__GNUC__)
418 #pragma GCC diagnostic pop
449 void SWMgr::findConfig(
char *configType,
char **prefixPath,
char **configPath, std::list<SWBuf> *augPaths,
SWConfig **providedSysConf) {
450 static bool setLogLevel =
false;
453 ConfigEntMap::iterator entry;
454 ConfigEntMap::iterator lastEntry;
458 if (envLogLevel.
length()) {
459 setSystemLogLevel(0, envLogLevel);
465 SWBuf sysConfDataPath =
"";
472 SWLOGTI(
"Checking for provided SWConfig(\"sword.conf\")...");
473 if (providedSysConf && *providedSysConf) {
474 sysConf = *providedSysConf;
476 if (!setLogLevel) { setSystemLogLevel(sysConf); setLogLevel =
true; }
482 SWLOGTI(
"Checking working directory for sword.conf...");
484 SWLOGTI(
"Overriding any systemwide or ~/.sword/ sword.conf with one found in current directory.");
485 sysConfPath =
"./sword.conf";
486 sysConf =
new SWConfig(sysConfPath);
487 if ((entry = sysConf->
getSection(
"Install").find(
"DataPath")) != sysConf->
getSection(
"Install").end()) {
488 sysConfDataPath = (*entry).second;
490 if (!setLogLevel) { setSystemLogLevel(sysConf); setLogLevel =
true; }
491 if (providedSysConf) {
492 *providedSysConf = sysConf;
499 if (!sysConfDataPath.
size()) {
500 SWLOGTI(
"Checking working directory for mods.conf...");
504 stdstr(configPath,
"./mods.conf");
508 SWLOGTI(
"Checking working directory for mods.d...");
512 stdstr(configPath,
"./mods.d");
518 SWLOGTI(
"Checking working directory ../library/ for mods.d...");
521 stdstr(prefixPath,
"../library/");
522 stdstr(configPath,
"../library/mods.d");
528 SWLOGTI(
"Checking $SWORD_PATH...");
531 if (envsworddir.
length()) {
535 if ((envsworddir[envsworddir.
length()-1] !=
'\\') && (envsworddir[envsworddir.
length()-1] !=
'/'))
538 SWLOGTI(
"Checking $SWORD_PATH for mods.conf...");
541 stdstr(prefixPath, path.c_str());
543 stdstr(configPath, path.c_str());
547 SWLOGTI(
"Checking $SWORD_PATH for mods.d...");
550 stdstr(prefixPath, path.c_str());
552 stdstr(configPath, path.c_str());
565 for (gfp = strtok(globPaths,
":"); gfp; gfp = strtok(0,
":")) {
566 SWLOGTI(
"Checking for %s...", gfp);
577 SWBuf tryPath = homeDir;
578 tryPath +=
".sword/sword.conf";
580 SWLOGTI(
"Overriding any systemwide sword.conf with one found in users home directory (%s)", tryPath.
c_str());
581 sysConfPath = tryPath;
584 SWBuf tryPath = homeDir;
585 tryPath +=
"sword/sword.conf";
587 SWLOGTI(
"Overriding any systemwide sword.conf with one found in users home directory (%s)", tryPath.
c_str());
588 sysConfPath = tryPath;
595 if (!sysConf && sysConfPath.
size()) {
596 sysConf =
new SWConfig(sysConfPath);
600 if (!setLogLevel) { setSystemLogLevel(sysConf); setLogLevel =
true; }
601 if ((entry = sysConf->
getSection(
"Install").find(
"DataPath")) != sysConf->
getSection(
"Install").end()) {
602 sysConfDataPath = (*entry).second;
604 if (sysConfDataPath.
size()) {
606 sysConfDataPath +=
"/";
608 path = sysConfDataPath;
610 SWLOGTI(
"Checking for mods.conf in DataPath...");
616 stdstr(configPath, path.c_str());
620 SWLOGTI(
"Checking for mods.d in DataPath...");
626 stdstr(configPath, path.c_str());
634 if (!setLogLevel) { setSystemLogLevel(sysConf); setLogLevel =
true; }
637 entry = sysConf->
getSection(
"Install").lower_bound(
"AugmentPath");
638 lastEntry = sysConf->
getSection(
"Install").upper_bound(
"AugmentPath");
639 for (;entry != lastEntry; entry++) {
640 path = entry->second;
641 if ((entry->second.c_str()[strlen(entry->second.c_str())-1] !=
'\\') && (entry->second.c_str()[strlen(entry->second.c_str())-1] !=
'/'))
643 augPaths->push_back(path);
646 if (providedSysConf) {
647 *providedSysConf = sysConf;
661 SWLOGTI(
"Checking $ALLUSERSPROFILE/Application Data/sword/...");
664 if (envallusersdir.
length()) {
666 path = envallusersdir;
667 if ((!path.endsWith(
"\\")) && (!path.endsWith(
"/")))
670 path +=
"Application Data/sword/";
671 SWLOGTI(
"Checking %s for mods.d...", path.c_str());
674 stdstr(prefixPath, path.c_str());
676 stdstr(configPath, path.c_str());
685 SWLOGTI(
"Checking $HOME/Library/Application Support/Sword/...");
691 if ((!path.endsWith(
"\\")) && (!path.endsWith(
"/")))
694 SWLOGTI(
"Checking %s for mods.d...", path.c_str());
697 stdstr(prefixPath, path.c_str());
699 stdstr(configPath, path.c_str());
708 SWLOGTI(
"Checking home directory for ~/.sword...");
718 stdstr(configPath, path.c_str());
727 stdstr(configPath, path.c_str());
739 stdstr(configPath, path.c_str());
749 SWBuf basePath = ipath;
755 for (
unsigned int i = 0; i < dirList.size(); ++i) {
757 if (!dirList[i].name.endsWith(
".conf")) {
761 newModFile = basePath + dirList[i].name;
770 newModFile = basePath +
"globals.conf";
780 char *savePrefixPath = 0;
781 char *saveConfigPath = 0;
797 if (saveConfig->getSections().find((*it).first) != saveConfig->getSections().end()) {
808 SectionMap::iterator toErase = it++;
818 delete []savePrefixPath;
820 delete []saveConfigPath;
842 SWLOGTI(
"LOOKING UP MODULE CONFIGURATION...");
846 SWLOGTI(
"LOOKING UP MODULE CONFIGURATION COMPLETE.");
849 SWLOGTI(
"LOADING MODULE CONFIGURATIONS...");
853 SWLOGTI(
"LOADING MODULE CONFIGURATIONS COMPLETE.");
859 SWLOGTI(
"LOADING MODULE LIBRARY...");
861 SectionMap::iterator Sectloop, Sectend;
862 ConfigEntMap::iterator Entryloop, Entryend;
867 for (Entryloop = (*Sectloop).second.lower_bound(
"AutoInstall"), Entryend = (*Sectloop).second.upper_bound(
"AutoInstall"); Entryloop != Entryend; Entryloop++)
879 for (std::list<SWBuf>::iterator pathIt =
augPaths.begin(); pathIt !=
augPaths.end(); pathIt++) {
886 SWBuf path = homeDir;
898 SWLOGTI(
"LOADING MODULE LIBRARY COMPLETE.");
901 SWLog::getSystemLog()->
logError(
"SWMgr: Can't find 'mods.conf' or 'mods.d'. Try setting:\n\tSWORD_PATH=<directory containing mods.conf>\n\tOr see the README file for a full description of setup options (%s)", (
configPath) ?
configPath :
"<configPath is null>");
911 SWBuf description, datapath, misc1;
912 ConfigEntMap::iterator entry;
914 SWBuf lang, sourceformat, encoding;
915 signed char direction, enc, markup;
917 description = ((entry = section.find(
"Description")) != section.end()) ? (*entry).second : (
SWBuf)
"";
918 lang = ((entry = section.find(
"Lang")) != section.end()) ? (*entry).second : (
SWBuf)
"en";
919 sourceformat = ((entry = section.find(
"SourceType")) != section.end()) ? (*entry).second : (
SWBuf)
"";
920 encoding = ((entry = section.find(
"Encoding")) != section.end()) ? (*entry).second : (
SWBuf)
"";
925 SWBuf versification = ((entry = section.find(
"Versification")) != section.end()) ? (*entry).second : (
SWBuf)
"KJV";
930 misc1 += ((entry = section.find(
"DataPath")) != section.end()) ? (*entry).second : (
SWBuf)
"";
931 char *buf =
new char [ strlen(misc1.
c_str()) + 1 ];
933 strcpy(buf, misc1.
c_str());
935 for (; ((*buf2) && ((*buf2 ==
'/') || (*buf2 ==
'\\'))); buf2++);
936 if (!strncmp(buf2,
"./", 2)) {
940 section[
"PrefixPath"] = datapath;
945 section[
"AbsoluteDataPath"] = datapath;
969 if ((entry = section.find(
"Direction")) == section.end()) {
972 else if (!
stricmp((*entry).second.c_str(),
"rtol")) {
975 else if (!
stricmp((*entry).second.c_str(),
"bidi")) {
985 misc1 = ((entry = section.find(
"BlockType")) != section.end()) ? (*entry).second : (
SWBuf)
"CHAPTER";
993 misc1 = ((entry = section.find(
"CompressType")) != section.end()) ? (*entry).second : (
SWBuf)
"LZSS";
1013 if (!
stricmp(driver,
"zText"))
1014 newmod =
new zText(datapath.
c_str(), name, description.
c_str(), blockType,
compress, 0, enc, direction, markup, lang.
c_str(), versification);
1015 else if (!
stricmp(driver,
"zText4"))
1016 newmod =
new zText4(datapath.
c_str(), name, description.
c_str(), blockType,
compress, 0, enc, direction, markup, lang.
c_str(), versification);
1017 else if (!
stricmp(driver,
"zCom4"))
1018 newmod =
new zCom4(datapath.
c_str(), name, description.
c_str(), blockType,
compress, 0, enc, direction, markup, lang.
c_str(), versification);
1020 newmod =
new zCom(datapath.
c_str(), name, description.
c_str(), blockType,
compress, 0, enc, direction, markup, lang.
c_str(), versification);
1024 if (!
stricmp(driver,
"RawText")) {
1025 newmod =
new RawText(datapath.
c_str(), name, description.
c_str(), 0, enc, direction, markup, lang.
c_str(), versification);
1028 if (!
stricmp(driver,
"RawText4")) {
1029 newmod =
new RawText4(datapath.
c_str(), name, description.
c_str(), 0, enc, direction, markup, lang.
c_str(), versification);
1033 if (!
stricmp(driver,
"RawGBF")) {
1034 newmod =
new RawText(datapath.
c_str(), name, description.
c_str(), 0, enc, direction, markup, lang.
c_str());
1037 if (!
stricmp(driver,
"RawCom")) {
1038 newmod =
new RawCom(datapath.
c_str(), name, description.
c_str(), 0, enc, direction, markup, lang.
c_str(), versification);
1041 if (!
stricmp(driver,
"RawCom4")) {
1042 newmod =
new RawCom4(datapath.
c_str(), name, description.
c_str(), 0, enc, direction, markup, lang.
c_str(), versification);
1045 if (!
stricmp(driver,
"RawFiles")) {
1049 if (!
stricmp(driver,
"HREFCom")) {
1050 misc1 = ((entry = section.find(
"Prefix")) != section.end()) ? (*entry).second : (
SWBuf)
"";
1055 if (!
stricmp(driver,
"RawLD")) {
1056 bool caseSensitive = ((entry = section.find(
"CaseSensitiveKeys")) != section.end()) ? (*entry).second ==
"true":
false;
1057 bool strongsPadding = ((entry = section.find(
"StrongsPadding")) != section.end()) ? (*entry).second ==
"true":
true;
1058 newmod =
new RawLD(datapath.
c_str(), name, description.
c_str(), 0, enc, direction, markup, lang.
c_str(), caseSensitive, strongsPadding);
1062 if (!
stricmp(driver,
"RawLD4")) {
1063 bool caseSensitive = ((entry = section.find(
"CaseSensitiveKeys")) != section.end()) ? (*entry).second ==
"true":
false;
1064 bool strongsPadding = ((entry = section.find(
"StrongsPadding")) != section.end()) ? (*entry).second ==
"true":
true;
1065 newmod =
new RawLD4(datapath.
c_str(), name, description.
c_str(), 0, enc, direction, markup, lang.
c_str(), caseSensitive, strongsPadding);
1069 if (!
stricmp(driver,
"zLD")) {
1072 bool caseSensitive = ((entry = section.find(
"CaseSensitiveKeys")) != section.end()) ? (*entry).second ==
"true":
false;
1073 bool strongsPadding = ((entry = section.find(
"StrongsPadding")) != section.end()) ? (*entry).second ==
"true":
true;
1074 misc1 = ((entry = section.find(
"BlockCount")) != section.end()) ? (*entry).second : (
SWBuf)
"200";
1075 blockCount = atoi(misc1.
c_str());
1076 blockCount = (blockCount) ? blockCount : 200;
1078 misc1 = ((entry = section.find(
"CompressType")) != section.end()) ? (*entry).second : (
SWBuf)
"LZSS";
1084 #ifndef EXCLUDEBZIP2
1098 newmod =
new zLD(datapath.
c_str(), name, description.
c_str(), blockCount,
compress, 0, enc, direction, markup, lang.
c_str(), caseSensitive, strongsPadding);
1103 if (!
stricmp(driver,
"RawGenBook")) {
1104 misc1 = ((entry = section.find(
"KeyType")) != section.end()) ? (*entry).second : (
SWBuf)
"TreeKey";
1110 SWBuf &dp = section[
"AbsoluteDataPath"];
1111 for (
int i = (
int)dp.
length() - 1; i; i--) {
1130 if ((entry = section.find(
"Type")) != section.end())
1131 newmod->
setType(entry->second.c_str());
1142 ConfigEntMap::iterator start = section.lower_bound(
"GlobalOptionFilter");
1143 ConfigEntMap::iterator end = section.upper_bound(
"GlobalOptionFilter");
1145 for (;start != end; ++start) {
1146 OptionFilterMap::iterator it;
1147 SWBuf filterName = start->second;
1152 if (filterName.
startsWith(
"OSISReferenceLinks")) {
1153 SWBuf params = filterName;
1161 filterName = filterName +
"." + optionType +
"." + optionSubType;
1166 optionFilters.insert(OptionFilterMap::value_type(filterName, tmpFilter));
1175 StringList::iterator loop;
1177 if (!strcmp((*loop).c_str(), (*it).second->getOptionName()))
1181 options.push_back((*it).second->getOptionName());
1193 signed char retVal = -1;
1196 if ((*it).second->getOptionName()) {
1197 if (!
stricmp(filterName, (*it).second->getOptionName())) {
1198 retVal = it->second->processText(text, key, module);
1205 FilterMap::iterator it =
extraFilters.find(filterName);
1207 retVal = it->second->processText(text, key, module);
1217 ConfigEntMap::iterator start = section.lower_bound(
"LocalOptionFilter");
1218 ConfigEntMap::iterator end = section.upper_bound(
"LocalOptionFilter");
1220 for (;start != end; start++) {
1221 OptionFilterMap::iterator it;
1236 ConfigEntMap::iterator start = section.lower_bound(
"LocalStripFilter");
1237 ConfigEntMap::iterator end = section.upper_bound(
"LocalStripFilter");
1239 for (;start != end; start++) {
1240 OptionFilterMap::iterator it;
1250 SWBuf sourceformat, cipherKey;
1251 ConfigEntMap::iterator entry;
1253 cipherKey = ((entry = section.find(
"CipherKey")) != section.end()) ? (*entry).second : (
SWBuf)
"";
1254 if (cipherKey.
length()) {
1274 ConfigEntMap::iterator entry;
1276 sourceformat = ((entry = section.find(
"SourceType")) != section.end()) ? (*entry).second : (
SWBuf)
"";
1280 if (!sourceformat.
length()) {
1281 sourceformat = ((entry = section.find(
"ModDrv")) != section.end()) ? (*entry).second : (
SWBuf)
"";
1283 sourceformat =
"GBF";
1284 else sourceformat =
"";
1301 ConfigEntMap::iterator entry;
1303 sourceformat = ((entry = section.find(
"SourceType")) != section.end()) ? (*entry).second : (
SWBuf)
"";
1305 if (!sourceformat.
length()) {
1306 sourceformat = ((entry = section.find(
"ModDrv")) != section.end()) ? (*entry).second : (
SWBuf)
"";
1308 sourceformat =
"GBF";
1309 else sourceformat =
"";
1336 SWBuf basePath = dirname;
1340 for (
unsigned int i = 0; i < dirList.size(); ++i) {
1341 newModFile = basePath + dirList[i].name;
1350 targetName += dirList[i].name;
1358 if (conffd && conffd->
getFd() >= 0)
1379 SWLOGTI(
"Found new module [%s]. Installing...", fname);
1382 conffd->
write(&ch, 1);
1383 while (modfd->
read(&ch, 1) == 1)
1384 conffd->
write(&ch, 1);
1386 conffd->
write(&ch, 1);
1395 if ((*it).second->getOptionName()) {
1396 if (!
stricmp(option, (*it).second->getOptionName()))
1397 (*it).second->setOptionValue(value);
1406 if ((*it).second->getOptionName()) {
1407 if (!
stricmp(option, (*it).second->getOptionName()))
1408 return (*it).second->getOptionValue();
1418 if ((*it).second->getOptionName()) {
1419 if (!
stricmp(option, (*it).second->getOptionName()))
1420 return (*it).second->getOptionTip();
1437 if ((*it).second->getOptionName()) {
1438 if (!
stricmp(option, (*it).second->getOptionName())) {
1439 options = (*it).second->getOptionValues();
1447 #if defined(__GNUC__)
1448 #pragma GCC diagnostic push
1449 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1457 SWLOGD(
"libsword: SWMgr::createAllModules");
1458 SectionMap::iterator it;
1459 ConfigEntMap::iterator entry;
1461 SWBuf driver, misc1;
1466 driver = ((entry = section.find(
"ModDrv")) != section.end()) ? (*entry).second : (
SWBuf)
"";
1473 AddGlobalOptions(newmod, section, section.lower_bound(
"GlobalOptionFilter"), section.upper_bound(
"GlobalOptionFilter"));
1479 AddLocalOptions(newmod, section, section.lower_bound(
"LocalOptionFilter"), section.upper_bound(
"LocalOptionFilter"));
1491 AddStripFilters(newmod, section, section.lower_bound(
"LocalStripFilter"), section.upper_bound(
"LocalStripFilter"));
1521 ModMap::iterator it;
1524 delete (*it).second;
1527 delete (*it).second;
1536 ModMap::iterator it =
Modules.find(modName);
1538 delete (*it).second;
1544 delete (*it).second;
1551 FilterMap::iterator it;
1556 ((
CipherFilter *)(*it).second)->getCipher()->setCipherKey(key);
1564 cipherFilters.insert(FilterMap::value_type(modName, cipherFilter));
1579 #if defined(__GNUC__)
1580 #pragma GCC diagnostic pop
static signed char existsFile(const char *ipath, const char *ifileName=0)
const char * getName() const
SWOptionFilter * transliterator
#define SWORD_NAMESPACE_START
long seek(long offset, int whence)
virtual void deleteAllModules()
virtual void InstallScan(const char *dir)
virtual const char * getOptionName()
FileDesc * open(const char *path, int mode, bool tryDowngrade)
unsigned long length() const
virtual const char * getGlobalOption(const char *option)
virtual const char * getGlobalOptionTip(const char *option)
virtual void setGlobalOption(const char *option, const char *value)
virtual SectionMap & getSections()
static const char * MODTYPE_GENBOOKS
virtual char filterText(const char *filterName, SWBuf &text, const SWKey *key=0, const SWModule *module=0)
const char * getType() const
static signed char existsDir(const char *ipath, const char *idirName=0)
static unsigned int RDONLY
static SWBuf getEnvValue(const char *variableName)
virtual const char * getConfigEntry(const char *key) const
virtual signed char load()
static SWLog * getSystemLog()
virtual SWModule * createModule(const char *name, const char *driver, ConfigEntMap §ion)
virtual void addRawFilters(SWModule *module, ConfigEntMap §ion)
void commonInit(SWConfig *iconfig, SWConfig *isysconfig, bool autoload, SWFilterMgr *filterMgr, bool multiMod=false)
virtual StringList getGlobalOptionValues(const char *option)
static const char * MODTYPE_LEXDICTS
virtual SWDEPRECATED void AddStripFilters(SWModule *module, ConfigEntMap §ion)
ModMap & getUtilModules()
bool startsWith(const SWBuf &prefix) const
SWBuf getFileName() const
virtual StringList getGlobalOptions()
bool endsWith(const SWBuf &postfix) const
int stricmp(const char *s1, const char *s2)
virtual void augmentModules(const char *path, bool multiMod=false)
virtual void addStripFilters(SWModule *module, ConfigEntMap §ion)
long write(const void *buf, long count)
virtual SWDEPRECATED signed char Load()
static const char * MODTYPE_BIBLES
SWModule * getModule(const char *modName)
SWORD_NAMESPACE_START char * stdstr(char **ipstr, const char *istr, unsigned int memPadFactor=1)
ConfigEntMap & getSection(const char *section)
OptionFilterMap optionFilters
void close(FileDesc *file)
SWMgr(SWConfig *iconfig=0, SWConfig *isysconfig=0, bool autoload=true, SWFilterMgr *filterMgr=0, bool multiMod=false)
virtual void addGlobalOptions(SWModule *module, ConfigEntMap §ion, ConfigEntMap::iterator start, ConfigEntMap::iterator end)
virtual void augment(const SWConfig &addFrom)
const char * c_str() const
std::list< SWBuf > StringList
static int removeFile(const char *fName)
virtual SWDEPRECATED void AddLocalOptions(SWModule *module, ConfigEntMap §ion, ConfigEntMap::iterator start, ConfigEntMap::iterator end)
static SWDEPRECATED SWBuf getHomeDir()
static unsigned int APPEND
static const char * MODTYPE_COMMENTARIES
virtual void addRenderFilters(SWModule *module, ConfigEntMap §ion)
virtual SWModule & addOptionFilter(SWOptionFilter *newFilter)
virtual void addEncodingFilters(SWModule *module, ConfigEntMap §ion)
FilterList cleanupFilters
virtual SWModule & addRawFilter(SWFilter *newFilter)
virtual SWModule & addStripFilter(SWFilter *newFilter)
std::map< SWBuf, SWModule *, std::less< SWBuf > > ModMap
virtual void addRenderFilters(SWModule *module, ConfigEntMap §ion)
unsigned long size() const
const char * stripPrefix(char separator, bool endOfStringAsSeparator=false)
static const char * MODTYPE_DAILYDEVOS
static const char LOG_WARN
virtual void addLocalStripFilters(SWModule *module, ConfigEntMap §ion)
static std::vector< struct DirEntry > getDirList(const char *dirPath, bool includeSize=false, bool includeIsDirectory=true)
virtual void addEncodingFilters(SWModule *module, ConfigEntMap §ion)
virtual void setParentMgr(SWMgr *parentMgr)
virtual void setConfig(ConfigEntMap *config)
SWORD_NAMESPACE_START typedef multimapwithdefault< SWBuf, SWBuf, std::less< SWBuf > > ConfigEntMap
static unsigned int CREAT
static void findConfig(char *configType, char **prefixPath, char **configPath, StringList *augPaths=0, SWConfig **providedSysConf=0)
void logError(const char *fmt,...) const
void setLogLevel(char level)
virtual void addRawFilters(SWModule *module, ConfigEntMap §ion)
virtual void addGlobalOptionFilters(SWModule *module, ConfigEntMap §ion)
virtual void loadConfigDir(const char *ipath)
static unsigned int IWRITE
static unsigned int WRONLY
virtual void createAllModules(bool multiMod=false)
long read(void *buf, long count)
void deleteModule(const char *)
static unsigned int IREAD
virtual void addStripFilters(SWModule *module, ConfigEntMap §ion)
static const char LOG_INFO
#define SWORD_NAMESPACE_END
virtual char addModToConfig(FileDesc *conffd, const char *fname)
virtual void addLocalOptions(SWModule *module, ConfigEntMap §ion, ConfigEntMap::iterator start, ConfigEntMap::iterator end)
void setType(const char *imodtype)
SWBuf & setFormatted(const char *format,...)
static const char LOG_ERROR
virtual SWDEPRECATED void AddGlobalOptions(SWModule *module, ConfigEntMap §ion, ConfigEntMap::iterator start, ConfigEntMap::iterator end)
static const char * globalConfPath
virtual signed char setCipherKey(const char *modName, const char *key)
static const char LOG_TIMEDINFO
void setSize(unsigned long len)
virtual void addLocalOptionFilters(SWModule *module, ConfigEntMap §ion)
static const char LOG_DEBUG
static FileMgr * getSystemFileMgr()