1 //===-- CFCMutableDictionary.h ----------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef CoreFoundationCPP_CFMutableDictionary_h_ 11 #define CoreFoundationCPP_CFMutableDictionary_h_ 12 13 #include "CFCReleaser.h" 14 15 class CFCMutableDictionary : public CFCReleaser<CFMutableDictionaryRef> 16 { 17 public: 18 //------------------------------------------------------------------ 19 // Constructors and Destructors 20 //------------------------------------------------------------------ 21 CFCMutableDictionary(CFMutableDictionaryRef s = NULL); 22 CFCMutableDictionary(const CFCMutableDictionary& rhs); 23 virtual ~CFCMutableDictionary(); 24 25 //------------------------------------------------------------------ 26 // Operators 27 //------------------------------------------------------------------ 28 const CFCMutableDictionary& 29 operator=(const CFCMutableDictionary& rhs); 30 31 32 CFIndex GetCount() const; 33 CFIndex GetCountOfKey(const void *value) const; 34 CFIndex GetCountOfValue(const void *value) const; 35 void GetKeysAndValues(const void **keys, const void **values) const; 36 const void * GetValue(const void *key) const; 37 Boolean GetValueIfPresent(const void *key, const void **value_handle) const; 38 bool AddValue(CFStringRef key, const void *value, bool can_create = false); 39 bool SetValue(CFStringRef key, const void *value, bool can_create = false); 40 bool AddValueSInt8(CFStringRef key, int8_t value, bool can_create = false); 41 bool SetValueSInt8(CFStringRef key, int8_t value, bool can_create = false); 42 bool AddValueSInt16(CFStringRef key, int16_t value, bool can_create = false); 43 bool SetValueSInt16(CFStringRef key, int16_t value, bool can_create = false); 44 bool AddValueSInt32(CFStringRef key, int32_t value, bool can_create = false); 45 bool SetValueSInt32(CFStringRef key, int32_t value, bool can_create = false); 46 bool AddValueSInt64(CFStringRef key, int64_t value, bool can_create = false); 47 bool SetValueSInt64(CFStringRef key, int64_t value, bool can_create = false); 48 bool AddValueUInt8(CFStringRef key, uint8_t value, bool can_create = false); 49 bool SetValueUInt8(CFStringRef key, uint8_t value, bool can_create = false); 50 bool AddValueUInt16(CFStringRef key, uint16_t value, bool can_create = false); 51 bool SetValueUInt16(CFStringRef key, uint16_t value, bool can_create = false); 52 bool AddValueUInt32(CFStringRef key, uint32_t value, bool can_create = false); 53 bool SetValueUInt32(CFStringRef key, uint32_t value, bool can_create = false); 54 bool AddValueUInt64(CFStringRef key, uint64_t value, bool can_create = false); 55 bool SetValueUInt64(CFStringRef key, uint64_t value, bool can_create = false); 56 bool AddValueDouble(CFStringRef key, double value, bool can_create = false); 57 bool SetValueDouble(CFStringRef key, double value, bool can_create = false); 58 bool AddValueCString(CFStringRef key, const char *cstr, bool can_create = false); 59 bool SetValueCString(CFStringRef key, const char *cstr, bool can_create = false); 60 void RemoveValue(const void *value); 61 void ReplaceValue(const void *key, const void *value); 62 void RemoveAllValues(); 63 CFMutableDictionaryRef Dictionary(bool can_create); 64 65 66 protected: 67 //------------------------------------------------------------------ 68 // Classes that inherit from CFCMutableDictionary can see and modify these 69 //------------------------------------------------------------------ 70 71 private: 72 //------------------------------------------------------------------ 73 // For CFCMutableDictionary only 74 //------------------------------------------------------------------ 75 76 }; 77 78 79 #endif // CoreFoundationCPP_CFMutableDictionary_h_ 80