[sword-devel] A great miss

Troy A. Griffitts sword-devel@crosswire.org
Fri, 31 May 2002 12:28:35 -0700


Victor Porton wrote:
> You missed a functions which get an entry of a module by a given key without 
> changing the current key of the module. You use silly "savekey" mechanism 
> every time. It should be wrapped inside a function like
> 
> const char *SWModule::getRawEntry(SWKey *);

Victor,
	SWModule is a stateful object.  The next version of the API will include 
stateless data access classes as well as the current stateful model, but 
currently if you want your SWModule to not change its currently 
location, create a new one.  Quickest way is from another SWMgr:

SWMgr secondMgr;

SWModule *kjv2 = secondMgr.Modules["KJV"];
kjv2.SetKey("jn1:1");