nPrefServer Class Reference
[Miscellaneous Subsystems]
#include <nprefserver.h>
Inheritance diagram for nPrefServer:

Detailed Description
The pref server stores key/value pairs in a location where it will persist between application invocations (for instance by using the registry under Win32).NOTE: the interesting stuff happens in platform-specific subclasses.
NOTE #2: it may be advisory to only open and close the nPrefServer right before/after writing/reading key/value pairs. Some implementations might open/close the registry, or ini files between open/close. To prevent excessively long locks on those resources you should try to keep the prefs server open for as short periods as possible.
(C) 2004 RadonLabs GmbH
Definition at line 26 of file nprefserver.h.
Public Member Functions | |
| nPrefServer () | |
| constructor | |
| virtual | ~nPrefServer () |
| destructor | |
| void | SetCompanyName (const nString &n) |
| set company name | |
| const nString & | GetCompanyName () const |
| get company name | |
| void | SetApplicationName (const nString &n) |
| set application name | |
| const nString & | GetApplicationName () const |
| get application name | |
| virtual bool | Open () |
| open the preferences server | |
| virtual void | Close () |
| close the preferences server | |
| virtual bool | KeyExists (const nString &key) |
| check if a key exists | |
| bool | IsOpen () const |
| return true if server is open | |
| bool | WriteString (const nString &key, const nString &value) |
| write a string value | |
| bool | WriteInt (const nString &key, int value) |
| write an integer value | |
| bool | WriteFloat (const nString &key, float value) |
| write a float value | |
| bool | WriteBool (const nString &key, bool value) |
| write a bool value | |
| bool | WriteVector4 (const nString &key, const vector4 &value) |
| write a vector4 value | |
| bool | WriteVector3 (const nString &key, const vector3 &value) |
| write a vector3 value | |
| nString | ReadString (const nString &key) |
| read a string value | |
| int | ReadInt (const nString &key) |
| read an integer value | |
| float | ReadFloat (const nString &key) |
| read a float value | |
| bool | ReadBool (const nString &key) |
| read a bool value | |
| vector4 | ReadVector4 (const nString &key) |
| read a vector4 value | |
| vector3 | ReadVector3 (const nString &key) |
| read a vector3 value | |
Static Public Member Functions | |
| static nPrefServer * | Instance () |
| return singleton instance pointer | |
Protected Member Functions | |
| virtual bool | WriteGeneric (const nString &key, const nString &value) |
| write a generic value in string form | |
| virtual nString | ReadGeneric (const nString &key) |
| read a generic value in string form | |
Protected Attributes | |
| nString | companyName |
| nString | appName |
| bool | isOpen |
| bool | isWriting |
| bool | isReading |
Constructor & Destructor Documentation
|
|
constructor
Definition at line 14 of file nprefserver_main.cc. |
|
|
destructor
Definition at line 24 of file nprefserver_main.cc. |
Member Function Documentation
|
|
return singleton instance pointer
Definition at line 97 of file nprefserver.h. |
|
|
set company name
Definition at line 118 of file nprefserver.h. |
|
|
get company name
Definition at line 128 of file nprefserver.h. |
|
|
set application name
Definition at line 138 of file nprefserver.h. |
|
|
get application name
Definition at line 148 of file nprefserver.h. |
|
|
open the preferences server
Reimplemented in nIniPrefServer, and nWin32PrefServer. Definition at line 38 of file nprefserver_main.cc. |
|
|
close the preferences server
Reimplemented in nIniPrefServer, and nWin32PrefServer. Definition at line 52 of file nprefserver_main.cc. |
|
|
check if a key exists
Reimplemented in nIniPrefServer, and nWin32PrefServer. Definition at line 223 of file nprefserver_main.cc. |
|
|
return true if server is open
Definition at line 108 of file nprefserver.h. |
|
||||||||||||
|
write a string value
Definition at line 62 of file nprefserver_main.cc. |
|
||||||||||||
|
write an integer value
Definition at line 71 of file nprefserver_main.cc. |
|
||||||||||||
|
write a float value
Definition at line 82 of file nprefserver_main.cc. |
|
||||||||||||
|
write a bool value
Definition at line 93 of file nprefserver_main.cc. |
|
||||||||||||
|
write a vector4 value
Definition at line 109 of file nprefserver_main.cc. |
|
||||||||||||
|
write a vector3 value
Definition at line 120 of file nprefserver_main.cc. |
|
|
read a string value
Definition at line 131 of file nprefserver_main.cc. |
|
|
read an integer value
Definition at line 140 of file nprefserver_main.cc. |
|
|
read a float value
Definition at line 149 of file nprefserver_main.cc. |
|
|
read a bool value
Definition at line 158 of file nprefserver_main.cc. |
|
|
read a vector4 value
Definition at line 167 of file nprefserver_main.cc. |
|
|
read a vector3 value
Definition at line 185 of file nprefserver_main.cc. |
|
||||||||||||
|
write a generic value in string form
Reimplemented in nIniPrefServer, and nWin32PrefServer. Definition at line 202 of file nprefserver_main.cc. |
|
|
read a generic value in string form
Reimplemented in nIniPrefServer, and nWin32PrefServer. Definition at line 212 of file nprefserver_main.cc. |
Member Data Documentation
|
|
Definition at line 85 of file nprefserver.h. |
|
|
Definition at line 86 of file nprefserver.h. |
|
|
Definition at line 87 of file nprefserver.h. |
|
|
Definition at line 88 of file nprefserver.h. |
|
|
Definition at line 89 of file nprefserver.h. |
The documentation for this class was generated from the following files: