16#ifndef __Ice_Properties_h__
17#define __Ice_Properties_h__
38#ifndef ICE_IGNORE_VERSION
39# if ICE_INT_VERSION / 100 != 307
40# error Ice version mismatch!
42# if ICE_INT_VERSION % 100 >= 50
43# error Beta header file detected
45# if ICE_INT_VERSION % 100 < 11
46# error Ice patch level mismatch!
51# if defined(ICE_STATIC_LIBS)
53# elif defined(ICE_API_EXPORTS)
54# define ICE_API ICE_DECLSPEC_EXPORT
56# define ICE_API ICE_DECLSPEC_IMPORT
60#ifdef ICE_CPP11_MAPPING
92 virtual ::std::string
getProperty(const ::std::string& key)
noexcept = 0;
175 virtual void setProperty(const ::std::string& key, const ::std::string& value) = 0;
215 virtual
void load(const ::std::
string& file) = 0;
237using PropertiesPtr = ::std::shared_ptr<Properties>;
254ICE_API LocalObject* upCast(Properties*);
256typedef ::IceInternal::Handle< Properties> PropertiesPtr;
275class ICE_API Properties :
public virtual LocalObject
279 typedef PropertiesPtr PointerType;
281 virtual ~Properties();
283#ifdef ICE_CPP11_COMPILER
284 Properties() =
default;
285 Properties(
const Properties&) =
default;
286 Properties& operator=(
const Properties&) =
default;
296 virtual ::std::string getProperty(const ::std::string& key)
ICE_NOEXCEPT = 0;
307 virtual ::std::string getPropertyWithDefault(const ::std::string& key, const ::std::string& value)
ICE_NOEXCEPT = 0;
316 virtual Int getPropertyAsInt(const ::std::string& key)
ICE_NOEXCEPT = 0;
328 virtual Int getPropertyAsIntWithDefault(const ::std::string& key, Int value)
ICE_NOEXCEPT = 0;
360 virtual StringSeq getPropertyAsListWithDefault(const ::std::string& key,
const StringSeq& value)
ICE_NOEXCEPT = 0;
379 virtual void setProperty(const ::std::string& key, const ::std::string& value) = 0;
402 virtual StringSeq parseCommandLineOptions(const ::std::
string& prefix, const StringSeq& options) = 0;
413 virtual StringSeq parseIceCommandLineOptions(const StringSeq& options) = 0;
419 virtual
void load(const ::std::
string& file) = 0;
429inline
bool operator==(const Properties& lhs, const Properties& rhs)
431 return static_cast<const LocalObject&
>(lhs) ==
static_cast<const LocalObject&
>(rhs);
434inline bool operator<(
const Properties& lhs,
const Properties& rhs)
436 return static_cast<const LocalObject&
>(lhs) <
static_cast<const LocalObject&
>(rhs);
#define ICE_API
Definition Config.h:197
#define ICE_NOEXCEPT
Definition Config.h:128
#define ICE_MEMBER(API)
Definition Config.h:177
A property set used to configure Ice and Ice applications.
Definition Properties.h:80
virtual int getPropertyAsInt(const ::std::string &key) 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 ::std::shared_ptr<::Ice::Properties > clone() noexcept=0
Create a copy of this property set.
virtual::Ice::PropertyDict getPropertiesForPrefix(const ::std::string &prefix) noexcept=0
Get all properties whose keys begins with prefix.
virtual::Ice::StringSeq getCommandLineOptions() noexcept=0
Get a sequence of command-line options that is equivalent to this property set.
virtual::std::string getProperty(const ::std::string &key) noexcept=0
Get a property by key.
virtual::Ice::StringSeq getPropertyAsListWithDefault(const ::std::string &key, const StringSeq &value) noexcept=0
Get a property as a list of strings.
virtual::Ice::StringSeq parseIceCommandLineOptions(const StringSeq &options)=0
Convert a sequence of command-line options into properties.
virtual::Ice::StringSeq parseCommandLineOptions(const ::std::string &prefix, const StringSeq &options)=0
Convert a sequence of command-line options into properties.
virtual::std::string getPropertyWithDefault(const ::std::string &key, const ::std::string &value) noexcept=0
Get a property by key.
virtual int getPropertyAsIntWithDefault(const ::std::string &key, int value) noexcept=0
Get a property as an integer.
virtual void setProperty(const ::std::string &key, const ::std::string &value)=0
Set a property.
virtual void load(const ::std::string &file)=0
Load properties from a file.
Definition BuiltinSequences.h:56
int Int
The mapping for the Slice int type.
Definition Config.h:54
::std::map<::std::string, ::std::string > PropertyDict
A simple collection of properties, represented as a dictionary of key/value pairs.
Definition PropertiesAdmin.h:78
bool operator<(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition Comparable.h:136
::std::vector<::std::string > StringSeq
A sequence of strings.
Definition BuiltinSequences.h:96