Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXRegistry.h
1 /********************************************************************************
2 * *
3 * R e g i s t r y C l a s s *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXREGISTRY_H
22 #define FXREGISTRY_H
23 
24 #ifndef FXSETTINGS_H
25 #include "FXSettings.h"
26 #endif
27 
28 namespace FX {
29 
30 
59 class FXAPI FXRegistry : public FXSettings {
60 protected:
61  FXString applicationkey; // Application key
62  FXString vendorkey; // Vendor key
63  FXString systemdirs; // System-wide settings directories
64  FXString userdir; // User settings directory
65  FXbool ascii; // ASCII file-based registry
66 protected:
67 #if defined(WIN32)
68  FXbool readFromRegistry(FXptr hroot,FXbool mark=false);
69  FXbool writeToRegistry(FXptr hroot);
70  FXbool readFromRegistryGroup(const FXString& group,FXptr hbase,FXbool mark=false);
71  FXbool writeToRegistryGroup(const FXString& group,FXptr hbase);
72 #endif
73 private:
74  FXRegistry(const FXRegistry&);
75  FXRegistry &operator=(const FXRegistry&);
76 public:
77 
82  FXRegistry(const FXString& akey=FXString::null,const FXString& vkey=FXString::null);
83 
88  void setAsciiMode(FXbool asciiMode){ ascii=asciiMode; }
89 
91  FXbool getAsciiMode() const { return ascii; }
92 
94  void setAppKey(const FXString& name){ applicationkey=name; }
95 
97  const FXString& getAppKey() const { return applicationkey; }
98 
100  void setVendorKey(const FXString& name){ vendorkey=name; }
101 
103  const FXString& getVendorKey() const { return vendorkey; }
104 
106  void setSystemDirectories(const FXString& dirs){ systemdirs=dirs; }
107 
109  const FXString& getSystemDirectories() const { return systemdirs; }
110 
112  void setUserDirectory(const FXString& dir){ userdir=dir; }
113 
115  const FXString& getUserDirectory() const { return userdir; }
116 
118  virtual FXbool read();
119 
121  virtual FXbool write();
122 
124  static const FXchar ext[];
125 
127  static const FXchar foxrc[];
128 
130  virtual ~FXRegistry();
131  };
132 
133 }
134 
135 #endif

Copyright © 1997-2016 Jeroen van der Zijp