AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
This class provides an interface to a simple key/value container. More...
#include <PropertiesInterface.h>
Public Types | |
typedef std::vector< unsigned char > | Bytes |
Bytes data type. This data type represent a continuous byte array. More... | |
Public Member Functions | |
virtual | ~PropertiesInterface () noexcept=default |
Destructor. More... | |
virtual bool | getString (const std::string &key, std::string &value) noexcept=0 |
Method to load string value from configuration. More... | |
virtual bool | putString (const std::string &key, const std::string &value) noexcept=0 |
Method to store string value into configuration. More... | |
virtual bool | getBytes (const std::string &key, Bytes &value) noexcept=0 |
Method to load binary value from configuration. More... | |
virtual bool | putBytes (const std::string &key, const Bytes &value) noexcept=0 |
Method to store binary value into configuration. More... | |
virtual bool | getKeys (std::unordered_set< std::string > &keys) noexcept=0 |
Method to inspect existing properties. More... | |
virtual bool | remove (const std::string &key) noexcept=0 |
Removes a property with a given name. More... | |
virtual bool | clear () noexcept=0 |
Removes all properties from a configuration container. More... | |
This class provides an interface to a simple key/value container.
This interface is obtained through PropertiesFactoryInterface
factory, which handles disambiguation of properties namespace.
The implementation must do best effort for data consistency when handling data update errors for each property. If it is possible, the value of property shall be either left intact, or deleted if the data corruption is unavoidable.
typedef std::vector<unsigned char> alexaClientSDK::propertiesInterfaces::PropertiesInterface::Bytes |
Bytes data type. This data type represent a continuous byte array.
|
virtualdefaultnoexcept |
Destructor.
|
pure virtualnoexcept |
Removes all properties from a configuration container.
This method removes all properties from a configuration container.
Implemented in alexaClientSDK::propertiesInterfaces::test::StubProperties.
|
pure virtualnoexcept |
Method to load binary value from configuration.
This method loads binary value from configuration. If the value in the storage is not binary data, the method behaviour is undefined.
[in] | key | Configuration key. |
[out] | value | If the method completes successfully, value will contain loaded value. Otherwise contents of value is unmodified. |
Implemented in alexaClientSDK::propertiesInterfaces::test::StubProperties.
|
pure virtualnoexcept |
Method to inspect existing properties.
This method provides a set of known property keys from a configuration container.
[out] | keys | Container for property keys. If method completes successfully, keys will contain all property names. On error, the contents of keys is undefined. |
Implemented in alexaClientSDK::propertiesInterfaces::test::StubProperties.
|
pure virtualnoexcept |
Method to load string value from configuration.
This method loads string value from configuration. If the value in the storage is not a string, the method behaviour is undefined.
[in] | key | Configuration key. |
[out] | value | Result container. If the method completes successfully, value will contain loaded value. Otherwise contents of value is unmodified. |
Implemented in alexaClientSDK::propertiesInterfaces::test::StubProperties.
|
pure virtualnoexcept |
Method to store binary value into configuration.
This method stores binary value into configuration. If there is an existing value for the the same key, the value is overwritten.
If operation fails, the implementation shall make a best effort for either keeping value unmodified, or clear it to prevent data corruption. Other properties shall not be impacted in case of an error.
[in] | key | Configuration key. |
[in] | value | Value to store. |
Implemented in alexaClientSDK::propertiesInterfaces::test::StubProperties.
|
pure virtualnoexcept |
Method to store string value into configuration.
This method stores string value into configuration. If there is an existing value for the the same key, the value is overwritten.
If operation fails, the implementation shall make a best effort for either keeping value unmodified, or clear it to prevent data corruption. Other properties shall not be impacted in case of an error.
[in] | key | Configuration key. |
[in] | value | Value to store. |
Implemented in alexaClientSDK::propertiesInterfaces::test::StubProperties.
|
pure virtualnoexcept |
Removes a property with a given name.
This method removes a property with a given name from a configuration container. If the property doesn't exist, the method succeeds.
[in] | key | Configuration key to remove. |
Implemented in alexaClientSDK::propertiesInterfaces::test::StubProperties.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0