ftp.nice.ch/Attic/openStep/implementation/gnustep/sources/objcX-0.87.tgz#/objcX-0.87/foundation/GSCoder.h

This is GSCoder.h in view mode; [Download] [Up]

/* Interface for GSCoder class
 *
 * Copyright (C)  1993  The Board of Trustees of  
 * The Leland Stanford Junior University.  All Rights Reserved.
 *
 * Authors: Paul Kunz
 *
 * This file is part of an Objective-C class library
 *
 * GSCoder.h,v 1.7 1995/07/03 18:15:15 pfkeb Exp
 */
 
/* Based on 
 * (Preliminary Documentation) Copyright (c) 1994 by NeXT Computer, Inc.  
 * All Rights Reserved.
 *
 * An implementation of NSCoder that uses GNU TypedStream
 *
 */

#ifndef __GSCoder__include__
#define __GSCoder__include__

#include <objc/Object.h>
#ifdef __NeXT__
#import <appkit/color.h>	/* must use import */
#else
#include <appkit/color.h>
#endif
#include <appkit/graphics.h>
#include <Foundation/NSZone.h>
#include <streams/streams.h>

@class NSString;

@interface GSCoder : Object
{
    void	*stream;
}

// Encoding Data

- (void)encodeArrayOfObjCType:(const char *)types
                        count:(unsigned)count
                           at:(const void *)array;
 /*
  * Serializes data of Objective C types listed in types having count
  * elements residing at address array. 
  */
		
- (void)encodeBycopyObject:(id)anObject;
 /*
  * Overridden by subclasses to serialize the supplied Objective C object so
  * that a copy rather than a proxy of anObject is created upon
  * deserialization.  GSCoder's implementation simply invokes encodeObject:. 
  */
 
- (void)encodeConditionalObject:(id)anObject;
 /*
  * Overridden by subclasses to conditionally serialize the supplied
  * Objective C object.  The object should be serialized only if it is an
  * inherent member of the larger data structure.  GSCoder's implementation
  * simply invokes encodeObject:. 
  */
  
// - (void)encodeDataObject:(NSData *)data;
 /*
  * Serializes the NSData object data. 
  */
 
- (void)encodeObject:(id)anObject;
 /*
  * Serializes the supplied Objective C object. 
  */
 
- (void)encodeObjectReference:(id)anObject;
 /*
  * Serializes the reference to an object
  * Note: this might be what 'encodeConditionalObject' means
  */
  
// - (void)encodePropertyList:(id)plist;
 /*
  * Serializes the supplied property list (NSData, NSArray, NSDictionary, or
  * NSString objects). 
  */
 
// - (void)encodePoint:(NSPoint)point;
 /*
  * Serializes the supplied point structure. 
  */
 
- (void)encodeRect:(NXRect)rect;
 /*
  * Serializes the supplied rectangle structure. 
  */
 
- (void)encodeRootObject:(id)rootObject;
 /*
  * Overridden by subclasses to start the serialization of an interconnected
  * group of  Objective C objects, starting with rootObject.  GSCoder's
  * implementation simply invokes encodeObject:. 
  */
 
- (void)encodeSize:(NXSize)size;
 /*
  * Serializes the supplied size structure. 
  */
 
- (void)encodeColor:(NXColor *)aColor;
 /*
  * Serializes the referenced structure
  */
 
- (void)encodeValueOfObjCType:(const char *)type
                           at:(const void *)address;
 /*
  * Serializes data of Objective C type type residing at address address. 
  */
		
- (void)encodeValuesOfObjCTypes:(const char *)types,...;
 /*
  * Serializes values corresponding to the Objective C types listed in types
  * argument list. 
  */

// Decoding Data

- (void)decodeArrayOfObjCType:(const char *)types
                        count:(unsigned)count
                           at:(void *)address;
 /*
  * Deserializes data of Objective C types listed in type having count
  * elements residing at address address. 
  */
		
// - (NSData *)decodeDataObject;
 /*
  * Deserializes and returns an NSData object. 
  */
 
- (id)decodeObject;
 /*
  * Deserializes an Objective C object. 
  */
 
// - (id)decodePropertyList;
 /*
  * Deserializes a property list (NSData, NSArray, NSDictionary, or NSString
  * objects). 
  */
 
// - (NSPoint)decodePoint;
 /*
  * Deserializes a point structure. 
  */
 
- (NXRect)decodeRect;
 /*
  * Deserializes a rectangle structure. 
  */

- (NXSize)decodeSize;
 /*
  * Deserializes a size structure. 
  */
 
- (NXColor) decodeColor;
 /*
  * Only needed under NeXTSTEP and does nothing
  * not supported by NSCoder
  */
  
- (void)decodeValueOfObjCType:(const char *)type
                           at:(void *)address;
 /*
  * Deserializes data of Objective C type type residing at address address. 
  * You are responsible for releasing the resulting objects. 
  */
 
- (void)decodeValuesOfObjCTypes:(const char *)types,...;
 /*
  * Deserializes values corresponding to the Objective C types listed in
  * types argument list.  You are responsible for releasing the resulting
  * objects. 
  */

// Managing Zones

// - (NSZone *)objectZone;
 /*
  * Returns the memory zone used by deserialized objects.  For instances of
  * GSCoder, this is the default memory zone, the one returned by
  * NSDefaultMallocZone(). 
  */
 
// - (void)setObjectZone:(NSZone *)zone;
 /*
  * Sets the memory zone used by deserialized objects.  Instances of GSCoder
  * always use the default memory zone, the one returned by
  * NSDefaultMallocZone(), and so ignore this method. 
  */

// Getting a Version

// - (unsigned int)systemVersion;
 /*
  * Returns the system version number as of the time the archive was created. 
  */
 
- (unsigned int)versionForClassName:(NSString *)className;
 /*
  * Returns the version number of  the class className as of the time it was
  * archived. 
  */


@end

#endif

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.