Nemiver  0.3
nmv-conf-manager.h
Go to the documentation of this file.
1 /* -*- Mode: C++; indent-tabs-mode:nil; c-basic-offset:4; -*- */
2 
3 /*
4  *This file is part of the Nemiver Project.
5  *
6  *Nemiver is free software; you can redistribute
7  *it and/or modify it under the terms of
8  *the GNU General Public License as published by the
9  *Free Software Foundation; either version 2,
10  *or (at your option) any later version.
11  *
12  *Nemiver is distributed in the hope that it will
13  *be useful, but WITHOUT ANY WARRANTY;
14  *without even the implied warranty of
15  *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *See the GNU General Public License for more details.
17  *
18  *You should have received a copy of the
19  *GNU General Public License along with Nemiver;
20  *see the file COPYING.
21  *If not, write to the Free Software Foundation,
22  *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23  *
24  *See COPYRIGHT file copyright information.
25  */
26 #ifndef __NMV_CONF_MANAGER_H__
27 #define __NMV_CONF_MANAGER_H__
28 
29 #include "nmv-object.h"
30 #include "nmv-safe-ptr-utils.h"
31 
32 
33 namespace nemiver {
34 namespace common {
35 
36 class ConfManager;
37 class Config;
38 class UString;
39 struct ConfigPriv;
40 
42 
43 class NEMIVER_API Config : public Object
44 {
45 
46  friend class ConfManager;
47  friend class ConfigPriv;
48 
49  ConfigPriv *m_priv;
50 
51  Config ();
52  Config (const Config &);
53  Config& operator= (const Config &);
54  virtual ~Config ();
55 
56 public:
57 
58  bool get_property (const UString &a_name, UString &a_value);
59  void set_property (const UString a_name, const UString a_value);
60 
61 }
62 ;//end class Config
63 
65 {
66  //forbid instantiation/copy/assignation
67  ConfManager ();
68  ConfManager (const ConfManager &);
69  ConfManager& operator= (const ConfManager &);
70 
71  static void set_config (const Config &a_conf);
72 
73 public:
74 
75  static Config& parse_config_file (const UString &a_path);
76 
77  static Config& parse_user_config_file (bool a_create_if_not_exist=true);
78 
79  static bool user_config_dir_exists ();
80 
81  static const std::string& get_user_config_dir_path ();
82 
83  static void create_default_config_file (const UString a_path);
84 
85  static void create_default_config_file (std::ostream &a_ostream);
86 
87  static void init ();
88 
89  static Config& get_config ();
90 };//end class ConfManager
91 
92 }//end namespace common
93 }//end namespace nemiver
94 
95 #endif //__NMV_CONF_MANAGER_H__
96 
nmv-safe-ptr-utils.h
nemiver::common::ConfigSafePtr
SafePtr< Config, ObjectRef, ObjectUnref > ConfigSafePtr
Definition: nmv-conf-manager.h:39
nemiver::common::Object
Definition: nmv-object.h:43
nemiver::common::ConfManager
Definition: nmv-conf-manager.h:64
nemiver
Definition: nmv-address.h:31
NEMIVER_API
#define NEMIVER_API
Definition: nmv-api-macros.h:53
nemiver::common::UString
Definition: nmv-ustring.h:45
nemiver::common::Config
Definition: nmv-conf-manager.h:43
nmv-object.h
nemiver::common::SafePtr
Definition: nmv-safe-ptr.h:71
common
Definition: nmv-proc-list-dialog.h:32