home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP30-1.ZIP / CLASSINC.ZIP / STRNG.H < prev    next >
C/C++ Source or Header  |  1992-02-18  |  2KB  |  77 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  STRNG.H                                                               */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991                                  */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( _STRNG_H )
  11. #define _STRNG_H
  12.  
  13. #if !defined( __CLSTYPES_H )
  14. #include <ClsTypes.h>
  15. #endif  // __CLSTYPES_H
  16.  
  17. #if !defined( __SORTABLE_H )
  18. #include <Sortable.h>
  19. #endif  // __SORTABLE_H
  20.  
  21. #if !defined( __STRING_H )
  22. #include <string.h>
  23. #endif  // __STRING_H
  24.  
  25. #if !defined( __CHECKS_H )
  26. #include <Checks.h>
  27. #endif  // __CHECKS_H
  28.  
  29. _CLASSDEF(ostream)
  30. _CLASSDEF(String)
  31.  
  32. class _CLASSTYPE String : public Sortable
  33. {
  34.  
  35. public:
  36.  
  37.     String( const char _FAR * = "" );
  38.     String( const String _FAR & );
  39.     virtual ~String()
  40.         {
  41.         delete theString;
  42.         }
  43.  
  44.  
  45.     String& operator = ( const String _FAR & );
  46.     operator const char _FAR *() const;
  47.  
  48.     virtual int isEqual( const Object _FAR & ) const;
  49.     virtual int isLessThan( const Object _FAR & ) const;\
  50.  
  51.     virtual classType isA() const
  52.         {
  53.         return stringClass;
  54.         }
  55.  
  56.     virtual char _FAR *nameOf() const
  57.         {
  58.         return "String";
  59.         }
  60.  
  61.     virtual hashValueType hashValue() const;
  62.     virtual void printOn( ostream _FAR & ) const;
  63.  
  64. private:
  65.  
  66.     sizeType len;
  67.     char _FAR *theString;
  68.  
  69. };
  70.  
  71. inline String::operator const char _FAR *() const
  72. {
  73.     return theString;
  74. }
  75.  
  76. #endif
  77.