home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 9.ddi / TVSRC.ZIP / TSTRCOLL.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.7 KB  |  56 lines

  1. /*------------------------------------------------------------*/
  2. /* filename -       tstrcoll.cpp                              */
  3. /*                                                            */
  4. /* function(s)                                                */
  5. /*                  TStringCollection member functions        */
  6. /*------------------------------------------------------------*/
  7.  
  8. /*------------------------------------------------------------*/
  9. /*                                                            */
  10. /*    Turbo Vision -  Version 1.0                             */
  11. /*                                                            */
  12. /*                                                            */
  13. /*    Copyright (c) 1991 by Borland International             */
  14. /*    All Rights Reserved.                                    */
  15. /*                                                            */
  16. /*------------------------------------------------------------*/
  17.  
  18. #define Uses_TStringCollection
  19. #define Uses_opstream
  20. #define Uses_ipstream
  21. #include <tv.h>
  22.  
  23. #if !defined( __STRING_H )
  24. #include <String.h>
  25. #endif  // __STRING_H
  26.  
  27. TStringCollection::TStringCollection( short aLimit, short aDelta ) :
  28.     TSortedCollection(aLimit, aDelta)
  29. {
  30. }
  31.  
  32. int TStringCollection::compare( void *key1, void *key2 )
  33. {
  34.     return strcmp( (char *)key1, (char *)key2 );
  35. }
  36.  
  37. void TStringCollection::freeItem( void* item )
  38. {
  39.     delete item;
  40. }
  41.  
  42. TStreamable *TStringCollection::build()
  43. {
  44.     return new TStringCollection( streamableInit );
  45. }
  46.  
  47. void TStringCollection::writeItem( void *obj, opstream& os )
  48. {
  49.     os.writeString( (const char *)obj );
  50. }
  51.  
  52. void *TStringCollection::readItem( ipstream& is )
  53. {
  54.     return is.readString();
  55. }
  56.