Add description methods.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2408 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 1997-09-01 22:12:12 +00:00
parent df050acf75
commit 0bcb15c30f
4 changed files with 39 additions and 3 deletions

View file

@ -86,7 +86,25 @@
{
return data;
}
- (NSString *) description
{
#if TYPE_ORDER == 0
return [NSString stringWithFormat: @"{object = %@}", [data description]];
#elif TYPE_ORDER == 1
return [NSString stringWithFormat: @"{x = %g; y = %g}", data.x, data.y];
#elif TYPE_ORDER == 2
return [NSString stringWithFormat: @"{pointer = %p}", data];
#elif TYPE_ORDER == 3
return [NSString stringWithFormat:
@"{x = %g; y = %g; width = %g; height = %g}", NSMinX(data), NSMinY(data),
NSWidth(data), NSHeight(data)];
#elif TYPE_ORDER == 4
return [NSString stringWithFormat: @"{width = %g; height = %g}",
data.width, data.height];
#endif
}
// NSCoding
- (void)encodeWithCoder:(NSCoder *)coder
{