[sword-cvs] sword/bindings/corba/orbitcpp swordorb-impl.cpp,1.5,1.6 swordorb-impl.hpp,1.4,1.5

sword@www.crosswire.org sword@www.crosswire.org
Sun, 11 May 2003 15:56:07 -0700


Update of /usr/local/cvsroot/sword/bindings/corba/orbitcpp
In directory www:/tmp/cvs-serv3813/bindings/corba/orbitcpp

Modified Files:
	swordorb-impl.cpp swordorb-impl.hpp 
Log Message:



Index: swordorb-impl.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/corba/orbitcpp/swordorb-impl.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** swordorb-impl.cpp	6 May 2003 03:27:56 -0000	1.5
--- swordorb-impl.cpp	11 May 2003 22:56:05 -0000	1.6
***************
*** 12,15 ****
--- 12,18 ----
  
  namespace swordorb {
+ 
+ sword::RawText NULLMod("/dev/null", SWNULL, SWNULL);
+ 
  	ModInfoList *SWMgr_impl::getModInfoList() throw(CORBA::SystemException) {
  
***************
*** 17,28 ****
  		sword::SWModule *module = 0;
  		int size = 0;
! 		for (sword::ModMap::iterator it = delegate->Modules.begin(); it != delegate->Modules.end(); it++) size++;
  		milist->length(size);
  		int i = 0;
  		for (sword::ModMap::iterator it = delegate->Modules.begin(); it != delegate->Modules.end(); it++) {
  			module = it->second;
! 			(*milist)[i].name = CORBA::string_dup(module->Name());
! 			(*milist)[i].type = CORBA::string_dup(module->Type());
! 			(*milist)[i++].lang = CORBA::string_dup(module->Lang());
  		}
  		return milist;
--- 20,36 ----
  		sword::SWModule *module = 0;
  		int size = 0;
! 		for (sword::ModMap::iterator it = delegate->Modules.begin(); it != delegate->Modules.end(); it++) {
! 			if ((!(it->second->getConfigEntry("CipherKey"))) || (*(it->second->getConfigEntry("CipherKey"))))
! 				size++;
! 		}
  		milist->length(size);
  		int i = 0;
  		for (sword::ModMap::iterator it = delegate->Modules.begin(); it != delegate->Modules.end(); it++) {
  			module = it->second;
! 			if ((!(module->getConfigEntry("CipherKey"))) || (*(module->getConfigEntry("CipherKey")))) {
! 				(*milist)[i].name = CORBA::string_dup(module->Name());
! 				(*milist)[i].type = CORBA::string_dup(module->Type());
! 				(*milist)[i++].lang = CORBA::string_dup(module->Lang());
! 			}
  		}
  		return milist;
***************
*** 33,42 ****
  		SWModuleMap::iterator it;
  		SWModule_ptr retVal;
! 		it = moduleImpls.find(name);
  		if (it == moduleImpls.end()) {
! 			sword::SWModule *mod = delegate->Modules[name];
! 			if (mod)
! 				moduleImpls[name] = new SWModule_impl(mod);
! 			it = moduleImpls.find(name);
  		}
  		if (it != moduleImpls.end()) {
--- 41,49 ----
  		SWModuleMap::iterator it;
  		SWModule_ptr retVal;
! 		sword::SWModule *mod = delegate->Modules[name];
! 		it = moduleImpls.find((mod)?name:SWNULL);
  		if (it == moduleImpls.end()) {
! 			moduleImpls[(mod)?name:SWNULL] = new SWModule_impl((mod)?mod:&NULLMod);
! 			it = moduleImpls.find((mod)?name:SWNULL);
  		}
  		if (it != moduleImpls.end()) {

Index: swordorb-impl.hpp
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/corba/orbitcpp/swordorb-impl.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** swordorb-impl.hpp	7 May 2003 23:07:42 -0000	1.4
--- swordorb-impl.hpp	11 May 2003 22:56:05 -0000	1.5
***************
*** 5,8 ****
--- 5,9 ----
  #include <swmodule.h>
  #include <swmgr.h>
+ #include <rawtext.h>
  #include <map>
  
***************
*** 10,13 ****
--- 11,17 ----
  namespace swordorb {
  
+ static const char *SWNULL = "<SWNULL>";
+ extern sword::RawText NULLMod;
+ 
  //Inherit from abstract Skeleton:
  class SWModule_impl : public POA_swordorb::SWModule {
***************
*** 30,34 ****
  	char *getStripText() throw(CORBA::SystemException) { return CORBA::string_dup((char *)delegate->StripText()); }
  	char *getRenderText() throw(CORBA::SystemException) { return CORBA::string_dup((char *)delegate->RenderText()); }
! 	char *getConfigEntry(const char *key) throw(CORBA::SystemException) { return CORBA::string_dup(((char *)delegate->getConfigEntry(key)) ? (char *)delegate->getConfigEntry(key):""); }
  
  };
--- 34,38 ----
  	char *getStripText() throw(CORBA::SystemException) { return CORBA::string_dup((char *)delegate->StripText()); }
  	char *getRenderText() throw(CORBA::SystemException) { return CORBA::string_dup((char *)delegate->RenderText()); }
! 	char *getConfigEntry(const char *key) throw(CORBA::SystemException) { return CORBA::string_dup(((char *)delegate->getConfigEntry(key)) ? (char *)delegate->getConfigEntry(key):SWNULL); }
  
  };