ftp.nice.ch/Attic/openStep/implementation/gnustep/sources/libFoundation.0.7.tgz#/libFoundation-0.7/libFoundation/Foundation/NSConcreteString.h

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

/* 
   NSConcreteString.h

   Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea.
   All rights reserved.

   Author: Mircea Oancea <mircea@jupiter.elcom.pub.ro>

   This file is part of libFoundation.

   Permission to use, copy, modify, and distribute this software and its
   documentation for any purpose and without fee is hereby granted, provided
   that the above copyright notice appear in all copies and that both that
   copyright notice and this permission notice appear in supporting
   documentation.

   We disclaim all warranties with regard to this software, including all
   implied warranties of merchantability and fitness, in no event shall
   we be liable for any special, indirect or consequential damages or any
   damages whatsoever resulting from loss of use, data or profits, whether in
   an action of contract, negligence or other tortious action, arising out of
   or in connection with the use or performance of this software.
*/

#ifndef  __NSConcreteString_h__
#define  __NSConcreteString_h__

/*
 * Classes used to allocate concrete instances upon initWith* methods
 */

/* Used for allocating immutable instances from NSString */

@interface NSTemporaryString : NSObject
{
    NSZone* _zone;
}

+ allocWithZone:(NSZone*)zone;
- (NSZone*)zone;

/* initWith* methods from NSString */

- init;
- initWithCharacters:(const unichar*)chars length:(unsigned int)length;
- initWithCharactersNoCopy:(unichar*)chars length:(unsigned int)length 
  freeWhenDone:(BOOL)flag;
- initWithCString:(const char*)byteString;
- initWithCString:(const char*)byteString length:(unsigned int)length;
- initWithCStringNoCopy:(char*)byteString freeWhenDone:(BOOL)flag;
- initWithCStringNoCopy:(char*)byteString length:(unsigned int)length 
  freeWhenDone:(BOOL)flag;
- initWithString:(NSString*)aString;
- initWithFormat:(NSString*)format, ...;
- initWithFormat:(NSString*)format arguments:(va_list)argList;
- initWithFormat:(NSString*)format
  locale:(NSDictionary*)dictionary, ...;
- initWithFormat:(NSString*)format 
  locale:(NSDictionary*)dictionary arguments:(va_list)argList;	
- initWithData:(NSData*)data encoding:(NSStringEncoding)encoding;
- initWithContentsOfFile:(NSString*)path;

@end

/* Used for allocating mutable instances from NSMutableString */

@interface NSMutableTemporaryString : NSTemporaryString
- initWithCapacity:(unsigned int)capacity;
@end

/*
 * Classes for 8Bit strings
 */

/* Abstract immutable class */
@interface NS8BitString : NSString
- (void)getCharacters:(unichar*)buffer range:(NSRange)aRange;
- (NSString*)substringWithRange:(NSRange)aRange;
- (NSRange)rangeOfCharacterFromSet:(NSCharacterSet*)aSet
  options:(unsigned int)mask range:(NSRange)aRange;
- (NSRange)rangeOfString:(NSString*)aString
  options:(unsigned int)mask range:(NSRange)aRange;
- (NSComparisonResult)compare:(NSString*)aString
  options:(unsigned int)mask range:(NSRange)aRange;
- (unsigned int)hash;
- (NSString*)commonPrefixWithString:(NSString*)aString
  options:(unsigned int)mask;
- (NSString*)capitalizedString;
- (NSString*)lowercaseString;
- (NSString*)uppercaseString;
- (void)getCString:(char*)buffer maxLength:(unsigned int)maxLength
  range:(NSRange)aRange remainingRange:(NSRange*)leftoverRange;
- (BOOL)writeToFile:(NSString*)path atomically:(BOOL)flag;
- (NSString*)stringRepresentation;
@end

@interface NS8BitString(NS8BitString)
- initWithCString:(char*)byteString 
  length:(unsigned int)length copy:(BOOL)flag;
- (const char*)cString;
- (unsigned int)cStringLength;
- (char*)__compact8BitBytes;
@end

/* Abstact mutable class */
@interface NSMutable8BitString : NSMutableString
@end

@interface NSMutable8BitString(NS8BitString)
- initWithCString:(char*)byteString 
  length:(unsigned int)length copy:(BOOL)flag;
- initWithCapacity:(unsigned int)capacity;
- (char*)__compact8BitBytes;
@end

/* Immutable. Holds its characters in the instance, zero terminated */
@interface NSInline8BitString : NS8BitString
{
    int cLength;
    char cString[1];
}
+ allocForCapacity:(unsigned int)length zone:(NSZone*)zone;
@end

/* Immutable. Holds non owned pointer characters, zero terminated */
@interface NSNonOwned8BitString : NS8BitString
{
    char* cString;
    unsigned int cLength;
}
@end

/* Immutable. Holds owned pointer characters, zero terminated */
@interface NSOwned8BitString : NSNonOwned8BitString
@end

/* Immutable. Constant (compiler generated), zero terminated */
@interface NXConstantString : NSNonOwned8BitString
@end

/* Immutable. Holds non owned pointer characters, not zero terminated */
@interface NSNonOwnedOpen8BitString : NSNonOwned8BitString
@end

/* Immutable. Holds owned pointer characters, not zero terminated */
@interface NSOwnedOpen8BitString : NSOwned8BitString
@end

/* Immutable. Used for substring from a constant string */
@interface NSRange8BitString : NSNonOwnedOpen8BitString
{
    NS8BitString* parent;
}
- initWithString:(NSString*)aParent 
  bytes:(char*)bytes length:(unsigned int)length;
@end

/* Mutable 8 bit string, not zero terminated */
@interface NSMutableSimple8BitString : NSMutable8BitString
{
    char* cString;
    unsigned int cLength;
    unsigned int cCapacity;
}
@end

#endif /* __NSConcreteString_h__ */

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