API  0.9.7
 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 
24 @global _CPRaiseInvalidAbstractInvocation;
25 
34 @implementation CPCoder : CPObject
35 {
36  id __doxygen__;
37 }
38 
43 - (BOOL)allowsKeyedCoding
44 {
45  return NO;
46 }
47 
55 - (void)encodeValueOfObjCType:(CPString)aType at:(id)anObject
56 {
57  _CPRaiseInvalidAbstractInvocation(self, _cmd);
58 }
59 
64 - (void)encodeDataObject:(CPData)aData
65 {
66  _CPRaiseInvalidAbstractInvocation(self, _cmd);
67 }
68 
73 - (void)encodeObject:(id)anObject
74 {
75 // [self encodeValueOfObjCType:@encode(id) at:object];
76 }
77 
82 - (void)encodePoint:(CGPoint)aPoint
83 {
84  [self encodeNumber:aPoint.x];
85  [self encodeNumber:aPoint.y];
86 }
87 
92 - (void)encodeRect:(CGRect)aRect
93 {
94  [self encodePoint:aRect.origin];
95  [self encodeSize:aRect.size];
96 }
97 
102 - (void)encodeSize:(CGSize)aSize
103 {
104  [self encodeNumber:aSize.width];
105  [self encodeNumber:aSize.height];
106 }
107 
112 - (void)encodePropertyList:(id)aPropertyList
113 {
114 // [self encodeValueOfObjCType:@encode(id) at:&propertyList];
115 }
116 
121 - (void)encodeRootObject:(id)anObject
122 {
123  [self encodeObject:anObject];
124 }
125 
130 - (void)encodeBycopyObject:(id)anObject
131 {
132  [self encodeObject:anObject];
133 }
134 
139 - (void)encodeConditionalObject:(id)anObject
140 {
141  [self encodeObject:anObject];
142 }
143 
144 @end
145 
146 @implementation CPObject (CPCoding)
147 
154 - (id)awakeAfterUsingCoder:(CPCoder)aDecoder
155 {
156  return self;
157 }
158 
159 @end