![]() |
API 0.9.5
|
00001 /* 00002 * CPCoder.j 00003 * Foundation 00004 * 00005 * Created by Francisco Tolmasky. 00006 * Copyright 2008, 280 North, Inc. 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 00032 @implementation CPCoder : CPObject 00033 { 00034 id __doxygen__; 00035 } 00036 00041 - (BOOL)allowsKeyedCoding 00042 { 00043 return NO; 00044 } 00045 00053 - (void)encodeValueOfObjCType:(CPString)aType at:(id)anObject 00054 { 00055 _CPRaiseInvalidAbstractInvocation(self, _cmd); 00056 } 00057 00062 - (void)encodeDataObject:(CPData)aData 00063 { 00064 _CPRaiseInvalidAbstractInvocation(self, _cmd); 00065 } 00066 00071 - (void)encodeObject:(id)anObject 00072 { 00073 // [self encodeValueOfObjCType:@encode(id) at:object]; 00074 } 00075 00080 - (void)encodePoint:(CPPoint)aPoint 00081 { 00082 [self encodeNumber:aPoint.x]; 00083 [self encodeNumber:aPoint.y]; 00084 } 00085 00090 - (void)encodeRect:(CGRect)aRect 00091 { 00092 [self encodePoint:aRect.origin]; 00093 [self encodeSize:aRect.size]; 00094 } 00095 00100 - (void)encodeSize:(CPSize)aSize 00101 { 00102 [self encodeNumber:aSize.width]; 00103 [self encodeNumber:aSize.height]; 00104 } 00105 00110 - (void)encodePropertyList:(id)aPropertyList 00111 { 00112 // [self encodeValueOfObjCType:@encode(id) at:&propertyList]; 00113 } 00114 00119 - (void)encodeRootObject:(id)anObject 00120 { 00121 [self encodeObject:anObject]; 00122 } 00123 00128 - (void)encodeBycopyObject:(id)anObject 00129 { 00130 [self encodeObject:anObject]; 00131 } 00132 00137 - (void)encodeConditionalObject:(id)anObject 00138 { 00139 [self encodeObject:anObject]; 00140 } 00141 00142 @end 00143 00144 @implementation CPObject (CPCoding) 00145 00152 - (id)awakeAfterUsingCoder:(CPCoder)aDecoder 00153 { 00154 return self; 00155 } 00156 00157 @end