PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Foundation/CPPropertyListSerialization.j

http://github.com/cacaodev/cappuccino
Unknown | 65 lines | 52 code | 13 blank | 0 comment | 0 complexity | a0e2077c92efcb821664f912438b7612 MD5 | raw file
 1/*
 2 * CPPropertyListSerialization.j
 3 * Foundation
 4 *
 5 * Created by Francisco Tolmasky.
 6 * Copyright 2008, 280 North, Inc.
 7 *
 8 * This library is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23@import "CPException.j"
24@import "CPObject.j"
25
26
27CPPropertyListUnknownFormat         = 0;
28CPPropertyListOpenStepFormat        = kCFPropertyListOpenStepFormat;
29CPPropertyListXMLFormat_v1_0        = kCFPropertyListXMLFormat_v1_0;
30CPPropertyListBinaryFormat_v1_0     = kCFPropertyListBinaryFormat_v1_0;
31CPPropertyList280NorthFormat_v1_0   = kCFPropertyList280NorthFormat_v1_0;
32
33@implementation CPPropertyListSerialization : CPObject
34{
35}
36
37+ (CPData)dataFromPropertyList:(id)aPlist format:(CPPropertyListFormat)aFormat
38{
39    return CPPropertyListCreateData(aPlist, aFormat);
40}
41
42+ (id)propertyListFromData:(CPData)data format:(CPPropertyListFormat)aFormat
43{
44    return CPPropertyListCreateFromData(data, aFormat);
45}
46
47@end
48
49@implementation CPPropertyListSerialization (Deprecated)
50
51+ (CPData)dataFromPropertyList:(id)aPlist format:(CPPropertyListFormat)aFormat errorDescription:(id)anErrorString
52{
53    _CPReportLenientDeprecation(self, _cmd, @selector(dataFromPropertyList:format:));
54
55    return [self dataFromPropertyList:aPlist format:aFormat];
56}
57
58+ (id)propertyListFromData:(CPData)data format:(CPPropertyListFormat)aFormat errorDescription:(id)errorString
59{
60    _CPReportLenientDeprecation(self, _cmd, @selector(propertyListFromData:format:));
61
62    return [self propertyListFromData:data format:aFormat];
63}
64
65@end