rfm@gnu.org
)Copyright: (C) 2004 Free Software Foundation, Inc.
- Declared in:
- Foundation/NSPropertyList.h
Standards:
- MacOS-X
- NotOpenStep
- GNUstep
The NSPropertyListSerialization class provides facilities for serialising and deserializing property list data in a number of formats. A property list is roughly an NSArray or NSDictionary object, with these or NSNumber , NSData , NSString , or NSDate objects as members. (See below.)
You do not work with instances of this class, instead you use a small number of class methods to serialize and deserialize property lists.
A property list may only
be one of the following classes -
( "one", "two", "three" )In XML format, an array is an element whose name is
array
and whose content is the array
content.
<array><string>one</string><string>two</string><string>three</string></array>
< 54637374 696D67 >In XML format, a data object is an element whose name is
data
and whose content is a stream of
base64 encoded bytes.
<*D2002-03-22 11:30:00 +0100>In XML format, a date object is an element whose name is
date
and whose content is a date in the
above format.
<date>2002-03-22 11:30:00 +0100</date>
{ "key1" = "value1"; }In XML format, a dictionary is an element whose name is
dictionary
and whose content consists of
pairs of strings and other property list
objects.
<dictionary> <string>key1</string> <string>value1</string> </dictionary>
<*BY>
for
YES
or <*BN>
for
NO
. <true />
or
<false />
<*INNN>
where NNN
is an integer. <integer>NNN<integer>
<*RNNN>
where NNN is a
real number. <real>NNN<real>
"hello world & others"In XML format, the string is simply stored in UTF8 format as the content of a
string
element, and the
only character escapes required are those used by XML
such as the '<' markup representing a '<'
character.
<string>hello world & others</string>"
Creates and returns a data object containing a
serialized representation of plist. The argument
aFormat is used to determine the way in
which the data is serialised, and the
anErrorString argument is a pointer in
which an error message is returned on failure (
nil
is returned on success).
Returns a flag indicating whether it is possible to serialize aPropertyList in the format aFormat.
Deserialises dataItem and returns the
resulting property list (or nil
if
the data does not contain a property list
serialised in a supported format).
The
argument anOption is used to control
whether the objects making up the deserialized
property list are mutable or not.
The
argument aFormat is either null or a
pointer to a location in which the format of the
serialized property list will be returned.
Either nil
or an error message
will be returned in anErrorString.