41 #if !defined(__CASettingsStorage_h__)
42 #define __CASettingsStorage_h__
49 #include <CoreAudio/CoreAudioTypes.h>
50 #include <CoreFoundation/CoreFoundation.h>
60 class CASettingsStorage
65 CASettingsStorage(
const char* inSettingsFilePath, mode_t inSettingsFileAccessMode = 0);
70 void CopyBoolValue(
const CFStringRef inKey,
bool& outValue,
bool inDefaultValue =
false)
const;
71 void CopySInt32Value(
const CFStringRef inKey, SInt32& outValue, SInt32 inDefaultValue = 0)
const;
72 void CopyUInt32Value(
const CFStringRef inKey, UInt32& outValue, UInt32 inDefaultValue = 0)
const;
73 void CopySInt64Value(
const CFStringRef inKey, SInt64& outValue, SInt64 inDefaultValue = 0)
const;
74 void CopyUInt64Value(
const CFStringRef inKey, UInt64& outValue, UInt64 inDefaultValue = 0)
const;
75 void CopyFloat32Value(
const CFStringRef inKey, Float32& outValue, Float32 inDefaultValue = 0)
const;
76 void CopyFloat64Value(
const CFStringRef inKey, Float64& outValue, Float64 inDefaultValue = 0)
const;
77 void CopyNumberValue(
const CFStringRef inKey, CFNumberRef& outValue, CFNumberRef inDefaultValue = NULL)
const;
78 void CopyStringValue(
const CFStringRef inKey, CFStringRef& outValue, CFStringRef inDefaultValue = NULL)
const;
79 void CopyArrayValue(
const CFStringRef inKey, CFArrayRef& outValue, CFArrayRef inDefaultValue = NULL)
const;
80 void CopyDictionaryValue(
const CFStringRef inKey, CFDictionaryRef& outValue, CFDictionaryRef inDefaultValue = NULL)
const;
81 void CopyDataValue(
const CFStringRef inKey, CFDataRef& outValue, CFDataRef inDefaultValue = NULL)
const;
82 void CopyCFTypeValue(
const CFStringRef inKey, CFTypeRef& outValue, CFTypeRef inDefaultValue = NULL)
const;
84 void SetSInt32Value(
const CFStringRef inKey, SInt32 inValue);
85 void SetUInt32Value(
const CFStringRef inKey, UInt32 inValue);
86 void SetSInt64Value(
const CFStringRef inKey, SInt64 inValue);
87 void SetUInt64Value(
const CFStringRef inKey, UInt64 inValue);
88 void SetFloat32Value(
const CFStringRef inKey, Float32 inValue);
89 void SetFloat64Value(
const CFStringRef inKey, Float64 inValue);
90 void SetNumberValue(
const CFStringRef inKey,
const CFNumberRef inValue);
91 void SetStringValue(
const CFStringRef inKey,
const CFStringRef inValue);
92 void SetArrayValue(
const CFStringRef inKey,
const CFArrayRef inValue);
93 void SetDictionaryValue(
const CFStringRef inKey,
const CFDictionaryRef inValue);
94 void SetDataValue(
const CFStringRef inKey,
const CFDataRef inValue);
95 void SetCFTypeValue(
const CFStringRef inKey,
const CFTypeRef inValue);
97 void RemoveValue(
const CFStringRef inKey);
98 void RemoveAllValues();
100 void SendNotification(
const CFStringRef inName, CFDictionaryRef inData = NULL,
bool inPostToAllSessions =
true)
const;
105 void RefreshSettings();
108 char* mSettingsFilePath;
109 mode_t mSettingsFileAccessMode;
110 CFMutableDictionaryRef mSettingsCache;
111 struct timespec mSettingsCacheTime;
112 bool mSettingsCacheForceRefresh;