Changed the "tagrelease" and "tagstable" make targets to use subversion. Also increme...
[synfig.git] / synfig-studio / tags / stable / src / sinfgapp / settings.h
1 /* === S I N F G =========================================================== */
2 /*!     \file template.h
3 **      \brief Template Header
4 **
5 **      $Id: settings.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002 Robert B. Quattlebaum Jr.
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
14 **      You may not copy, print, publish, or in any
15 **      other way distribute this software without
16 **      a prior written agreement with
17 **      the copyright holder.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SINFG_SETTINGS_H
25 #define __SINFG_SETTINGS_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <sinfg/string.h>
30 #include <map>
31 #include <list>
32 #include <ETL/stringf>
33
34 /* === M A C R O S ========================================================= */
35
36 /* === T Y P E D E F S ===================================================== */
37
38 /* === C L A S S E S & S T R U C T S ======================================= */
39
40 namespace sinfgapp {
41
42 class Settings
43 {
44 public:
45         
46         typedef std::list<sinfg::String> KeyList;
47         typedef std::map<sinfg::String,sinfg::String> ValueBaseMap;
48         typedef std::map<sinfg::String,Settings*> DomainMap;
49         
50 private:
51         ValueBaseMap simple_value_map;
52
53         DomainMap domain_map;
54
55 public:
56         Settings();
57         virtual ~Settings();
58
59         virtual bool get_value(const sinfg::String& key, sinfg::String& value)const;
60         virtual bool set_value(const sinfg::String& key,const sinfg::String& value);
61         virtual KeyList get_key_list()const;
62
63         sinfg::String get_value(const sinfg::String& key)const;
64         void add_domain(Settings* domain, const sinfg::String& name);
65         void remove_domain(const sinfg::String& name);
66
67         bool load_from_string(const sinfg::String& data);
68         bool save_to_string(sinfg::String& data);
69
70         bool load_from_file(const sinfg::String& filename);
71         bool save_to_file(const sinfg::String& filename)const;
72 }; // END of class Settings
73
74 }; // END of namespace sinfgapp
75
76 /* === E N D =============================================================== */
77
78 #endif