SystemApplicationSettings.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib 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,
8  or (at your option) any later version.
9 
10  TerraLib 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 TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/common/SystemApplicationSettings.h
22 
23  \brief A singleton for managing application settings applied to the whole system (all users).
24 */
25 
26 #ifndef __TERRALIB_COMMON_INTERNAL_SYSTEMAPPLICATIONSETTINGS_H
27 #define __TERRALIB_COMMON_INTERNAL_SYSTEMAPPLICATIONSETTINGS_H
28 
29 // TerraLib
30 #include "ApplicationSettings.h"
31 #include "Singleton.h"
32 
33 namespace te
34 {
35  namespace common
36  {
37  /*!
38  \class SystemApplicationSettings
39 
40  \brief A singleton for managing application settings applied to the whole system (all users).
41 
42  This singleton can be used to keep the application configuration.
43 
44  It will look for an application configuration file as follows:
45  <ul>
46  <li>first, searchs for the application configuration file in the current application dir</li>
47  <li>then it check for this file in the application data dir (plataform dependent!)</li>
48  <li>use a location defined by an environment variable TERRALIB_DIR_ENVVAR and a sub-dir defined by the macro TERRALIB_CONFIG_DIR</li>
49  </ul>
50 
51  \ingroup common
52  */
54  public Singleton<SystemApplicationSettings>
55  {
57 
58  public:
59 
60  /*! \brief It tries to find a default config file based on system macros and default condigurations. */
61  //void load();
62 
63  /*!
64  \brief It loads the setting from the given file.
65 
66  \param fileName It must be the full path to the settings file.
67  */
68  void load(const std::string& fileName);
69 
70  protected:
71 
72  /*! \brief It initializes the singleton. */
74 
75  /*! \brief Destructor. */
77  };
78 
79  } // end namespace common
80 } // end namespace te
81 
82 #endif // __TERRALIB_COMMON_INTERNAL_SYSTEMAPPLICATIONSETTINGS_H
83 
A class for managing application settings.
Template support for singleton pattern.
URI C++ Library.
A singleton for managing application settings applied to the whole system (all users).
#define TECOMMONEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:65
A class for managing application settings.
Template support for singleton pattern.
Definition: Singleton.h:100