home *** CD-ROM | disk | FTP | other *** search
- #ifndef __MiscIntList_h
- #define __MiscIntList_h
- //=============================================================================
- //
- // Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine.
- // Written by Paul S. McCarthy and Eric Sunshine.
- // All Rights Reserved.
- //
- // This notice may not be removed from this source code.
- //
- // This object is included in the MiscKit by permission from the authors
- // and its use is governed by the MiscKit license, found in the file
- // "License.rtf" in the MiscKit distribution. Please refer to that file
- // for a list of all applicable permissions and restrictions.
- //
- //=============================================================================
- //-----------------------------------------------------------------------------
- // <misckit/MiscIntList.h>
- //
- // An Objective-C "List" of integers. This object works like the
- // the "List" class, but this object allows elements to be zero (0).
- //
- //-----------------------------------------------------------------------------
- //-----------------------------------------------------------------------------
- // $Id: MiscIntList.h,v 1.3 95/10/03 04:57:48 sunshine Exp $
- // $Log: MiscIntList.h,v $
- // Revision 1.3 95/10/03 04:57:48 sunshine
- // Fixed -init so Storage is allocated from [self zone]. Added copyFromZone:,
- // initFromString:, and addIntList:.
- //
- // Revision 1.2 95/09/30 19:01:15 zarnuk
- // Added sting read/write methods. Added rawData method.
- //
- // Revision 1.1 95/09/27 12:21:21 zarnuk
- // Initial revision
- //-----------------------------------------------------------------------------
- #import <misckit/MiscTableTypes.h>
-
- MISC_TS_EXTERN_BEGIN( "Objective-C" )
- #import <objc/Object.h>
- MISC_TS_EXTERN_END
-
- @class Storage;
-
- typedef int (*MiscIntListCompareFunc)( void* userData, int x, int y );
-
- @interface MiscIntList : Object
- {
- Storage* array;
- }
- - init; // Designated initializer
- - initFromString: (char const*) s;
- - free;
- - copyFromZone: (NXZone*) zone;
- - empty;
- - (unsigned int) count;
- - (int) intAt: (unsigned int) pos;
- - (void) addInt: (int) value;
- - (void) addIntList: (MiscIntList*) list;
- - (void) insertInt: (int) value at: (unsigned int) pos;
- - (void) removeIntAt: (unsigned int) pos;
- - (void) replaceIntAt: (unsigned int) pos with: (int) value;
- - (void) sort;
- - (void) sortUsing: (MiscIntListCompareFunc) cmp_func data:(void*)data;
- - (char*) writeToString; // Automatically allocated, caller must free.
- - (char*) writeToString:(char*)buff size:(int)buff_size;
- - (char*) writeToString:(char*)buff size:(int)buff_size canExpand:(BOOL)flag;
- - (int) readFromString: (char const*) s;
- - (int const*) rawData;
- @end
-
- #endif // __MiscIntList_h
-