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 public:
17   //------------------------------------------------------------------
18   // Constructors and Destructors
19   //------------------------------------------------------------------
20   CFCMutableDictionary(CFMutableDictionaryRef s = NULL);
21   CFCMutableDictionary(const CFCMutableDictionary &rhs);
22   virtual ~CFCMutableDictionary();
23 
24   //------------------------------------------------------------------
25   // Operators
26   //------------------------------------------------------------------
27   const CFCMutableDictionary &operator=(const CFCMutableDictionary &rhs);
28 
29   CFIndex GetCount() const;
30   CFIndex GetCountOfKey(const void *value) const;
31   CFIndex GetCountOfValue(const void *value) const;
32   void GetKeysAndValues(const void **keys, const void **values) const;
33   const void *GetValue(const void *key) const;
34   Boolean GetValueIfPresent(const void *key, const void **value_handle) const;
35   bool AddValue(CFStringRef key, const void *value, bool can_create = false);
36   bool SetValue(CFStringRef key, const void *value, bool can_create = false);
37   bool AddValueSInt8(CFStringRef key, int8_t value, bool can_create = false);
38   bool SetValueSInt8(CFStringRef key, int8_t value, bool can_create = false);
39   bool AddValueSInt16(CFStringRef key, int16_t value, bool can_create = false);
40   bool SetValueSInt16(CFStringRef key, int16_t value, bool can_create = false);
41   bool AddValueSInt32(CFStringRef key, int32_t value, bool can_create = false);
42   bool SetValueSInt32(CFStringRef key, int32_t value, bool can_create = false);
43   bool AddValueSInt64(CFStringRef key, int64_t value, bool can_create = false);
44   bool SetValueSInt64(CFStringRef key, int64_t value, bool can_create = false);
45   bool AddValueUInt8(CFStringRef key, uint8_t value, bool can_create = false);
46   bool SetValueUInt8(CFStringRef key, uint8_t value, bool can_create = false);
47   bool AddValueUInt16(CFStringRef key, uint16_t value, bool can_create = false);
48   bool SetValueUInt16(CFStringRef key, uint16_t value, bool can_create = false);
49   bool AddValueUInt32(CFStringRef key, uint32_t value, bool can_create = false);
50   bool SetValueUInt32(CFStringRef key, uint32_t value, bool can_create = false);
51   bool AddValueUInt64(CFStringRef key, uint64_t value, bool can_create = false);
52   bool SetValueUInt64(CFStringRef key, uint64_t value, bool can_create = false);
53   bool AddValueDouble(CFStringRef key, double value, bool can_create = false);
54   bool SetValueDouble(CFStringRef key, double value, bool can_create = false);
55   bool AddValueCString(CFStringRef key, const char *cstr,
56                        bool can_create = false);
57   bool SetValueCString(CFStringRef key, const char *cstr,
58                        bool can_create = false);
59   void RemoveValue(const void *value);
60   void ReplaceValue(const void *key, const void *value);
61   void RemoveAllValues();
62   CFMutableDictionaryRef Dictionary(bool can_create);
63 
64 protected:
65   //------------------------------------------------------------------
66   // Classes that inherit from CFCMutableDictionary can see and modify these
67   //------------------------------------------------------------------
68 
69 private:
70   //------------------------------------------------------------------
71   // For CFCMutableDictionary only
72   //------------------------------------------------------------------
73 };
74 
75 #endif // CoreFoundationCPP_CFMutableDictionary_h_
76