The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
localemgr.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * localemgr.h - class LocaleMgr: used to interact with
4  * SWORD locales
5  *
6  * $Id: localemgr.h 3786 2020-08-30 11:35:14Z scribe $
7  *
8  * Copyright 2000-2013 CrossWire Bible Society (http://www.crosswire.org)
9  * CrossWire Bible Society
10  * P. O. Box 2528
11  * Tempe, AZ 85280-2528
12  *
13  * This program is free software; you can redistribute it and/or modify it
14  * under the terms of the GNU General Public License as published by the
15  * Free Software Foundation version 2.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * General Public License for more details.
21  *
22  */
23 
24 #ifndef LOCALEMGR_H
25 #define LOCALEMGR_H
26 
27 #include <map>
28 #include <list>
29 
30 #include <defs.h>
31 #include <swbuf.h>
32 
34 
35 class SWLocale;
36 
37 typedef std::list<SWBuf> StringList;
38 typedef std::map<SWBuf, SWLocale *, std::less<SWBuf> > LocaleMap;
51 
52 private:
53  void deleteLocales();
55  LocaleMgr(const LocaleMgr &);
57 
58 protected:
61 
62 public:
63 
67  LocaleMgr(const char *iConfigPath = 0);
68 
72  virtual ~LocaleMgr();
73 
79  virtual SWLocale *getLocale(const char *name);
80 
85  virtual StringList getAvailableLocales();
86 
94  virtual const char *translate(const char *text, const char *localeName = 0);
95 
100  virtual const char *getDefaultLocaleName();
101 
106  virtual void setDefaultLocaleName(const char *name);
107 
111  static LocaleMgr *getSystemLocaleMgr();
112  static void setSystemLocaleMgr(LocaleMgr *newLocaleMgr);
113 
116  virtual void loadConfigDir(const char *ipath);
117 
118 };
119 
121 #endif
#define SWORD_NAMESPACE_START
Definition: defs.h:39
#define SWDLLEXPORT
Definition: defs.h:171
LocaleMap * locales
Definition: localemgr.h:59
else preg translate
Definition: regex.c:8111
std::list< SWBuf > StringList
Definition: swmodule.cpp:91
std::map< SWBuf, SWLocale *, std::less< SWBuf > > LocaleMap
Definition: localemgr.h:38
static LocaleMgr * systemLocaleMgr
Definition: localemgr.h:60
char * defaultLocaleName
Definition: localemgr.h:54
#define SWORD_NAMESPACE_END
Definition: defs.h:40