API  0.9.10
CPCoder.j
Go to the documentation of this file.
1 /*
2  * CPCoder.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 
24 @global _CPRaiseInvalidAbstractInvocation;
25 
33 @implementation CPCoder : CPObject
34 {
35  id __doxygen__;
36 }
37 
43 {
44  return NO;
45 }
46 
54 - (void)encodeValueOfObjJType:(CPString)aType at:(id)anObject
55 {
56  _CPRaiseInvalidAbstractInvocation(self, _cmd);
57 }
58 
63 - (void)encodeDataObject:(CPData)aData
64 {
65  _CPRaiseInvalidAbstractInvocation(self, _cmd);
66 }
67 
72 - (void)encodeObject:(id)anObject
73 {
74 // [self encodeValueOfObjCType:@encode(id) at:object];
75 }
76 
81 - (void)encodePoint:(CGPoint)aPoint
82 {
83  [self encodeNumber:aPoint.x];
84  [self encodeNumber:aPoint.y];
85 }
86 
91 - (void)encodeRect:(CGRect)aRect
92 {
93  [self encodePoint:aRect.origin];
94  [self encodeSize:aRect.size];
95 }
96 
101 - (void)encodeSize:(CGSize)aSize
102 {
103  [self encodeNumber:aSize.width];
104  [self encodeNumber:aSize.height];
105 }
106 
111 - (void)encodePropertyList:(id)aPropertyList
112 {
113 // [self encodeValueOfObjCType:@encode(id) at:&propertyList];
114 }
115 
120 - (void)encodeRootObject:(id)anObject
121 {
122  [self encodeObject:anObject];
123 }
124 
129 - (void)encodeBycopyObject:(id)anObject
130 {
131  [self encodeObject:anObject];
132 }
133 
138 - (void)encodeConditionalObject:(id)anObject
139 {
140  [self encodeObject:anObject];
141 }
142 
143 @end
144 
145 @implementation CPObject (CPCoding)
146 
153 - (id)awakeAfterUsingCoder:(CPCoder)aDecoder
154 {
155  return self;
156 }
157 
158 @end
A Cappuccino wrapper for any data type.
Definition: CPData.h:2
An immutable string (collection of characters).
Definition: CPString.h:2
void encodeSize:(CGSize aSize)
Definition: CPCoder.j:101
Defines methods for use when archiving & restoring (enc/decoding).
Definition: CPCoder.h:2
void encodeObject:(id anObject)
Definition: CPCoder.j:72
void encodePoint:(CGPoint aPoint)
Definition: CPCoder.j:81
BOOL allowsKeyedCoding()
Definition: CPCoder.j:42