GNUstep CoreBase Library 0.2
CFPropertyList.h
1/* CFPropertyList.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 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_CFPROPERTYLIST_H__
28#define __COREFOUNDATION_CFPROPERTYLIST_H__
29
30#include <CoreFoundation/CFBase.h>
31#include <CoreFoundation/CFData.h>
32#include <CoreFoundation/CFError.h>
33#include <CoreFoundation/CFStream.h>
34
35CF_EXTERN_C_BEGIN
36
40#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
41typedef enum
42{
43 kCFPropertyListOpenStepFormat = 1,
44 kCFPropertyListXMLFormat_v1_0 = 100,
45 kCFPropertyListBinaryFormat_v1_0 = 200
46} CFPropertyListFormat;
47#endif
48
49typedef enum
50{
51 kCFPropertyListImmutable = 0,
52 kCFPropertyListMutableContainers = 1,
53 kCFPropertyListMutableContainersAndLeaves = 2
54} CFPropertyListMutabilityOptions;
55
56#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
57enum
58{
59 kCFPropertyListReadCorruptError = 3840,
60 kCFPropertyListReadUnknownVersionError = 3841,
61 kCFPropertyListReadStreamError = 3842,
62 kCFPropertyListWriteStreamError = 3851,
63};
64#endif
65
66CF_EXPORT CFPropertyListRef
67CFPropertyListCreateDeepCopy (CFAllocatorRef allocator,
68 CFPropertyListRef propertyList,
69 CFOptionFlags mutabilityOption);
70
71#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
72CF_EXPORT CFDataRef
73CFPropertyListCreateData (CFAllocatorRef allocator,
74 CFPropertyListRef propertyList,
75 CFPropertyListFormat format, CFOptionFlags options,
76 CFErrorRef *error);
77
78CF_EXPORT CFPropertyListRef
79CFPropertyListCreateWithData (CFAllocatorRef allocator, CFDataRef data,
80 CFOptionFlags options,
81 CFPropertyListFormat *format,
82 CFErrorRef *error);
83
84CF_EXPORT CFPropertyListRef
85CFPropertyListCreateWithStream (CFAllocatorRef allocator,
86 CFReadStreamRef stream,
87 CFIndex streamLength, CFOptionFlags options,
88 CFPropertyListFormat *format,
89 CFErrorRef *error);
90
91CF_EXPORT CFIndex
92CFPropertyListWrite (CFPropertyListRef propertyList, CFWriteStreamRef stream,
93 CFPropertyListFormat format, CFOptionFlags options,
94 CFErrorRef *error);
95#endif
96
97#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
98CF_EXPORT Boolean
99CFPropertyListIsValid (CFPropertyListRef plist, CFPropertyListFormat format);
100#endif
101
102/* The following function are marked as obsolete as of 10.6 */
103CF_EXPORT CFPropertyListRef
104CFPropertyListCreateFromXMLData (CFAllocatorRef allocator, CFDataRef xmlData,
105 CFOptionFlags mutabilityOption,
106 CFStringRef *errorString);
107
108CF_EXPORT CFDataRef
109CFPropertyListCreateXMLData (CFAllocatorRef allocator,
110 CFPropertyListRef propertyList);
111
112#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
113CF_EXPORT CFPropertyListRef
114CFPropertyListCreateFromStream (CFAllocatorRef allocator,
115 CFReadStreamRef stream,
116 CFIndex streamLength,
117 CFOptionFlags mutabilityOption,
118 CFPropertyListFormat *format,
119 CFStringRef *errorString);
120
121CF_EXPORT CFIndex
122CFPropertyListWriteToStream (CFPropertyListRef propertyList,
123 CFWriteStreamRef stream,
124 CFPropertyListFormat format,
125 CFStringRef *errorString);
126#endif
129CF_EXTERN_C_END
130
131#endif /* __COREFOUNDATION_CFPROPERTYLIST_H__ */
unsigned long CFOptionFlags
Definition CFBase.h:163
signed long CFIndex
Definition CFBase.h:165
const struct __CFAllocator * CFAllocatorRef
A reference to a CFAllocator object.
Definition CFBase.h:301