[sword-cvs] sword/src/mgr localemgr.cpp,1.15,1.16 swmgr.cpp,1.92,1.93

sword@www.crosswire.org sword@www.crosswire.org
Fri, 4 Jul 2003 21:58:44 -0700


Update of /usr/local/cvsroot/sword/src/mgr
In directory www:/tmp/cvs-serv7690/src/mgr

Modified Files:
	localemgr.cpp swmgr.cpp 
Log Message:
Added SWOptionFilter


Index: localemgr.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/mgr/localemgr.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** localemgr.cpp	27 Jun 2003 01:41:07 -0000	1.15
--- localemgr.cpp	5 Jul 2003 04:58:42 -0000	1.16
***************
*** 42,49 ****
--- 42,51 ----
  SWORD_NAMESPACE_START
  
+ 
  LocaleMgr LocaleMgr::systemLocaleMgr;
  
  
  LocaleMgr::LocaleMgr(const char *iConfigPath) {
+ 	locales = new LocaleMap();
  	char *prefixPath = 0;
  	char *configPath = 0;
***************
*** 99,102 ****
--- 101,105 ----
  		delete [] defaultLocaleName;
       deleteLocales();
+ 	delete locales;
  }
  
***************
*** 118,127 ****
  				SWLocale *locale = new SWLocale(newmodfile.c_str());
  				if (locale->getName()) {
! 					it = locales.find(locale->getName());
! 					if (it != locales.end()) {
  						*((*it).second) += *locale;
  						delete locale;
  					}
! 					else locales.insert(LocaleMap::value_type(locale->getName(), locale));
  				}
                      else	delete locale;
--- 121,130 ----
  				SWLocale *locale = new SWLocale(newmodfile.c_str());
  				if (locale->getName()) {
! 					it = locales->find(locale->getName());
! 					if (it != locales->end()) {
  						*((*it).second) += *locale;
  						delete locale;
  					}
! 					else locales->insert(LocaleMap::value_type(locale->getName(), locale));
  				}
                      else	delete locale;
***************
*** 137,144 ****
  	LocaleMap::iterator it;
  
! 	for (it = locales.begin(); it != locales.end(); it++)
  		delete (*it).second;
  
! 	locales.erase(locales.begin(), locales.end());
  }
  
--- 140,147 ----
  	LocaleMap::iterator it;
  
! 	for (it = locales->begin(); it != locales->end(); it++)
  		delete (*it).second;
  
! 	locales->erase(locales->begin(), locales->end());
  }
  
***************
*** 147,152 ****
  	LocaleMap::iterator it;
  
! 	it = locales.find(name);
! 	if (it != locales.end())
  		return (*it).second;
  
--- 150,155 ----
  	LocaleMap::iterator it;
  
! 	it = locales->find(name);
! 	if (it != locales->end())
  		return (*it).second;
  
***************
*** 157,161 ****
  std::list <SWBuf> LocaleMgr::getAvailableLocales() {
  	std::list <SWBuf> retVal;
! 	for (LocaleMap::iterator it = locales.begin(); it != locales.end(); it++) 
  		retVal.push_back((*it).second->getName());
  
--- 160,164 ----
  std::list <SWBuf> LocaleMgr::getAvailableLocales() {
  	std::list <SWBuf> retVal;
! 	for (LocaleMap::iterator it = locales->begin(); it != locales->end(); it++) 
  		retVal.push_back((*it).second->getName());
  

Index: swmgr.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/mgr/swmgr.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -C2 -d -r1.92 -r1.93
*** swmgr.cpp	27 Jun 2003 06:25:37 -0000	1.92
--- swmgr.cpp	5 Jul 2003 04:58:42 -0000	1.93
***************
*** 860,864 ****
  		if (it != optionFilters.end()) {
  			module->AddOptionFilter((*it).second);	// add filter to module and option as a valid option
! 			OptionsList::iterator loop;
  			for (loop = options.begin(); loop != options.end(); loop++) {
  				if (!strcmp((*loop).c_str(), (*it).second->getOptionName()))
--- 860,864 ----
  		if (it != optionFilters.end()) {
  			module->AddOptionFilter((*it).second);	// add filter to module and option as a valid option
! 			StringList::iterator loop;
  			for (loop = options.begin(); loop != options.end(); loop++) {
  				if (!strcmp((*loop).c_str(), (*it).second->getOptionName()))
***************
*** 1115,1119 ****
  
  
! OptionsList SWMgr::getGlobalOptions()
  {
  	return options;
--- 1115,1119 ----
  
  
! StringList SWMgr::getGlobalOptions()
  {
  	return options;
***************
*** 1121,1127 ****
  
  
! OptionsList SWMgr::getGlobalOptionValues(const char *option)
  {
! 	OptionsList options;
  	for (FilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
  		if ((*it).second->getOptionName()) {
--- 1121,1127 ----
  
  
! StringList SWMgr::getGlobalOptionValues(const char *option)
  {
! 	StringList options;
  	for (FilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
  		if ((*it).second->getOptionName()) {