log4cplus::helpers::Properties Class Reference

`#include <property.h>`

## Public Types

enum | PFlags { fEncodingShift = 3 , fEncodingMask = 0x3 , fUnspecEncoding = (0 << fEncodingShift) , fThrow = (1 << 5) }

## Public Member Functions

| Properties ()
| Properties (log4cplus::tistream &input)
| Properties (const log4cplus::tstring &inputFile, unsigned flags=0)
virtual | ~Properties ()
bool | exists (const log4cplus::tstring &key) const
| Tests to see if `key` can be found in this map.
bool | exists (tchar const *key) const
std::size_t | size () const
| Returns the number of entries in this map.
log4cplus::tstring const & | getProperty (const log4cplus::tstring &key) const
| Searches for the property with the specified key in this property list.
log4cplus::tstring const & | getProperty (tchar const *key) const
log4cplus::tstring | getProperty (const log4cplus::tstring &key, const log4cplus::tstring &defaultVal) const
| Searches for the property with the specified key in this property list.
std::vector< log4cplus::tstring > | propertyNames () const
| Returns all the keys in this property list.
void | setProperty (const log4cplus::tstring &key, const log4cplus::tstring &value)
| Inserts `value` into this map indexed by `key`.
bool | removeProperty (const log4cplus::tstring &key)
| Removed the property index by `key` from this map.
Properties | getPropertySubset (const log4cplus::tstring &prefix) const
| Returns a subset of the "properties" whose keys start with "prefix".
bool | getInt (int &val, log4cplus::tstring const &key) const
bool | getUInt (unsigned &val, log4cplus::tstring const &key) const
bool | getLong (long &val, log4cplus::tstring const &key) const
bool | getULong (unsigned long &val, log4cplus::tstring const &key) const
bool | getBool (bool &val, log4cplus::tstring const &key) const
bool | getString (log4cplus::tstring &val, log4cplus::tstring const &key) const

## Static Public Attributes

static const tchar | PROPERTIES_COMMENT_CHAR

## Protected Types

typedef std::map< log4cplus::tstring, log4cplus::tstring > | StringMap

## Protected Member Functions

void | init (log4cplus::tistream &input)

## Protected Attributes

StringMap | data
unsigned | flags

## Detailed Description

See also
  log4cplus::PropertyConfigurator

Definition at line 43 of file property.h.

## Member Typedef Documentation

## StringMap

typedef std::map<log4cplus::tstring, log4cplus::tstring> log4cplus::helpers::Properties::StringMap

protected

Definition at line 140 of file property.h.

## Member Enumeration Documentation

## PFlags

enum log4cplus::helpers::Properties::PFlags

Enumerator
fEncodingShift |
fEncodingMask |
fUnspecEncoding |
fThrow |

Definition at line 45 of file property.h.

## Constructor & Destructor Documentation

## Properties() [1/3]

log4cplus::helpers::Properties::Properties | ( |  | ) |

Referenced by getPropertySubset().

## Properties() [2/3]

log4cplus::helpers::Properties::Properties | ( | log4cplus::tistream & | input | ) |

explicit

## Properties() [3/3]

log4cplus::helpers::Properties::Properties | ( | const log4cplus::tstring & | inputFile,
|  | unsigned | flags = 0 )

explicit

References flags.

## ~Properties()

virtual log4cplus::helpers::Properties::~Properties | ( |  | ) |

virtual

## Member Function Documentation

## exists() [1/2]

bool log4cplus::helpers::Properties::exists | ( | const log4cplus::tstring & | key | ) | const

Tests to see if `key` can be found in this map.

Referenced by log4cplus::DeviceAppender< Device >::DeviceAppender(), and log4cplus::DeviceAppender< Device >::DeviceAppender().

## exists() [2/2]

bool log4cplus::helpers::Properties::exists | ( | tchar const * | key | ) | const

## getBool()

bool log4cplus::helpers::Properties::getBool | ( | bool & | val,
|  | log4cplus::tstring const & | key ) const

## getInt()

bool log4cplus::helpers::Properties::getInt | ( | int & | val,
|  | log4cplus::tstring const & | key ) const

## getLong()

bool log4cplus::helpers::Properties::getLong | ( | long & | val,
|  | log4cplus::tstring const & | key ) const

## getProperty() [1/3]

log4cplus::tstring const & log4cplus::helpers::Properties::getProperty | ( | const log4cplus::tstring & | key | ) | const

Searches for the property with the specified key in this property list.

If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns `null` if the property is not found.

## getProperty() [2/3]

log4cplus::tstring log4cplus::helpers::Properties::getProperty | ( | const log4cplus::tstring & | key,
|  | const log4cplus::tstring & | defaultVal ) const

Searches for the property with the specified key in this property list.

If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns the default value argument if the property is not found.

## getProperty() [3/3]

log4cplus::tstring const & log4cplus::helpers::Properties::getProperty | ( | tchar const * | key | ) | const

## getPropertySubset()

Properties log4cplus::helpers::Properties::getPropertySubset | ( | const log4cplus::tstring & | prefix | ) | const

Returns a subset of the "properties" whose keys start with "prefix".

The returned "properties" have "prefix" trimmed from their keys.

References Properties().

## getString()

bool log4cplus::helpers::Properties::getString | ( | log4cplus::tstring & | val,
|  | log4cplus::tstring const & | key ) const

## getUInt()

bool log4cplus::helpers::Properties::getUInt | ( | unsigned & | val,
|  | log4cplus::tstring const & | key ) const

## getULong()

bool log4cplus::helpers::Properties::getULong | ( | unsigned long & | val,
|  | log4cplus::tstring const & | key ) const

## init()

void log4cplus::helpers::Properties::init | ( | log4cplus::tistream & | input | ) |

protected

## propertyNames()

std::vector< log4cplus::tstring > log4cplus::helpers::Properties::propertyNames | ( |  | ) | const

Returns all the keys in this property list.

## removeProperty()

bool log4cplus::helpers::Properties::removeProperty | ( | const log4cplus::tstring & | key | ) |

Removed the property index by `key` from this map.

## setProperty()

void log4cplus::helpers::Properties::setProperty | ( | const log4cplus::tstring & | key,
|  | const log4cplus::tstring & | value )

Inserts `value` into this map indexed by `key`.

## size()

std::size_t log4cplus::helpers::Properties::size | ( |  | ) | const

inline

Returns the number of entries in this map.

Definition at line 85 of file property.h.

References data.

## Member Data Documentation

## data

StringMap log4cplus::helpers::Properties::data

protected

Definition at line 146 of file property.h.

Referenced by size().

## flags

unsigned log4cplus::helpers::Properties::flags

protected

Definition at line 147 of file property.h.

Referenced by Properties().

## PROPERTIES_COMMENT_CHAR

const tchar log4cplus::helpers::Properties::PROPERTIES_COMMENT_CHAR

static

Definition at line 73 of file property.h.

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

- property.h