home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Palettes / MiscTableScroll / MiscTableScroll.subproj / MiscIntList.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-11  |  2.6 KB  |  73 lines

  1. #ifndef __MiscIntList_h
  2. #define __MiscIntList_h
  3. //=============================================================================
  4. //
  5. //        Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine.
  6. //                Written by Paul S. McCarthy and Eric Sunshine.
  7. //                            All Rights Reserved.
  8. //
  9. //        This notice may not be removed from this source code.
  10. //
  11. //        This object is included in the MiscKit by permission from the authors
  12. //        and its use is governed by the MiscKit license, found in the file
  13. //        "License.rtf" in the MiscKit distribution.    Please refer to that file
  14. //        for a list of all applicable permissions and restrictions.
  15. //        
  16. //=============================================================================
  17. //-----------------------------------------------------------------------------
  18. // <misckit/MiscIntList.h>
  19. //
  20. //        An Objective-C "List" of integers.    This object works like the
  21. //        the "List" class, but this object allows elements to be zero (0).
  22. //
  23. //-----------------------------------------------------------------------------
  24. //-----------------------------------------------------------------------------
  25. // $Id: MiscIntList.h,v 1.3 95/10/03 04:57:48 sunshine Exp $
  26. // $Log:        MiscIntList.h,v $
  27. //    Revision 1.3  95/10/03    04:57:48  sunshine
  28. //    Fixed -init so Storage is allocated from [self zone].  Added copyFromZone:,
  29. //    initFromString:, and addIntList:.
  30. //    
  31. //    Revision 1.2  95/09/30    19:01:15  zarnuk
  32. //    Added sting read/write methods.     Added rawData method.
  33. //    
  34. //    Revision 1.1  95/09/27    12:21:21  zarnuk
  35. //    Initial revision
  36. //-----------------------------------------------------------------------------
  37. #import <misckit/MiscTableTypes.h>
  38.  
  39. MISC_TS_EXTERN_BEGIN( "Objective-C" )
  40. #import <objc/Object.h>
  41. MISC_TS_EXTERN_END
  42.  
  43. @class Storage;
  44.  
  45. typedef int (*MiscIntListCompareFunc)( void* userData, int x, int y );
  46.  
  47. @interface MiscIntList : Object
  48.     {
  49.     Storage* array;
  50.     }
  51. - init;                                    // Designated initializer
  52. - initFromString: (char const*) s;
  53. - free;
  54. - copyFromZone: (NXZone*) zone;
  55. - empty;
  56. - (unsigned int) count;
  57. - (int) intAt: (unsigned int) pos;
  58. - (void) addInt: (int) value;
  59. - (void) addIntList: (MiscIntList*) list;
  60. - (void) insertInt: (int) value at: (unsigned int) pos;
  61. - (void) removeIntAt: (unsigned int) pos;
  62. - (void) replaceIntAt: (unsigned int) pos with: (int) value;
  63. - (void) sort;
  64. - (void) sortUsing: (MiscIntListCompareFunc) cmp_func data:(void*)data;
  65. - (char*) writeToString;        // Automatically allocated, caller must free.
  66. - (char*) writeToString:(char*)buff size:(int)buff_size;
  67. - (char*) writeToString:(char*)buff size:(int)buff_size canExpand:(BOOL)flag;
  68. - (int) readFromString: (char const*) s;
  69. - (int const*) rawData;
  70. @end
  71.  
  72. #endif // __MiscIntList_h
  73.