libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CRNConfig.h
Go to the documentation of this file.
1 /* Copyright 2009-2014 INSA Lyon, CoReNum
2  *
3  * This file is part of libcrn.
4  *
5  * libcrn is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * libcrn is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libcrn. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * file: CRNConfig.h
19  * \author Yann LEYDIER
20  */
21 
22 #ifndef CRNConfig_HEADER
23 #define CRNConfig_HEADER
25 
26 namespace crn
27 {
38  class Config
39  {
40  public:
42  ~Config();
43 
45  static bool Save();
46 
48  static void SetTopDataPath(const Path &dir);
50  static Path GetTopDataPath();
52  static crn::Path GetLocalePath();
54  static void SetLocalePath(const crn::Path &dir);
58  static void SetStaticDataPath(const crn::Path &dir);
59 
60  private:
62  static Config& getInstance();
64  static String topDirKey();
66  static String localeDirKey();
68  static String staticDataDirKey();
70  static String verboseKey();
72  Config();
73  ConfigurationFile conf;
76  };
77 }
78 
79 #endif
80 
81 
~Config()
Destructor.
Definition: CRNConfig.cpp:97
static crn::Path GetStaticDataPath()
Gets the data directory name.
Definition: CRNConfig.cpp:168
static void SetTopDataPath(const Path &dir)
Sets the top directory name.
Definition: CRNConfig.cpp:136
static bool Save()
Saves to user's local config.
Definition: CRNConfig.cpp:127
A UTF32 character string class.
Definition: CRNString.h:61
Global configuration utility class.
Definition: CRNConfig.h:38
static void SetStaticDataPath(const crn::Path &dir)
Sets the data directory name.
Definition: CRNConfig.cpp:176
A convenience class for file paths.
Definition: CRNPath.h:39
static void SetLocalePath(const crn::Path &dir)
Sets the translation files path.
Definition: CRNConfig.cpp:160
static Path GetTopDataPath()
Gets the top directory name.
Definition: CRNConfig.cpp:144
#define CRN_DECLARE_CLASS_CONSTRUCTOR(classname)
Declares a class constructor.
Definition: CRNObject.h:173
static crn::Path GetLocalePath()
Gets the translation files path.
Definition: CRNConfig.cpp:152
Configuration file management utility class.