home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tv20cpp.zip / src / TStringCollection.cpp < prev    next >
C/C++ Source or Header  |  1998-01-19  |  893b  |  48 lines

  1. /*
  2.  * TStringCollection.cc
  3.  *
  4.  * Turbo Vision - Version 2.0
  5.  *
  6.  * Copyright (c) 1994 by Borland International
  7.  * All Rights Reserved.
  8.  *
  9.  * Modified by Sergio Sigala <ssigala@globalnet.it>
  10.  */
  11.  
  12. #define Uses_TStringCollection
  13. #define Uses_opstream
  14. #define Uses_ipstream
  15. #include <tvision/tv.h>
  16.  
  17. #include <string.h>
  18.  
  19. TStringCollection::TStringCollection( short aLimit, short aDelta ) :
  20.     TSortedCollection(aLimit, aDelta)
  21. {
  22. }
  23.  
  24. int TStringCollection::compare( void *key1, void *key2 )
  25. {
  26.     return strcmp( (char *)key1, (char *)key2 );
  27. }
  28.  
  29. void TStringCollection::freeItem( void* item )
  30. {
  31.     delete item;
  32. }
  33.  
  34. TStreamable *TStringCollection::build()
  35. {
  36.     return new TStringCollection( streamableInit );
  37. }
  38.  
  39. void TStringCollection::writeItem( void *obj, opstream& os )
  40. {
  41.     os.writeString( (const char *)obj );
  42. }
  43.  
  44. void *TStringCollection::readItem( ipstream& is )
  45. {
  46.     return is.readString();
  47. }
  48.