home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / STORM2.DMS / in.adf / Includes.LHA / stream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-28  |  2.7 KB  |  119 lines

  1. #ifndef __cplusplus
  2. #error <stream.h> must be compiled in C++ mode.
  3. #pragma +
  4. #endif
  5.  
  6. #ifndef _INCLUDE_STREAM_H
  7. #define _INCLUDE_STREAM_H
  8.  
  9. /*
  10. **  $VER: stream.h 10.1 (19.7.95)
  11. **  Includes Release 40.15
  12. **
  13. **  (C) Copyright 1995 Haage & Partner
  14. **     All Rights Reserved
  15. */
  16.  
  17. #ifndef EOF
  18. #define EOF (-1)
  19. #endif
  20.  
  21. struct stream;
  22.  
  23. typedef stream FILE;
  24.  
  25. class form
  26. {  struct tmpstr
  27.    { tmpstr *link;
  28.      char *dynamicstr;
  29.    } *string;
  30.   public:
  31.    form(const char*, ...);
  32.    ~form();
  33. };
  34.  
  35. class ios
  36. { protected:
  37.     FILE *file;
  38.     unsigned char basefield;
  39.     unsigned char GUESS, WHAT, FOR;
  40.   public:
  41.     ios(FILE *f=0);
  42.     FILE *getstream();
  43.     operator void*();
  44.  
  45.     enum open_mode { in=1, out=2, app=4 };
  46.     enum seek_dir { beg=-1, cur=0, end=1 };
  47. };
  48.  
  49. ios &flush(ios&);
  50. ios &endl(ios&);
  51. ios &dec(ios&);
  52. ios &hex(ios&);
  53. ios &oct(ios&);
  54.  
  55. class ostream: public virtual ios
  56. { protected:
  57.     unsigned char Reserved;
  58.   public:
  59.     ostream(FILE *f=0);
  60.     ostream &operator << (int);
  61.     ostream &operator << (unsigned);
  62.     ostream &operator << (long);
  63.     ostream &operator << (unsigned long);
  64.     ostream &operator << (long long);
  65.     ostream &operator << (unsigned long long);
  66.     ostream &operator << (char);
  67.     ostream &operator << (unsigned char);
  68.     ostream &operator << (signed char);
  69.     ostream &operator << (const char *);
  70.     ostream &operator << (float);
  71.     ostream &operator << (double);
  72.     ostream &operator << (long double);
  73.     ostream &operator << (form &);
  74.     ostream &operator << (const void*);
  75.     ostream &operator << (ios&(*f)(ios&));
  76.     ostream &put(char);
  77.     ostream &write(const char*, int);
  78. };
  79.  
  80. class istream : public virtual ios
  81. { protected:
  82.     unsigned char errorflag;
  83.   public:
  84.     istream(FILE *f=0);
  85.     istream &operator >> (char *);
  86.     istream &operator >> (unsigned char *);
  87.     istream &operator >> (char&);
  88.     istream &operator >> (unsigned char&);
  89.     istream &operator >> (signed char&);
  90.     istream &operator >> (short&);
  91.     istream &operator >> (unsigned short&);
  92.     istream &operator >> (int&);
  93.     istream &operator >> (unsigned &);
  94.     istream &operator >> (long&);
  95.     istream &operator >> (unsigned long&);
  96.     istream &operator >> (long long&);
  97.     istream &operator >> (unsigned long long&);
  98.     istream &operator >> (float&);
  99.     istream &operator >> (double&);
  100.     istream &operator >> (long double&);
  101.     istream &read(char *,int);
  102.     istream &get(char &);
  103.     istream &get(unsigned char &);
  104.     int      get();
  105.     istream &getline(char *buf, int len, char Delim = '\n');
  106.     istream &putback(char);
  107.     int eof();
  108.     operator void*();
  109. };
  110.  
  111. #define STREAM_MAXSTRING 80     // maximal von ">>" in String gelesene Zeichen
  112.  
  113. extern ostream cout, cerr, clog;
  114. extern istream cin;
  115. void exit(int);
  116.  
  117. #endif
  118.  
  119.