Helper class to access parts of the properties. More...
#include <Properties.h>

Public Member Functions | |
| SubProperties (PropertiesPtr &props, const String &prefix) | |
| Constructor. More... | |
| String | full_name (const String &name) const |
| Returns the full name of a sub-property. More... | |
| template<typename T > | |
| T | get (const String &name) const |
| Calls Properties::get for a sub-property. More... | |
| template<typename T > | |
| T | get (const String &name, const T &default_value) const |
| Calls Properties::get for a sub-property. More... | |
| bool | defaulted (const String &name) const |
| Check whether a sub-property has a default value. More... | |
| bool | has (const String &name) const |
| Check whether a sub-property exists. More... | |
Private Attributes | |
| PropertiesPtr | m_props |
| Reference to the original Properties object. More... | |
| String | m_prefix |
| The common prefix of all sub-properties. More... | |
Helper class to access parts of the properties.
This snippet extracts all properties that start with "Hypertable.RangeServer." and uses the SubProperty to access "Hypertable.RangeServer.Range.SplitSize".
SubProperties cfg(props, "Hypertable.RangeServer.");
i64_t foo = cfg.get_i64("Range.SplitSize");
Definition at line 458 of file Properties.h.
|
inline |
Constructor.
| props | The original Properties object |
| prefix | The common prefix of all sub-properties |
Definition at line 465 of file Properties.h.
|
inline |
Check whether a sub-property has a default value.
| name | The name of the sub-property |
Definition at line 505 of file Properties.h.
Returns the full name of a sub-property.
| name | The name of the sub-property |
Definition at line 474 of file Properties.h.
|
inline |
Calls Properties::get for a sub-property.
| name | The name of the sub-property |
Definition at line 484 of file Properties.h.
|
inline |
Calls Properties::get for a sub-property.
| name | The name of the sub-property |
| default_value | The default value to return if not found |
Definition at line 495 of file Properties.h.
|
inline |
Check whether a sub-property exists.
| name | The name of the sub-property |
Definition at line 515 of file Properties.h.
|
private |
The common prefix of all sub-properties.
Definition at line 526 of file Properties.h.
|
private |
Reference to the original Properties object.
Definition at line 523 of file Properties.h.
1.8.8