Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::Util::SystemConfiguration Class Reference

#include <SystemConfiguration.h>

Inheritance diagram for Poco::Util::SystemConfiguration:

Poco::Util::AbstractConfiguration Poco::RefCountedObject

List of all members.


Detailed Description

This class implements a Configuration interface to various system properties and environment variables.

The following properties are supported:

An attempt to set a system variable will result in an InvalidAccessException being thrown.

Enumerating environment variables is not supported. An attemp to call keys("system.env") will return an empty range.

Definition at line 51 of file SystemConfiguration.h.


Public Types

typedef std::vector< std::string > Keys

Public Member Functions

AbstractConfigurationcreateView (const std::string &prefix)
 Creates a non-mutable view (see ConfigurationView) into the configuration.
const AbstractConfigurationcreateView (const std::string &prefix) const
void duplicate () const
std::string expand (const std::string &value) const
 Creates a view (see ConfigurationView) into the configuration.
bool getBool (const std::string &key, bool defaultValue) const
bool getBool (const std::string &key) const
double getDouble (const std::string &key, double defaultValue) const
double getDouble (const std::string &key) const
int getInt (const std::string &key, int defaultValue) const
int getInt (const std::string &key) const
std::string getRawString (const std::string &key, const std::string &defaultValue) const
std::string getRawString (const std::string &key) const
std::string getString (const std::string &key, const std::string &defaultValue) const
std::string getString (const std::string &key) const
bool hasOption (const std::string &key) const
 Returns true iff the property with the given key exists.
bool hasProperty (const std::string &key) const
 Creates the AbstractConfiguration.
void keys (const std::string &key, Keys &range) const
 Returns in range the names of all keys at root level.
void keys (Keys &range) const
int referenceCount () const
void release () const
 Increments the object's reference count.
void setBool (const std::string &key, bool value)
void setDouble (const std::string &key, double value)
void setInt (const std::string &key, int value)
void setString (const std::string &key, const std::string &value)

Protected Member Functions

virtual void enumerate (const std::string &key, Keys &range) const =0
void enumerate (const std::string &key, Keys &range) const
bool getRaw (const std::string &key, std::string &value) const
 Creates the SystemConfiguration.
void setRaw (const std::string &key, const std::string &value)

Static Protected Member Functions

static bool parseBool (const std::string &value)
static int parseInt (const std::string &value)

Static Private Member Functions

static bool getEnv (const std::string &name, std::string &value)

Static Private Attributes

static const std::string CURRENTDIR = "system.currentDir"
static const std::string ENV = "system.env."
static const std::string HOMEDIR = "system.homeDir"
static const std::string NODENAME = "system.nodeName"
static const std::string OSARCHITECTURE = "system.osArchitecture"
static const std::string OSNAME = "system.osName"
static const std::string OSVERSION = "system.osVersion"
static const std::string TEMPDIR = "system.tempDir"

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index