[sword-devel] CreateMod

Manfred Bergmann bergmannmd at web.de
Sun Mar 8 09:40:04 MST 2009


Yep, that was helpful.

We've created new personal commentary modules from a template folder  
which was included in the application bundle.
But I'll switch to the mehod you presented.


Thanks,
Manfred

Am 08.03.2009 um 16:24 schrieb Troy A. Griffitts:

> Dear Manfred,
>
> CreateMod is a factory method in SWMgr for creating SWModule objects.
>
> You shouldn't need to ever call it yourself.  mgr->getModule("KJV")  
> for example will give you the correct SWModule object (currently  
> zText) for the KJV module.
>
> Likely not what you want.
>
> If you'd like to actually create a new module on disk, then you can  
> call the static createModule(...) method on any of the specific  
> drivers.
>
> For example, you could make a new RawCom module on disk along with  
> its corresponding .conf file, something like:
>
> // let's create the directory for storing our module
> FileMgr::createParent("/Users/mbergmann/Applications/MacSword/ 
> modules/comments/rawcom/mbergmannCommentary1/x");
>
> // let's create a brand new empty module
> RawCom::createModule("/Users/mbergmann/Applications/MacSword/modules/ 
> comments/rawcom/mbergmannCommentary1");
>
> // let's add our .conf file
> SWConfig mbergmannConf("/Users/mbergmann/Applications/MacSword/ 
> mods.d/mbergmannCommentary1.conf");
>
> mbergmanConf["MBergmannCommentary1"]["DataPath"] = "./modules/ 
> comments/rawcom/mbergmannCommentary1";
> mbergmanConf["MBergmannCommentary1"]["ModDrv"] = "RawCom";
> mbergmanConf["MBergmannCommentary1"]["SourceType"] = "OSIS";
> mbergmanConf["MBergmannCommentary1"]["Decription"] = "Manfred  
> Bergmann's Concise Commentary on the Bible";
> mbergmanConf["MBergmannCommentary1"]["About"] = "...";
> mbergmanConf.Save();
>
>
> Hope this is useful.
>
> 	-Troy.
>
>
>
>
> Manfred Bergmann wrote:
>> Hi.
>> I have seen that SWMgr has a method CreateMod().
>> What does it do? Can it create all types of modules?
>> Regards,
>> Manfred
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page




More information about the sword-devel mailing list