mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-13 18:23:50 +00:00
Implemented CPCoding for CPNull.
This commit is contained in:
1 parent
d2399b6157
commit
5838f1aec8
2 files changed
+34
-3
No files matched your search
+22
-3
@@ -25,7 +25,7 @@
|
||||
|
||||
var CPNullSharedNull = nil;
|
||||
|
||||
/*!
|
||||
/*!
|
||||
@class CPNull
|
||||
@ingroup foundation
|
||||
@brief An object representation of \c nil.
|
||||
@@ -41,7 +41,7 @@ var CPNullSharedNull = nil;
|
||||
{
|
||||
if (CPNullSharedNull)
|
||||
return CPNullSharedNull;
|
||||
|
||||
|
||||
return [super alloc];
|
||||
}*/
|
||||
/*!
|
||||
@@ -53,8 +53,27 @@ var CPNullSharedNull = nil;
|
||||
{
|
||||
if (!CPNullSharedNull)
|
||||
CPNullSharedNull = [[CPNull alloc] init];
|
||||
|
||||
|
||||
return CPNullSharedNull;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns CPNull null.
|
||||
@param aCoder the coder from which to do nothing
|
||||
@return [CPNull null]
|
||||
*/
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
return [CPNull null];
|
||||
}
|
||||
|
||||
/*!
|
||||
Writes out nothing to the specified coder.
|
||||
@param aCoder the coder to which nothing will
|
||||
be written
|
||||
*/
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,12 @@
|
||||
@import <Foundation/CPNull.j>
|
||||
@import <Foundation/CPKeyedArchiver.j>
|
||||
@import <Foundation/CPKeyedUnarchiver.j>
|
||||
|
||||
@implementation CPNullTest : OJTestCase
|
||||
|
||||
- (void)testArchiving
|
||||
{
|
||||
[self assert:[CPKeyedUnarchiver unarchiveObjectWithData:[CPKeyedArchiver archivedDataWithRootObject:[CPNull null]]] equals:[CPNull null]];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user