Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::Registry Class Reference

The registry represents an external data source that applications may store application data in. More...

#include <vcf/FoundationKit/Registry.h>

Inheritance diagram for VCF::Registry:

VCF::Object List of all members.

Public Member Functions

 Registry ()
virtual ~Registry ()
void setRoot (const RegistryKeyType &rootKey)
RegistryKeyType getRoot ()
bool openKey (const String &keyname, const bool &createIfNonExistant=false)
bool removeKey (const String &keyname)
bool setValue (const String &value, const String &valuename)
bool setValue (const uint32 &value, const String &valuename)
bool setValue (const bool &value, const String &valuename)
bool setValue (void *dataBuffer, const uint32 &dataBufferSize, const String &valuename)
String getStringValue (const String &valuename)
 Returns a named string value from the registry and the current open key.
uint32 getIntValue (const String &valuename)
 Returns a named int value from the registry and the current open key.
bool getBoolValue (const String &valuename)
 Returns a named bool value from the registry and the current open key.
void getDataBufValue (const String &valuename, uint32 &dataBufferSize, void **dataBuffer)
 Returns a named data buffer from the registry and the current open key.
Enumerator< String > * getKeyNames ()
Enumerator< RegistryValueInfo * > * getValues ()
String getCurrentKey ()

Detailed Description

The registry represents an external data source that applications may store application data in.

This may be things like special file names, UI positions, application state data etc. The external data may be anything depending on the OS. In Win32, this represents a connection to the Win32 registry data base.


Constructor & Destructor Documentation

VCF::Registry::Registry  ) 
 

virtual VCF::Registry::~Registry  )  [virtual]
 


Member Function Documentation

bool VCF::Registry::getBoolValue const String valuename  ) 
 

Returns a named bool value from the registry and the current open key.

If no such value name exists, or there is some other problem reading the value, the function throws a RegistryException exception.

Parameters:
String the name of the value under the current open key
Returns:
bool the value returned

String VCF::Registry::getCurrentKey  ) 
 

void VCF::Registry::getDataBufValue const String valuename,
uint32 dataBufferSize,
void **  dataBuffer
 

Returns a named data buffer from the registry and the current open key.

If no such value name exists, or there is some other problem reading the value, the function throws a RegistryException exception.

Note that the function allocates a data buffer for the caller, however it is the caller's responsibility to delete the data buffer when the caller is finished with it. Example usage

    Registry reg; 
    //reg already opened to some key...

    void* buf = NULL;
    uint32 dataBufferSize = 0;
    try {
        reg.getDataBufValue( "MyData", dataBufferSize, &buf );
    }
    catch ( RegistryException& ) {
        System::println( "Oops - an error occured!" );
    }

    //do stuff with buffer ...

    //clean up buffer - delete it!
    delete buf; 
Parameters:
String the name of the value under the current open key
uint32 the size of the newly allocated data buffer in bytes
void** a pointer to a data buffer pointer.

uint32 VCF::Registry::getIntValue const String valuename  ) 
 

Returns a named int value from the registry and the current open key.

If no such value name exists, or there is some other problem reading the value, the function throws a RegistryException exception.

Parameters:
String the name of the value under the current open key
Returns:
uint32 the value returned

Enumerator<String>* VCF::Registry::getKeyNames  ) 
 

RegistryKeyType VCF::Registry::getRoot  ) 
 

String VCF::Registry::getStringValue const String valuename  ) 
 

Returns a named string value from the registry and the current open key.

If no such value name exists, or there is some other problem reading the value, the function throws a RegistryException exception.

Parameters:
String the name of the value under the current open key
Returns:
String the value returned

Enumerator<RegistryValueInfo*>* VCF::Registry::getValues  ) 
 

bool VCF::Registry::openKey const String keyname,
const bool &  createIfNonExistant = false
 

bool VCF::Registry::removeKey const String keyname  ) 
 

void VCF::Registry::setRoot const RegistryKeyType rootKey  ) 
 

bool VCF::Registry::setValue void *  dataBuffer,
const uint32 dataBufferSize,
const String valuename
 

bool VCF::Registry::setValue const bool &  value,
const String valuename
 

bool VCF::Registry::setValue const uint32 value,
const String valuename
 

bool VCF::Registry::setValue const String value,
const String valuename
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information