]>
Commit | Line | Data |
---|---|---|
9ce05555 A |
1 | /* |
2 | * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
6 | * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. | |
7 | * | |
8 | * This file contains Original Code and/or Modifications of Original Code | |
9 | * as defined in and that are subject to the Apple Public Source License | |
10 | * Version 2.0 (the 'License'). You may not use this file except in | |
11 | * compliance with the License. Please obtain a copy of the License at | |
12 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
13 | * file. | |
14 | * | |
15 | * The Original Code and all software distributed under the License are | |
16 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
17 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
18 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
19 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
20 | * Please see the License for the specific language governing rights and | |
21 | * limitations under the License. | |
22 | * | |
23 | * @APPLE_LICENSE_HEADER_END@ | |
24 | */ | |
25 | /* CFPropertyList.h | |
26 | Copyright (c) 1998-2003, Apple, Inc. All rights reserved. | |
27 | */ | |
28 | ||
29 | #if !defined(__COREFOUNDATION_CFPROPERTYLIST__) | |
30 | #define __COREFOUNDATION_CFPROPERTYLIST__ 1 | |
31 | ||
32 | #include <CoreFoundation/CFBase.h> | |
33 | #include <CoreFoundation/CFData.h> | |
34 | #include <CoreFoundation/CFString.h> | |
35 | ||
36 | #if defined(__cplusplus) | |
37 | extern "C" { | |
38 | #endif | |
39 | ||
40 | typedef enum { | |
41 | kCFPropertyListImmutable = 0, | |
42 | kCFPropertyListMutableContainers, | |
43 | kCFPropertyListMutableContainersAndLeaves | |
44 | } CFPropertyListMutabilityOptions; | |
45 | ||
46 | /* | |
47 | Creates a property list object from its XML description; xmlData should | |
48 | be the raw bytes of that description, possibly the contents of an XML | |
49 | file. Returns NULL if the data cannot be parsed; if the parse fails | |
50 | and errorString is non-NULL, a human-readable description of the failure | |
51 | is returned in errorString. It is the caller's responsibility to release | |
52 | either the returned object or the error string, whichever is applicable. | |
53 | */ | |
54 | CF_EXPORT | |
55 | CFPropertyListRef CFPropertyListCreateFromXMLData(CFAllocatorRef allocator, CFDataRef xmlData, CFOptionFlags mutabilityOption, CFStringRef *errorString); | |
56 | ||
57 | /* | |
58 | Returns the XML description of the given object; propertyList must | |
59 | be one of the supported property list types, and (for composite types | |
60 | like CFArray and CFDictionary) must not contain any elements that | |
61 | are not themselves of a property list type. If a non-property list | |
62 | type is encountered, NULL is returned. The returned data is | |
63 | appropriate for writing out to an XML file. Note that a data, not a | |
64 | string, is returned because the bytes contain in them a description | |
65 | of the string encoding used. | |
66 | */ | |
67 | CF_EXPORT | |
68 | CFDataRef CFPropertyListCreateXMLData(CFAllocatorRef allocator, CFPropertyListRef propertyList); | |
69 | ||
70 | /* | |
71 | Recursively creates a copy of the given property list (so nested arrays | |
72 | and dictionaries are copied as well as the top-most container). The | |
73 | resulting property list has the mutability characteristics determined | |
74 | by mutabilityOption. | |
75 | */ | |
76 | CF_EXPORT | |
77 | CFPropertyListRef CFPropertyListCreateDeepCopy(CFAllocatorRef allocator, CFPropertyListRef propertyList, CFOptionFlags mutabilityOption); | |
78 | ||
79 | #if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED | |
80 | ||
81 | typedef enum { | |
82 | kCFPropertyListOpenStepFormat = 1, | |
83 | kCFPropertyListXMLFormat_v1_0 = 100, | |
84 | kCFPropertyListBinaryFormat_v1_0 = 200 | |
85 | } CFPropertyListFormat; | |
86 | ||
87 | CF_EXPORT | |
88 | Boolean CFPropertyListIsValid(CFPropertyListRef plist, CFPropertyListFormat format); | |
89 | ||
90 | /* Returns true if the object graph rooted at plist is a valid property list | |
91 | * graph -- that is, no cycles, containing only plist objects, and dictionary | |
92 | * keys are strings. The debugging library version spits out some messages | |
93 | * to be helpful. The plist structure which is to be allowed is given by | |
94 | * the format parameter. */ | |
95 | ||
96 | #endif | |
97 | ||
98 | #if defined(__cplusplus) | |
99 | } | |
100 | #endif | |
101 | ||
102 | #endif /* ! __COREFOUNDATION_CFPROPERTYLIST__ */ | |
103 |