1 //===-- CFCMutableDictionary.h ----------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEDICTIONARY_H 10 #define LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEDICTIONARY_H 11 12 #include "CFCReleaser.h" 13 14 class CFCMutableDictionary : public CFCReleaser<CFMutableDictionaryRef> { 15 public: 16 // Constructors and Destructors 17 CFCMutableDictionary(CFMutableDictionaryRef s = NULL); 18 CFCMutableDictionary(const CFCMutableDictionary &rhs); 19 virtual ~CFCMutableDictionary(); 20 21 // Operators 22 const CFCMutableDictionary &operator=(const CFCMutableDictionary &rhs); 23 24 CFIndex GetCount() const; 25 CFIndex GetCountOfKey(const void *value) const; 26 CFIndex GetCountOfValue(const void *value) const; 27 void GetKeysAndValues(const void **keys, const void **values) const; 28 const void *GetValue(const void *key) const; 29 Boolean GetValueIfPresent(const void *key, const void **value_handle) const; 30 bool AddValue(CFStringRef key, const void *value, bool can_create = false); 31 bool SetValue(CFStringRef key, const void *value, bool can_create = false); 32 bool AddValueSInt8(CFStringRef key, int8_t value, bool can_create = false); 33 bool SetValueSInt8(CFStringRef key, int8_t value, bool can_create = false); 34 bool AddValueSInt16(CFStringRef key, int16_t value, bool can_create = false); 35 bool SetValueSInt16(CFStringRef key, int16_t value, bool can_create = false); 36 bool AddValueSInt32(CFStringRef key, int32_t value, bool can_create = false); 37 bool SetValueSInt32(CFStringRef key, int32_t value, bool can_create = false); 38 bool AddValueSInt64(CFStringRef key, int64_t value, bool can_create = false); 39 bool SetValueSInt64(CFStringRef key, int64_t value, bool can_create = false); 40 bool AddValueUInt8(CFStringRef key, uint8_t value, bool can_create = false); 41 bool SetValueUInt8(CFStringRef key, uint8_t value, bool can_create = false); 42 bool AddValueUInt16(CFStringRef key, uint16_t value, bool can_create = false); 43 bool SetValueUInt16(CFStringRef key, uint16_t value, bool can_create = false); 44 bool AddValueUInt32(CFStringRef key, uint32_t value, bool can_create = false); 45 bool SetValueUInt32(CFStringRef key, uint32_t value, bool can_create = false); 46 bool AddValueUInt64(CFStringRef key, uint64_t value, bool can_create = false); 47 bool SetValueUInt64(CFStringRef key, uint64_t value, bool can_create = false); 48 bool AddValueDouble(CFStringRef key, double value, bool can_create = false); 49 bool SetValueDouble(CFStringRef key, double value, bool can_create = false); 50 bool AddValueCString(CFStringRef key, const char *cstr, 51 bool can_create = false); 52 bool SetValueCString(CFStringRef key, const char *cstr, 53 bool can_create = false); 54 void RemoveValue(const void *value); 55 void ReplaceValue(const void *key, const void *value); 56 void RemoveAllValues(); 57 CFMutableDictionaryRef Dictionary(bool can_create); 58 59 protected: 60 // Classes that inherit from CFCMutableDictionary can see and modify these 61 62 private: 63 // For CFCMutableDictionary only 64 }; 65 66 #endif // LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEDICTIONARY_H 67