// ---------------------------------------------------------------------
// Copyright (C) 2002 by Codeon GmbH. All rights reserved.
//
// Autor: nat
//
// $Id: NSObject+PListOldSkool.m,v 1.1 2002/09/09 10:42:12 nat Exp $
//
// $Log: NSObject+PListOldSkool.m,v $
// Revision 1.1  2002/09/09 10:42:12  nat
// OldSkool PList writing for Solaris compatibility
//
//
// ---------------------------------------------------------------------
#import "NSObject+PListOldSkool.h"


@implementation NSObject( PListOldSkool)

- (NSString *) plistDescription:(NSString *) prefix
{
   return( [self description]);
}

@end


@implementation NSString ( PListOldSkool)

- (NSString *) plistDescription:(NSString *) prefix
{
   return( [NSString stringWithFormat:@"\"%@\"", self]);
}

@end


@implementation NSArray ( PListOldSkool)

- (NSString *) plistDescription:(NSString *) prefix
{
   NSMutableString   *string;
   NSEnumerator      *rover;
   id                object;
   NSString          *prefix2;
   
   prefix2 = [@"   " stringByAppendingString:prefix];
   
   string = [NSMutableString string];
   
   if( [self count] > 0)
   {
      [string appendString:@"(\n"];
      
      rover = [self objectEnumerator];
      object = [rover nextObject];
      do
      {
         [string appendString:prefix2];
         [string appendString:[object plistDescription:prefix2]];
         object = [rover nextObject];
         if( object)
            [string appendString:@","];
         [string appendString:@"\n"];
      }
      while( object);
      [string appendString:prefix];
      [string appendString:@")"];
   }
   else
      [string appendString:@"()"];
   
   return( string);
}      

@end