A property set used to configure Ice and Ice applications.
More...
#include <Ice/Ice.h>
|
| virtual ::std::shared_ptr<::Ice::Properties > | clone () noexcept=0 |
| | Create a copy of this property set.
|
| virtual::Ice::StringSeq | getCommandLineOptions () noexcept=0 |
| | Get a sequence of command-line options that is equivalent to this property set.
|
| virtual::Ice::PropertyDict | getPropertiesForPrefix (const ::std::string &prefix) noexcept=0 |
| | Get all properties whose keys begins with prefix.
|
| virtual::std::string | getProperty (const ::std::string &key) noexcept=0 |
| | Get a property by key.
|
| virtual int | getPropertyAsInt (const ::std::string &key) noexcept=0 |
| | Get a property as an integer.
|
| virtual int | getPropertyAsIntWithDefault (const ::std::string &key, int value) noexcept=0 |
| | Get a property as an integer.
|
| virtual::Ice::StringSeq | getPropertyAsList (const ::std::string &key) noexcept=0 |
| | Get a property as a list of strings.
|
| virtual::Ice::StringSeq | getPropertyAsListWithDefault (const ::std::string &key, const StringSeq &value) noexcept=0 |
| | Get a property as a list of strings.
|
| virtual::std::string | getPropertyWithDefault (const ::std::string &key, const ::std::string &value) noexcept=0 |
| | Get a property by key.
|
| virtual void | load (const ::std::string &file)=0 |
| | Load properties from a file.
|
| virtual::Ice::StringSeq | parseCommandLineOptions (const ::std::string &prefix, const StringSeq &options)=0 |
| | Convert a sequence of command-line options into properties.
|
| virtual::Ice::StringSeq | parseIceCommandLineOptions (const StringSeq &options)=0 |
| | Convert a sequence of command-line options into properties.
|
| virtual void | setProperty (const ::std::string &key, const ::std::string &value)=0 |
| | Set a property.
|
| virtual | ~Properties () |
A property set used to configure Ice and Ice applications.
Properties are key/value pairs, with both keys and values being strings. By convention, property keys should have the form application-name[.category[.sub-category]].name.
◆ ~Properties()
| virtual Ice::Properties::~Properties |
( |
| ) |
|
|
virtual |
◆ clone()
Create a copy of this property set.
- Returns
- A copy of this property set.
◆ getCommandLineOptions()
| virtual::Ice::StringSeq Ice::Properties::getCommandLineOptions |
( |
| ) |
|
|
pure virtualnoexcept |
Get a sequence of command-line options that is equivalent to this property set.
Each element of the returned sequence is a command-line option of the form –key=value.
- Returns
- The command line options for this property set.
◆ getPropertiesForPrefix()
| virtual::Ice::PropertyDict Ice::Properties::getPropertiesForPrefix |
( |
const ::std::string & | prefix | ) |
|
|
pure virtualnoexcept |
Get all properties whose keys begins with prefix.
If prefix is an empty string, then all properties are returned.
- Parameters
-
| prefix | The prefix to search for (empty string if none). |
- Returns
- The matching property set.
◆ getProperty()
| virtual::std::string Ice::Properties::getProperty |
( |
const ::std::string & | key | ) |
|
|
pure virtualnoexcept |
Get a property by key.
If the property is not set, an empty string is returned.
- Parameters
-
- Returns
- The property value.
- See also
- setProperty
◆ getPropertyAsInt()
| virtual int Ice::Properties::getPropertyAsInt |
( |
const ::std::string & | key | ) |
|
|
pure virtualnoexcept |
Get a property as an integer.
If the property is not set, 0 is returned.
- Parameters
-
- Returns
- The property value interpreted as an integer.
- See also
- setProperty
◆ getPropertyAsIntWithDefault()
| virtual int Ice::Properties::getPropertyAsIntWithDefault |
( |
const ::std::string & | key, |
|
|
int | value ) |
|
pure virtualnoexcept |
Get a property as an integer.
If the property is not set, the given default value is returned.
- Parameters
-
| key | The property key. |
| value | The default value to use if the property does not exist. |
- Returns
- The property value interpreted as an integer, or the default value.
- See also
- setProperty
◆ getPropertyAsList()
| virtual::Ice::StringSeq Ice::Properties::getPropertyAsList |
( |
const ::std::string & | key | ) |
|
|
pure virtualnoexcept |
Get a property as a list of strings.
The strings must be separated by whitespace or comma. If the property is not set, an empty list is returned. The strings in the list can contain whitespace and commas if they are enclosed in single or double quotes. If quotes are mismatched, an empty list is returned. Within single quotes or double quotes, you can escape the quote in question with a backslash, e.g. O'Reilly can be written as O'Reilly, "O'Reilly" or 'O\'Reilly'.
- Parameters
-
- Returns
- The property value interpreted as a list of strings.
- See also
- setProperty
◆ getPropertyAsListWithDefault()
| virtual::Ice::StringSeq Ice::Properties::getPropertyAsListWithDefault |
( |
const ::std::string & | key, |
|
|
const StringSeq & | value ) |
|
pure virtualnoexcept |
Get a property as a list of strings.
The strings must be separated by whitespace or comma. If the property is not set, the default list is returned. The strings in the list can contain whitespace and commas if they are enclosed in single or double quotes. If quotes are mismatched, the default list is returned. Within single quotes or double quotes, you can escape the quote in question with a backslash, e.g. O'Reilly can be written as O'Reilly, "O'Reilly" or 'O\'Reilly'.
- Parameters
-
| key | The property key. |
| value | The default value to use if the property is not set. |
- Returns
- The property value interpreted as list of strings, or the default value.
- See also
- setProperty
◆ getPropertyWithDefault()
| virtual::std::string Ice::Properties::getPropertyWithDefault |
( |
const ::std::string & | key, |
|
|
const ::std::string & | value ) |
|
pure virtualnoexcept |
Get a property by key.
If the property is not set, the given default value is returned.
- Parameters
-
| key | The property key. |
| value | The default value to use if the property does not exist. |
- Returns
- The property value or the default value.
- See also
- setProperty
◆ load()
| virtual void Ice::Properties::load |
( |
const ::std::string & | file | ) |
|
|
pure virtual |
Load properties from a file.
- Parameters
-
◆ parseCommandLineOptions()
| virtual::Ice::StringSeq Ice::Properties::parseCommandLineOptions |
( |
const ::std::string & | prefix, |
|
|
const StringSeq & | options ) |
|
pure virtual |
Convert a sequence of command-line options into properties.
All options that begin with –prefix. are converted into properties. If the prefix is empty, all options that begin with – are converted to properties.
- Parameters
-
| prefix | The property prefix, or an empty string to convert all options starting with –. |
| options | The command-line options. |
- Returns
- The command-line options that do not start with the specified prefix, in their original order.
◆ parseIceCommandLineOptions()
| virtual::Ice::StringSeq Ice::Properties::parseIceCommandLineOptions |
( |
const StringSeq & | options | ) |
|
|
pure virtual |
Convert a sequence of command-line options into properties.
All options that begin with one of the following prefixes are converted into properties: –Ice, –IceBox, –IceGrid, –IcePatch2, –IceSSL, –IceStorm, –Freeze, and –Glacier2.
- Parameters
-
| options | The command-line options. |
- Returns
- The command-line options that do not start with one of the listed prefixes, in their original order.
◆ setProperty()
| virtual void Ice::Properties::setProperty |
( |
const ::std::string & | key, |
|
|
const ::std::string & | value ) |
|
pure virtual |
Set a property.
To unset a property, set it to the empty string.
- Parameters
-
| key | The property key. |
| value | The property value. |
- See also
- getProperty
The documentation for this class was generated from the following file: