33 return ::CFDictionaryGetCount(dict);
42 return ::CFDictionaryGetCountOfKey(dict, key);
51 return ::CFDictionaryGetCountOfValue(dict, value);
56 const void **values)
const {
59 ::CFDictionaryGetKeysAndValues(dict, keys, values);
67 return ::CFDictionaryGetValue(dict, key);
73 const void **value_handle)
const {
76 return ::CFDictionaryGetValueIfPresent(dict, key, value_handle);
82 if (can_create && dict == NULL) {
83 dict = ::CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
84 &kCFTypeDictionaryKeyCallBacks,
85 &kCFTypeDictionaryValueCallBacks);
96 ::CFDictionaryAddValue(dict, key, value);
107 ::CFDictionarySetValue(dict, key, value);
118 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt8Type, &value));
119 if (cf_number.
get()) {
121 ::CFDictionaryAddValue(dict, key, cf_number.
get());
133 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt8Type, &value));
134 if (cf_number.
get()) {
136 ::CFDictionarySetValue(dict, key, cf_number.
get());
148 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt16Type, &value));
149 if (cf_number.
get()) {
151 ::CFDictionaryAddValue(dict, key, cf_number.
get());
163 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt16Type, &value));
164 if (cf_number.
get()) {
166 ::CFDictionarySetValue(dict, key, cf_number.
get());
178 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value));
179 if (cf_number.
get()) {
181 ::CFDictionaryAddValue(dict, key, cf_number.
get());
193 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value));
194 if (cf_number.
get()) {
196 ::CFDictionarySetValue(dict, key, cf_number.
get());
208 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &value));
209 if (cf_number.
get()) {
211 ::CFDictionaryAddValue(dict, key, cf_number.
get());
223 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &value));
224 if (cf_number.
get()) {
226 ::CFDictionarySetValue(dict, key, cf_number.
get());
239 int16_t sval = value;
241 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt16Type, &sval));
242 if (cf_number.
get()) {
244 ::CFDictionaryAddValue(dict, key, cf_number.
get());
257 int16_t sval = value;
259 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt16Type, &sval));
260 if (cf_number.
get()) {
262 ::CFDictionarySetValue(dict, key, cf_number.
get());
275 int32_t sval = value;
277 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &sval));
278 if (cf_number.
get()) {
280 ::CFDictionaryAddValue(dict, key, cf_number.
get());
293 int32_t sval = value;
295 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &sval));
296 if (cf_number.
get()) {
298 ::CFDictionarySetValue(dict, key, cf_number.
get());
311 int64_t sval = value;
313 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &sval));
314 if (cf_number.
get()) {
316 ::CFDictionaryAddValue(dict, key, cf_number.
get());
329 int64_t sval = value;
331 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &sval));
332 if (cf_number.
get()) {
334 ::CFDictionarySetValue(dict, key, cf_number.
get());
349 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &value));
350 if (cf_number.
get()) {
352 ::CFDictionaryAddValue(dict, key, cf_number.
get());
367 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &value));
368 if (cf_number.
get()) {
370 ::CFDictionarySetValue(dict, key, cf_number.
get());
385 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &value));
386 if (cf_number.
get()) {
388 ::CFDictionaryAddValue(dict, key, cf_number.
get());
403 ::CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &value));
404 if (cf_number.
get()) {
406 ::CFDictionarySetValue(dict, key, cf_number.
get());
417 CFCString cf_str(cstr, kCFStringEncodingUTF8);
420 ::CFDictionaryAddValue(dict, key, cf_str.
get());
431 CFCString cf_str(cstr, kCFStringEncodingUTF8);
434 ::CFDictionarySetValue(dict, key, cf_str.
get());
444 ::CFDictionaryRemoveAllValues(dict);
450 ::CFDictionaryRemoveValue(dict, value);
455 ::CFDictionaryReplaceValue(dict, key, value);
CFCMutableDictionary(CFMutableDictionaryRef s=NULL)
bool SetValue(CFStringRef key, const void *value, bool can_create=false)
CFIndex GetCountOfKey(const void *value) const
const CFCMutableDictionary & operator=(const CFCMutableDictionary &rhs)
bool SetValueSInt64(CFStringRef key, int64_t value, bool can_create=false)
bool AddValueSInt16(CFStringRef key, int16_t value, bool can_create=false)
bool AddValue(CFStringRef key, const void *value, bool can_create=false)
bool AddValueUInt16(CFStringRef key, uint16_t value, bool can_create=false)
bool AddValueSInt8(CFStringRef key, int8_t value, bool can_create=false)
bool SetValueDouble(CFStringRef key, double value, bool can_create=false)
bool SetValueUInt64(CFStringRef key, uint64_t value, bool can_create=false)
bool AddValueDouble(CFStringRef key, double value, bool can_create=false)
bool SetValueCString(CFStringRef key, const char *cstr, bool can_create=false)
bool AddValueUInt32(CFStringRef key, uint32_t value, bool can_create=false)
void RemoveValue(const void *value)
bool SetValueSInt32(CFStringRef key, int32_t value, bool can_create=false)
void GetKeysAndValues(const void **keys, const void **values) const
const void * GetValue(const void *key) const
bool SetValueUInt8(CFStringRef key, uint8_t value, bool can_create=false)
bool AddValueUInt64(CFStringRef key, uint64_t value, bool can_create=false)
void ReplaceValue(const void *key, const void *value)
bool AddValueCString(CFStringRef key, const char *cstr, bool can_create=false)
~CFCMutableDictionary() override
CFMutableDictionaryRef Dictionary(bool can_create)
bool SetValueUInt16(CFStringRef key, uint16_t value, bool can_create=false)
CFIndex GetCountOfValue(const void *value) const
bool SetValueSInt16(CFStringRef key, int16_t value, bool can_create=false)
bool AddValueSInt64(CFStringRef key, int64_t value, bool can_create=false)
bool AddValueSInt32(CFStringRef key, int32_t value, bool can_create=false)
bool SetValueUInt32(CFStringRef key, uint32_t value, bool can_create=false)
Boolean GetValueIfPresent(const void *key, const void **value_handle) const
bool AddValueUInt8(CFStringRef key, uint8_t value, bool can_create=false)
bool SetValueSInt8(CFStringRef key, int8_t value, bool can_create=false)
CFMutableDictionaryRef get()
void reset(CFMutableDictionaryRef ptr=NULL)