Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
Ice::Properties Class Referencefinal

Represents a set of properties used to configure Ice and Ice-based applications. More...

#include <Ice/Ice.h>

Public Member Functions

 Properties ()=default
 Constructs an empty property set.
 Properties (const Properties &source)
 Copy constructor.
template<typename ArgvT>
 Properties (int &argc, ArgvT argv, const PropertiesPtr &defaults=nullptr)
 Constructs a property set, loads the configuration files specified by the Ice.Config property or the ICE_CONFIG environment variable, and then parses Ice properties from args.
 Properties (Properties &&)=delete
 Properties (StringSeq &args, const PropertiesPtr &defaults=nullptr)
 Constructs a property set, loads the configuration files specified by the Ice.Config property or the ICE_CONFIG environment variable, and then parses Ice properties from args.
PropertiesPtr clone ()
 Creates a copy of this property set.
StringSeq getCommandLineOptions ()
 Gets a sequence of command-line options that is equivalent to this property set.
std::string getIceProperty (std::string_view key)
 Gets an Ice property by key.
int getIcePropertyAsInt (std::string_view key)
 Gets an Ice property as an integer.
StringSeq getIcePropertyAsList (std::string_view key)
 Gets an Ice property as a list of strings.
PropertyDict getPropertiesForPrefix (std::string_view prefix)
 Gets all properties whose keys begins with prefix.
std::string getProperty (std::string_view key)
 Gets a property by key.
int getPropertyAsInt (std::string_view key)
 Gets a property as an integer.
int getPropertyAsIntWithDefault (std::string_view key, int value)
 Gets a property as an integer.
StringSeq getPropertyAsList (std::string_view key)
 Gets a property as a list of strings.
StringSeq getPropertyAsListWithDefault (std::string_view key, const StringSeq &value)
 Gets a property as a list of strings.
std::string getPropertyWithDefault (std::string_view key, std::string_view value)
 Gets a property by key.
std::set< std::string > getUnusedProperties ()
 Gets the properties that were never read.
void load (std::string_view file)
 Loads properties from a file.
Propertiesoperator= (const Properties &rhs)=delete
Propertiesoperator= (Properties &&rhs)=delete
StringSeq parseCommandLineOptions (std::string_view prefix, const StringSeq &options)
 Converts a sequence of command-line options into properties.
StringSeq parseIceCommandLineOptions (const StringSeq &options)
 Converts a sequence of command-line options into properties.
void setProperty (std::string_view key, std::string_view value)
 Sets a property.

Static Public Member Functions

static std::pair< PropertyDict, StringSeqparseOptions (std::string_view prefix, const StringSeq &options)
 Parses a sequence of options into a map of key value pairs starting with a prefix.

Detailed Description

Represents a set of properties used to configure Ice and Ice-based applications.

A property is a key/value pair, where both the key and the value are strings. By convention, property keys should have the form application-name>[.category[.sub-category]].name.

Remarks
This class is thread-safe: multiple threads can safely read and write the properties.

Definition at line 63 of file Properties.h.


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