libASPL
|
Plugin persistent storage. More...
#include <aspl/Storage.hpp>
Public Member Functions | |
Storage (std::shared_ptr< Context > context) | |
Construct storage. | |
Storage (const Storage &)=delete | |
Storage & | operator= (const Storage &)=delete |
std::shared_ptr< const Context > | GetContext () const |
Get context. | |
std::pair< std::vector< UInt8 >, bool > | ReadBytes (std::string key) const |
Read CFData value from storage and decode it into byte array. | |
std::pair< std::string, bool > | ReadString (std::string key) const |
Read CFString value from storage and decode it into UTF-8 string. | |
std::pair< bool, bool > | ReadBoolean (std::string key) const |
Read CFBoolean value from storage and decode it into bool. | |
std::pair< SInt64, bool > | ReadInt (std::string key) const |
Read CFNumber value from storage and decode it into SInt64. | |
std::pair< Float64, bool > | ReadFloat (std::string key) const |
Read CFNumber value from storage and decode it into Float64. | |
std::pair< CFPropertyListRef, bool > | ReadCustom (std::string key) const |
Read CFPropertyList value from storage and return it. | |
bool | WriteBytes (std::string key, std::vector< UInt8 > value) |
Encode byte array into CFData value and write it to storage. | |
bool | WriteString (std::string key, std::string value) |
Encode C++ string into CFString value and write it to storage. | |
bool | WriteBoolean (std::string key, bool value) |
Encode bool into CFBoolean value and write it to storage. | |
bool | WriteInt (std::string key, SInt64 value) |
Encode SInt64 into CFNumber value and write it to storage. | |
bool | WriteFloat (std::string key, Float64 value) |
Encode Float64 into CFNumber value and write it to storage. | |
bool | WriteCustom (std::string key, CFPropertyListRef value) |
Write CFPropertyList value to storage. | |
bool | Delete (std::string key) |
Delete value from storage. | |
Plugin persistent storage.
Storage data persists across audio server restart and rebooting. Storage keys for one plug-in do not collide with the keys for other plug-ins.
This class is a wrapper for "Storage Operations" API in AudioServerPlugInHostInterface, which is stored in Context.Host. It becomes available during driver initialization; until that, attempt to use Storage methods will lead to errors.
Definition at line 29 of file Storage.hpp.
|
explicit |
Construct storage.
bool aspl::Storage::Delete | ( | std::string | key | ) |
Delete value from storage.
std::shared_ptr< const Context > aspl::Storage::GetContext | ( | ) | const |
Get context.
std::pair< bool, bool > aspl::Storage::ReadBoolean | ( | std::string | key | ) | const |
Read CFBoolean value from storage and decode it into bool.
std::pair< std::vector< UInt8 >, bool > aspl::Storage::ReadBytes | ( | std::string | key | ) | const |
Read CFData value from storage and decode it into byte array.
std::pair< CFPropertyListRef, bool > aspl::Storage::ReadCustom | ( | std::string | key | ) | const |
Read CFPropertyList value from storage and return it.
std::pair< Float64, bool > aspl::Storage::ReadFloat | ( | std::string | key | ) | const |
Read CFNumber value from storage and decode it into Float64.
std::pair< SInt64, bool > aspl::Storage::ReadInt | ( | std::string | key | ) | const |
Read CFNumber value from storage and decode it into SInt64.
std::pair< std::string, bool > aspl::Storage::ReadString | ( | std::string | key | ) | const |
Read CFString value from storage and decode it into UTF-8 string.
bool aspl::Storage::WriteBoolean | ( | std::string | key, |
bool | value ) |
Encode bool into CFBoolean value and write it to storage.
bool aspl::Storage::WriteBytes | ( | std::string | key, |
std::vector< UInt8 > | value ) |
Encode byte array into CFData value and write it to storage.
bool aspl::Storage::WriteCustom | ( | std::string | key, |
CFPropertyListRef | value ) |
Write CFPropertyList value to storage.
bool aspl::Storage::WriteFloat | ( | std::string | key, |
Float64 | value ) |
Encode Float64 into CFNumber value and write it to storage.
bool aspl::Storage::WriteInt | ( | std::string | key, |
SInt64 | value ) |
Encode SInt64 into CFNumber value and write it to storage.
bool aspl::Storage::WriteString | ( | std::string | key, |
std::string | value ) |
Encode C++ string into CFString value and write it to storage.