2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
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
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.
23 * @APPLE_LICENSE_HEADER_END@
26 Copyright (c) 1998-2003, Apple, Inc. All rights reserved.
29 #if !defined(__COREFOUNDATION_CFPROPERTYLIST__)
30 #define __COREFOUNDATION_CFPROPERTYLIST__ 1
32 #include <CoreFoundation/CFBase.h>
33 #include <CoreFoundation/CFData.h>
34 #include <CoreFoundation/CFString.h>
36 #if defined(__cplusplus)
41 kCFPropertyListImmutable
= 0,
42 kCFPropertyListMutableContainers
,
43 kCFPropertyListMutableContainersAndLeaves
44 } CFPropertyListMutabilityOptions
;
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.
55 CFPropertyListRef
CFPropertyListCreateFromXMLData(CFAllocatorRef allocator
, CFDataRef xmlData
, CFOptionFlags mutabilityOption
, CFStringRef
*errorString
);
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.
68 CFDataRef
CFPropertyListCreateXMLData(CFAllocatorRef allocator
, CFPropertyListRef propertyList
);
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
77 CFPropertyListRef
CFPropertyListCreateDeepCopy(CFAllocatorRef allocator
, CFPropertyListRef propertyList
, CFOptionFlags mutabilityOption
);
79 #if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED
82 kCFPropertyListOpenStepFormat
= 1,
83 kCFPropertyListXMLFormat_v1_0
= 100,
84 kCFPropertyListBinaryFormat_v1_0
= 200
85 } CFPropertyListFormat
;
88 Boolean
CFPropertyListIsValid(CFPropertyListRef plist
, CFPropertyListFormat format
);
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. */
98 #if defined(__cplusplus)
102 #endif /* ! __COREFOUNDATION_CFPROPERTYLIST__ */