11#include <CoreAudio/AudioServerPlugIn.h>
33 explicit Storage(std::shared_ptr<Context> context);
46 std::pair<std::vector<UInt8>,
bool>
ReadBytes(std::string key)
const;
53 std::pair<std::string, bool>
ReadString(std::string key)
const;
68 std::pair<SInt64, bool>
ReadInt(std::string key)
const;
76 std::pair<Float64, bool>
ReadFloat(std::string key)
const;
84 std::pair<CFPropertyListRef, bool>
ReadCustom(std::string key)
const;
91 bool WriteBytes(std::string key, std::vector<UInt8> value);
138 std::pair<T, bool> CopyFromStorage_(
const char* type, std::string key)
const;
141 bool WriteToStorage_(
const char* type, std::string key, T value);
143 bool DeleteFromStorage_(std::string key);
145 const std::shared_ptr<Context> context_;
Plugin persistent storage.
std::pair< std::vector< UInt8 >, bool > ReadBytes(std::string key) const
Read CFData value from storage and decode it into byte array.
bool WriteString(std::string key, std::string value)
Encode C++ string into CFString value and write it to storage.
std::pair< CFPropertyListRef, bool > ReadCustom(std::string key) const
Read CFPropertyList value from storage and return it.
bool WriteBoolean(std::string key, bool value)
Encode bool into CFBoolean value and write it to storage.
bool WriteBytes(std::string key, std::vector< UInt8 > value)
Encode byte array into CFData value and write it to storage.
std::pair< SInt64, bool > ReadInt(std::string key) const
Read CFNumber value from storage and decode it into SInt64.
std::shared_ptr< const Context > GetContext() const
Get context.
std::pair< std::string, bool > ReadString(std::string key) const
Read CFString value from storage and decode it into UTF-8 string.
bool WriteFloat(std::string key, Float64 value)
Encode Float64 into CFNumber value and write it to storage.
std::pair< bool, bool > ReadBoolean(std::string key) const
Read CFBoolean value from storage and decode it into bool.
bool WriteInt(std::string key, SInt64 value)
Encode SInt64 into CFNumber value and write it to storage.
std::pair< Float64, bool > ReadFloat(std::string key) const
Read CFNumber value from storage and decode it into Float64.
bool WriteCustom(std::string key, CFPropertyListRef value)
Write CFPropertyList value to storage.
Storage(std::shared_ptr< Context > context)
Construct storage.
bool Delete(std::string key)
Delete value from storage.