API  0.9.6
 All Classes Files Functions Variables Macros Groups Pages
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 
32 @implementation CPCoder : CPObject
33 {
34  id __doxygen__;
35 }
36 
41 - (BOOL)allowsKeyedCoding
42 {
43  return NO;
44 }
45 
53 - (void)encodeValueOfObjCType:(CPString)aType at:(id)anObject
54 {
55  _CPRaiseInvalidAbstractInvocation(self, _cmd);
56 }
57 
62 - (void)encodeDataObject:(CPData)aData
63 {
64  _CPRaiseInvalidAbstractInvocation(self, _cmd);
65 }
66 
71 - (void)encodeObject:(id)anObject
72 {
73 // [self encodeValueOfObjCType:@encode(id) at:object];
74 }
75 
80 - (void)encodePoint:(CPPoint)aPoint
81 {
82  [self encodeNumber:aPoint.x];
83  [self encodeNumber:aPoint.y];
84 }
85 
90 - (void)encodeRect:(CGRect)aRect
91 {
92  [self encodePoint:aRect.origin];
93  [self encodeSize:aRect.size];
94 }
95 
100 - (void)encodeSize:(CPSize)aSize
101 {
102  [self encodeNumber:aSize.width];
103  [self encodeNumber:aSize.height];
104 }
105 
110 - (void)encodePropertyList:(id)aPropertyList
111 {
112 // [self encodeValueOfObjCType:@encode(id) at:&propertyList];
113 }
114 
119 - (void)encodeRootObject:(id)anObject
120 {
121  [self encodeObject:anObject];
122 }
123 
128 - (void)encodeBycopyObject:(id)anObject
129 {
130  [self encodeObject:anObject];
131 }
132 
137 - (void)encodeConditionalObject:(id)anObject
138 {
139  [self encodeObject:anObject];
140 }
141 
142 @end
143 
144 @implementation CPObject (CPCoding)
145 
152 - (id)awakeAfterUsingCoder:(CPCoder)aDecoder
153 {
154  return self;
155 }
156 
157 @end