home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC7.DMS / in.adf / classes.lha / Classes / DataStructures / String.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-31  |  1.4 KB  |  59 lines

  1. #ifndef CPP_DATASTRUCTURES_STRING_H
  2. #define CPP_DATASTRUCTURES_STRING_H
  3.  
  4. // Eine Stringklasse, die Lokalisation erlaubt.
  5. //
  6. // Autor: Jochen Becher
  7. //
  8. // Historie:
  9. // Version 1.0 am 3. August 94
  10.  
  11. #ifndef CPP_EXCEPTIONS_EXPCETIONS_H
  12. #include <Classes/Exceptions/Exceptions.h>
  13. #endif
  14.  
  15. #ifndef CPP_DATASTRUCTURES_BUFFER_H
  16. #include <Classes/DataStructures/Buffer.h>
  17. #endif
  18.  
  19. class StringC {
  20. public:
  21.     StringC(const STRPTR = NULL);
  22.     StringC(ULONG l, STRPTR s);
  23.     StringC(const StringC &);
  24.     StringC(UBYTE);
  25.     ~StringC();
  26.     operator STRPTR() const;
  27.     StringC &operator= (const StringC &);
  28.     StringC &operator= (const STRPTR);
  29.     StringC &operator+= (const StringC &);
  30.     StringC &operator+= (const STRPTR);
  31.     UBYTE &operator[] (ULONG i);
  32.     ULONG length() const;
  33.     ULONG bufsize() const;
  34.     StringC left(ULONG i) const;
  35.     StringC right(ULONG i) const;
  36.     StringC mid(ULONG i, ULONG j) const;
  37.     VOID doubleBuffer();
  38.     VOID shrinkBuffer();
  39.     VOID setBufferSize(ULONG i);
  40. protected:
  41.     ULONG len;
  42.     BufferC buffer;
  43. };
  44.  
  45. StringC operator+ (const StringC &, const StringC &);
  46.  
  47. BOOL operator== (const StringC &, const StringC &);
  48. BOOL operator!= (const StringC &, const StringC &);
  49. BOOL operator< (const StringC &, const StringC &);
  50. BOOL operator> (const StringC &, const StringC &);
  51. BOOL operator<= (const StringC &, const StringC &);
  52. BOOL operator>= (const StringC &, const StringC &);
  53.  
  54. class ostream &operator<< (ostream &, const StringC &);
  55.  
  56. class istream &operator>> (istream &, StringC &);
  57.  
  58. #endif
  59.