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,2026 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 private:
66  FXRegistry(const FXRegistry&);
67  FXRegistry &operator=(const FXRegistry&);
68 public:
69 
74  FXRegistry(const FXString& akey=FXString::null,const FXString& vkey=FXString::null);
75 
77  void setAppKey(const FXString& name){ applicationkey=name; }
78 
80  const FXString& getAppKey() const { return applicationkey; }
81 
83  void setVendorKey(const FXString& name){ vendorkey=name; }
84 
86  const FXString& getVendorKey() const { return vendorkey; }
87 
89  void setSystemDirectories(const FXString& dirs){ systemdirs=dirs; }
90 
92  const FXString& getSystemDirectories() const { return systemdirs; }
93 
95  void setUserDirectory(const FXString& dir){ userdir=dir; }
96 
98  const FXString& getUserDirectory() const { return userdir; }
99 
101  virtual FXbool read();
102 
104  virtual FXbool write();
105 
107  static const FXchar ext[];
108 
110  static const FXchar foxrc[];
111 
113  virtual ~FXRegistry();
114  };
115 
116 }
117 
118 #endif
const FXString & getSystemDirectories() const
Return search path for system-wide settings.
Definition: FXRegistry.h:92
void setVendorKey(const FXString &name)
Change vendor key name.
Definition: FXRegistry.h:83
void setUserDirectory(const FXString &dir)
Change directory root for per-user settings tree.
Definition: FXRegistry.h:95
The Registry maintains a persistent settings database for an application.
Definition: FXRegistry.h:59
void setAppKey(const FXString &name)
Change application key name.
Definition: FXRegistry.h:77
The Settings class manages a key-value database.
Definition: FXSettings.h:34
Definition: FX4Splitter.h:28
void setSystemDirectories(const FXString &dirs)
Change search path for system-wide settings.
Definition: FXRegistry.h:89
const FXString & getAppKey() const
Return application key name.
Definition: FXRegistry.h:80
const FXString & getUserDirectory() const
Return directory root of per-user settings tree.
Definition: FXRegistry.h:98
const FXString & getVendorKey() const
Return vendor key name.
Definition: FXRegistry.h:86
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2026 Jeroen van der Zijp