Ice 3.7 Slice API Reference
|
A property set used to configure Ice and Ice applications. More...
defined in <Ice/Properties.ice>
local interface Properties { ... }
Operations | |
Properties | clone () |
Create a copy of this property set. More... | |
StringSeq | getCommandLineOptions () |
Get a sequence of command-line options that is equivalent to this property set. More... | |
PropertyDict | getPropertiesForPrefix (string prefix) |
Get all properties whose keys begins with prefix. More... | |
string | getProperty (string key) |
Get a property by key. More... | |
int | getPropertyAsInt (string key) |
Get a property as an integer. More... | |
int | getPropertyAsIntWithDefault (string key, int \value) |
Get a property as an integer. More... | |
StringSeq | getPropertyAsList (string key) |
Get a property as a list of strings. More... | |
StringSeq | getPropertyAsListWithDefault (string key, StringSeq \value) |
Get a property as a list of strings. More... | |
string | getPropertyWithDefault (string key, string \value) |
Get a property by key. More... | |
void | load (string file) |
Load properties from a file. More... | |
StringSeq | parseCommandLineOptions (string prefix, StringSeq options) |
Convert a sequence of command-line options into properties. More... | |
StringSeq | parseIceCommandLineOptions (StringSeq options) |
Convert a sequence of command-line options into properties. More... | |
void | setProperty (string key, string \value) |
Set a property. More... | |
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 clone | ( | ) |
Create a copy of this property set.
StringSeq getCommandLineOptions | ( | ) |
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
.
PropertyDict getPropertiesForPrefix | ( | string | prefix | ) |
Get all properties whose keys begins with prefix.
If prefix is an empty string, then all properties are returned.
prefix | The prefix to search for (empty string if none). |
string getProperty | ( | string | key | ) |
Get a property by key.
If the property is not set, an empty string is returned.
key | The property key. |
int getPropertyAsInt | ( | string | key | ) |
Get a property as an integer.
If the property is not set, 0 is returned.
key | The property key. |
int getPropertyAsIntWithDefault | ( | string | key, |
int \ | value | ||
) |
Get a property as an integer.
If the property is not set, the given default value is returned.
key | The property key. |
value | The default value to use if the property does not exist. |
StringSeq getPropertyAsList | ( | string | key | ) |
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'.
key | The property key. |
StringSeq getPropertyAsListWithDefault | ( | string | key, |
StringSeq \ | value | ||
) |
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'.
key | The property key. |
value | The default value to use if the property is not set. |
string getPropertyWithDefault | ( | string | key, |
string \ | value | ||
) |
Get a property by key.
If the property is not set, the given default value is returned.
key | The property key. |
value | The default value to use if the property does not exist. |
void load | ( | string | file | ) |
Load properties from a file.
file | The property file. |
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.
prefix | The property prefix, or an empty string to convert all options starting with – . |
options | The command-line options. |
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
.
options | The command-line options. |
void setProperty | ( | string | key, |
string \ | value | ||
) |
Set a property.
To unset a property, set it to the empty string.
key | The property key. |
value | The property value. |