[sword-cvs] sword/include filemgr.h,1.20,1.21 localemgr.h,1.17,1.18 swkey.h,1.25,1.26 swlog.h,1.5,1.6

sword@www.crosswire.org sword@www.crosswire.org
Fri, 6 Feb 2004 14:01:33 -0700


Update of /cvs/core/sword/include
In directory www:/tmp/cvs-serv27118/include

Modified Files:
	filemgr.h localemgr.h swkey.h swlog.h 
Log Message:
	Changed system[Log|File|Locale]Mgr to
		*Mgr *[get|set]System*Mgr() per Daniel Glassey's
		discovery of potential problems from order of
		initializing statics.

	Added new prefix recognition for OSIS lemma prefix
		"strong:"



Index: filemgr.h
===================================================================
RCS file: /cvs/core/sword/include/filemgr.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- filemgr.h	17 Jan 2004 04:33:25 -0000	1.20
+++ filemgr.h	6 Feb 2004 21:01:00 -0000	1.21
@@ -77,9 +77,12 @@
 class FileMgr {
 
 	friend class FileDesc;
+	friend class __staticsystemFileMgr;
 
 	FileDesc *files;
 	int sysOpen(FileDesc * file);
+protected:
+	static FileMgr *systemFileMgr;
 public:
 
 	/** Maximum number of open files set in the constructor.
@@ -88,7 +91,8 @@
 	*/
 	int maxFiles;
 	
-	static FileMgr systemFileMgr;
+	static FileMgr *getSystemFileMgr();
+	static void setSystemFileMgr(FileMgr *newFileMgr);
 
 	/** Constructor.
 	* @param maxFiles The number of files that this FileMgr may open in parallel, if necessary.

Index: localemgr.h
===================================================================
RCS file: /cvs/core/sword/include/localemgr.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- localemgr.h	5 Feb 2004 10:24:36 -0000	1.17
+++ localemgr.h	6 Feb 2004 21:01:00 -0000	1.18
@@ -51,14 +51,15 @@
 	void deleteLocales();
 	char *defaultLocaleName;
 	LocaleMgr(const LocaleMgr &);
-
+	friend class __staticsystemLocaleMgr;
 protected:
 	LocaleMap *locales;
+	static LocaleMgr *systemLocaleMgr;
 
 public:
 
 	/** Default constructor of  LocaleMgr
-	* You do normally not need this constructor, use LocaleMgr::systemLocaleMgr() instead.
+	* You do normally not need this constructor, use LocaleMgr::getSystemLocaleMgr() instead.
 	*/
 	LocaleMgr(const char *iConfigPath = 0);
 
@@ -104,7 +105,8 @@
 	/** The LocaleMgr object used globally in the Sword world.
 	* Do not create your own LocaleMgr, use this static object instead.
 	*/
-	static LocaleMgr& systemLocaleMgr();
+	static LocaleMgr *getSystemLocaleMgr();
+	static void setSystemLocaleMgr(LocaleMgr *newLocaleMgr);
 
 	/** Augment this localmgr with all locale.conf files in a directory
 	*/

Index: swkey.h
===================================================================
RCS file: /cvs/core/sword/include/swkey.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- swkey.h	5 Feb 2004 10:24:36 -0000	1.25
+++ swkey.h	6 Feb 2004 21:01:00 -0000	1.26
@@ -191,7 +191,7 @@
 	* const char* randomVerse() {
 	*   VerseKey vk;
 	*   SWMgr mgr;
-	*   LocaleMgr::systemLocaleMgr().setDefaultLocaleName("de");
+	*   LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName("de");
 	*
 	*   SWModule* module = mgr->Modules("GerLut");
 	*   srand( time(0) );

Index: swlog.h
===================================================================
RCS file: /cvs/core/sword/include/swlog.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- swlog.h	1 Oct 2002 19:52:40 -0000	1.5
+++ swlog.h	6 Feb 2004 21:01:00 -0000	1.6
@@ -29,19 +29,23 @@
 SWORD_NAMESPACE_START
 
 class SWDLLEXPORT SWLog {
+	friend class __staticsystemLog;
 protected:
 	char logLevel;
+	static SWLog *systemLog;
 
 public:
-	static SWLog *systemlog;
+
+	static SWLog *getSystemLog();
+	static void setSystemLog(SWLog *newLogger);
 
 	SWLog () { logLevel = 1;	/*default to show only errors*/}
 	virtual void setLogLevel(char level) { logLevel = level; }
 	virtual char getLogLevel() { return logLevel; }
-	virtual void LogWarning (char *fmt, ...);
-	virtual void LogError (char *fmt, ...);
-	virtual void LogTimedInformation (char *fmt, ...);
-	virtual void LogInformation (char *fmt, ...);
+	virtual void logWarning (char *fmt, ...);
+	virtual void logError (char *fmt, ...);
+	virtual void logTimedInformation (char *fmt, ...);
+	virtual void logInformation (char *fmt, ...);
 };
 
 SWORD_NAMESPACE_END