home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / Foundation.framework / Versions / B / Headers / NSCompatibility.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-24  |  2.6 KB  |  90 lines

  1. /*    NSCompatibility.h
  2.     Copyright 1994-1996, NeXT Software, Inc.  All rights reserved.
  3. */
  4.  
  5. #if !defined(STRICT_OPENSTEP)
  6.  
  7. /***************        Compatibility with NEXTSTEP 3.0         ***********/
  8.  
  9. #import <objc/Object.h>
  10. #import <Foundation/NSCoder.h>
  11. #import <Foundation/NSData.h>
  12.  
  13. #if !defined(__TEFLON__)
  14. #import <remote/NXConnection.h>
  15. #endif
  16.  
  17. @interface Object (NSCompatibility)
  18.  
  19. - (BOOL)respondsToSelector:(SEL)sel;
  20. - (BOOL)conformsToProtocol:(Protocol *)protocol;
  21. - (BOOL)isKindOfClass:(Class)cls;
  22. - (BOOL)isMemberOfClass:(Class)cls;
  23. - (id)performSelector:(SEL)sel withObject:(id)object;
  24. - (id)performSelector:(SEL)sel withObject:(id)object1 withObject:(id)object2;
  25. - (NSString *)description;
  26. - (id)retain;
  27. - (unsigned)retainCount;
  28. - (void)release;
  29. - (id)autorelease;
  30. + (id)allocWithZone:(NSZone *)zone;
  31. - (id)copyWithZone:(NSZone *)zone;
  32. - (void)dealloc;
  33. + (void)poseAsClass:(Class)cls;
  34. + (BOOL)instancesRespondToSelector:(SEL)sel;
  35. - (IMP)methodForSelector:(SEL)sel;
  36. + (IMP)instanceMethodForSelector:(SEL)sel;
  37. - (void)doesNotRecognizeSelector:(SEL)sel;
  38. - (id)initWithCoder:(NSCoder *)coder;
  39. - (void)encodeWithCoder:(NSCoder *)coder;
  40. - (id)awakeAfterUsingCoder:(NSCoder *)coder;
  41.  
  42. @end
  43.  
  44. /********    Compatibility with NEXTSTEP 3.0 archiving    **********/
  45.  
  46. FOUNDATION_EXPORT void NXWriteNSObject(NXTypedStream *typedStream, NSObject *object);
  47.     /* Writes object onto the typedStream; no sharing is possible across separate NXWriteNSObject */
  48.     
  49. FOUNDATION_EXPORT NSObject *NXReadNSObject(NXTypedStream *typedStream);
  50.     /* Reads an object written with NXWriteNSObject; returned object is autoreleased */
  51.  
  52. FOUNDATION_EXPORT NSObject *NXReadNSObjectFromCoder(NSCoder *decoder);
  53.     /* Reads an object written with NXWriteNSObject given an NSCoder; returned object is autoreleased */
  54.  
  55. @interface NSCoder (NSTypedstreamCompatibility)
  56.  
  57. - (void)encodeNXObject:(Object *)object;
  58.     /* Writes old-style object onto the coder; no shraing is possible across separate -encodeNXObject */
  59.     
  60. - (Object *)decodeNXObject;
  61.     /* recovers object written with -encodeNXObject */
  62.     
  63. @end
  64.  
  65. /********    Compatibility with NEXTSTEP 3.0 streams    **********/
  66.  
  67. @interface NSData (NSDataCreationFromNXStream)
  68.  
  69. + (id)dataWithStream:(NXStream *)stream;
  70.     /* Reads bytes from stream till the end */
  71.  
  72. - (id)initWithStream:(NXStream *)stream;
  73.  
  74. @end
  75.  
  76. #if !defined(__TEFLON__)
  77. /******************* 3.0 DO compatibility **********************/
  78.  
  79. @interface NXAutoreleaseConnection : NXConnection
  80. @end
  81.  
  82. // Run old DO via the RunLoop - moral equivalent to runFromAppKit
  83.  
  84. @interface NXConnection (NSRunFromRunLoop)
  85. - (void)runFromRunLoop;
  86. @end
  87. #endif
  88.  
  89. #endif /* !STRICT_OPENSTEP */
  90.