GNUstep CoreBase Library 0.2
CFDictionary.h
1/* CFDictionary.h
2
3 Copyright (C) 2010 Free Software Foundation, Inc.
4
5 Written by: Stefan Bidigaray
6 Date: January, 2010
7
8 This file is part of the GNUstep CoreBase Library.
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; see the file COPYING.LIB.
22 If not, see <http://www.gnu.org/licenses/> or write to the
23 Free Software Foundation, 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
25*/
26
27#ifndef __COREFOUNDATION_CFDICTIONARY_H__
28#define __COREFOUNDATION_CFDICTIONARY_H__ 1
29
30#include <CoreFoundation/CFBase.h>
31
32CF_EXTERN_C_BEGIN
34typedef const struct __CFDictionary *CFDictionaryRef;
36typedef struct __CFDictionary *CFMutableDictionaryRef;
37
41typedef void (*CFDictionaryApplierFunction) (const void *key,
42 const void *value, void *context);
43
44typedef CFStringRef (*CFDictionaryCopyDescriptionCallBack) (const void *value);
45typedef Boolean (*CFDictionaryEqualCallBack) (const void *value1,
46 const void *value2);
47typedef CFHashCode (*CFDictionaryHashCallBack) (const void *value);
48typedef void (*CFDictionaryReleaseCallBack) (CFAllocatorRef allocator,
49 const void *value);
50typedef const void *(*CFDictionaryRetainCallBack) (CFAllocatorRef allocator,
51 const void *value);
52
53typedef struct _CFDictionaryKeyCallBacks CFDictionaryKeyCallBacks;
55{
56 CFIndex version;
57 CFDictionaryRetainCallBack retain;
58 CFDictionaryReleaseCallBack release;
59 CFDictionaryCopyDescriptionCallBack copyDescription;
60 CFDictionaryEqualCallBack equal;
61 CFDictionaryHashCallBack hash;
62};
63
64typedef struct _CFDictionaryValueCallBacks CFDictionaryValueCallBacks;
66{
67 CFIndex version;
68 CFDictionaryRetainCallBack retain;
69 CFDictionaryReleaseCallBack release;
70 CFDictionaryCopyDescriptionCallBack copyDescription;
71 CFDictionaryEqualCallBack equal;
72};
73
74CF_EXPORT const CFDictionaryKeyCallBacks kCFCopyStringDictionaryKeyCallBacks;
75CF_EXPORT const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks;
76CF_EXPORT const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks;
77
81CF_EXPORT CFDictionaryRef
82CFDictionaryCreate (CFAllocatorRef allocator, const void **keys,
83 const void **values, CFIndex numValues,
84 const CFDictionaryKeyCallBacks * keyCallBacks,
85 const CFDictionaryValueCallBacks * valueCallBacks);
86
87CF_EXPORT CFDictionaryRef
88CFDictionaryCreateCopy (CFAllocatorRef allocator, CFDictionaryRef theDict);
94CF_EXPORT Boolean
95CFDictionaryContainsKey (CFDictionaryRef theDict, const void *key);
96
97CF_EXPORT Boolean
98CFDictionaryContainsValue (CFDictionaryRef theDict, const void *value);
99
100CF_EXPORT CFIndex CFDictionaryGetCount (CFDictionaryRef theDict);
101
102CF_EXPORT CFIndex
103CFDictionaryGetCountOfKey (CFDictionaryRef theDict, const void *key);
104
105CF_EXPORT CFIndex
106CFDictionaryGetCountOfValue (CFDictionaryRef theDict, const void *value);
107
108CF_EXPORT void
109CFDictionaryGetKeysAndValues (CFDictionaryRef theDict, const void **keys,
110 const void **values);
111
112CF_EXPORT const void *CFDictionaryGetValue (CFDictionaryRef theDict,
113 const void *key);
114
115CF_EXPORT Boolean
116CFDictionaryGetValueIfPresent (CFDictionaryRef theDict, const void *key,
117 const void **value);
123CF_EXPORT void
124CFDictionaryApplyFunction (CFDictionaryRef theDict,
125 CFDictionaryApplierFunction applier, void *context);
131CF_EXPORT CFTypeID CFDictionaryGetTypeID (void);
141CF_EXPORT CFMutableDictionaryRef
142CFDictionaryCreateMutable (CFAllocatorRef allocator, CFIndex capacity,
143 const CFDictionaryKeyCallBacks * keyCallBacks,
144 const CFDictionaryValueCallBacks * valueCallBacks);
145
146CF_EXPORT CFMutableDictionaryRef
147CFDictionaryCreateMutableCopy (CFAllocatorRef allocator, CFIndex capacity,
148 CFDictionaryRef theDict);
154CF_EXPORT void
155CFDictionaryAddValue (CFMutableDictionaryRef theDict, const void *key,
156 const void *value);
157
158CF_EXPORT void CFDictionaryRemoveAllValues (CFMutableDictionaryRef theDict);
159
160CF_EXPORT void
161CFDictionaryRemoveValue (CFMutableDictionaryRef theDict, const void *key);
162
163CF_EXPORT void
164CFDictionaryReplaceValue (CFMutableDictionaryRef theDict, const void *key,
165 const void *value);
166
167CF_EXPORT void
168CFDictionarySetValue (CFMutableDictionaryRef theDict, const void *key,
169 const void *value);
173CF_EXTERN_C_END
174#endif /* __COREFOUNDATION_CFDICTIONARY_H__ */
signed long CFIndex
Definition CFBase.h:165
unsigned long CFHashCode
Definition CFBase.h:159
const struct __CFAllocator * CFAllocatorRef
A reference to a CFAllocator object.
Definition CFBase.h:301
Definition CFDictionary.h:55
Definition CFDictionary.h:66