home *** CD-ROM | disk | FTP | other *** search
- #ifndef __RWVSTREAM_H__
- #define __RWVSTREAM_H__
- pragma push_align_members(64);
-
- /*
- * rw[io]stream --- abstract base class for I/O
- *
- * $Header: E:/vcs/rw/vstream.h_v 1.6 18 Feb 1992 09:54:52 KEFFER $
- *
- ****************************************************************************
- *
- * Rogue Wave
- * P.O. Box 2328
- * Corvallis, OR 97339
- * Voice: (503) 754-3010 FAX: (503) 757-6650
- *
- * Copyright (C) 1989, 1990, 1991. This software is subject to copyright
- * protection under the laws of the United States and other countries.
- *
- ***************************************************************************
- *
- * $Log: E:/vcs/rw/vstream.h_v $
- *
- * Rev 1.6 18 Feb 1992 09:54:52 KEFFER
- *
- * Rev 1.5 05 Nov 1991 13:52:52 keffer
- * Can now live in the DLL
- *
- * Rev 1.4 17 Oct 1991 09:12:58 keffer
- * Changed include path to <rw/xxx.h>
- *
- * Rev 1.2 29 Jul 1991 11:33:30 keffer
- * Macro CHAR_MATCHES_UCHAR checks for overloaded unsigned char
- *
- * Rev 1.1 24 Jul 1991 13:06:50 keffer
- * Added pvcs keywords
- *
- */
-
- /*
- * The Rogue Wave "virtual streams" facility has been designed to
- * accomodate both V1.2 style "streams" and V2.X style "iostreams".
- * This was necessary because certain compiler manufacturers (whose
- * names will go unmentioned) have stuck with V1.2 streams.
- *
- * This has greatly complicated the design, resulting in different
- * inheritance hierarchies for the two situations.
- */
-
- #include "rw/rstream.h"
-
- /************************************************
- * *
- * class RWvistream *
- * *
- ************************************************/
-
- class RWExport RWvistream :
- #ifdef HAS_IOSTREAMS
- /* Has V2.x style iostreams; use ios as a virtual base class */
- public virtual ios {
- public:
- RWvistream(streambuf* s) : ios(s) { }
-
- #else
- /* Has V1.2 style streams; use istream as a regular base class. */
- public istream {
- public:
- RWvistream(istream& str) : istream(str) { }
- RWvistream(streambuf* s) : istream(s) { }
-
- #endif
-
- virtual int get() = 0; // Treat as number; EOF on end-of-file
- virtual RWvistream& get(char&) = 0; // Treat as number
- #ifndef CHAR_MATCHES_UCHAR
- virtual RWvistream& get(unsigned char&) = 0; // Treat as number
- #endif
- virtual RWvistream& get(char*, unsigned N) = 0;
- virtual RWvistream& get(double*, unsigned N) = 0;
- virtual RWvistream& get(float*, unsigned N) = 0;
- virtual RWvistream& get(int*, unsigned N) = 0;
- virtual RWvistream& get(long*, unsigned N) = 0;
- virtual RWvistream& get(short*, unsigned N) = 0;
- #ifndef CHAR_MATCHES_UCHAR
- virtual RWvistream& get(unsigned char*, unsigned N) = 0;
- #endif
- virtual RWvistream& get(unsigned short*, unsigned N) = 0;
- virtual RWvistream& get(unsigned int*, unsigned N) = 0;
- virtual RWvistream& get(unsigned long*, unsigned N) = 0;
- virtual RWvistream& getString(char* s, unsigned N) = 0; // Treat as character string
- virtual RWvistream& operator>>(char&) = 0; // Treat as character
- virtual RWvistream& operator>>(double&) = 0;
- virtual RWvistream& operator>>(float&) = 0;
- virtual RWvistream& operator>>(int&) = 0;
- virtual RWvistream& operator>>(long&) = 0;
- virtual RWvistream& operator>>(short&) = 0;
- #ifndef CHAR_MATCHES_UCHAR
- virtual RWvistream& operator>>(unsigned char&) = 0;
- #endif
- virtual RWvistream& operator>>(unsigned short&) = 0;
- virtual RWvistream& operator>>(unsigned int&) = 0;
- virtual RWvistream& operator>>(unsigned long&) = 0;
- };
-
- /************************************************
- * *
- * class RWvostream *
- * *
- ************************************************/
-
- class RWExport RWvostream :
-
- #ifdef HAS_IOSTREAMS
-
- public virtual ios {
- public:
- RWvostream(streambuf* s) : ios(s) { }
-
- #else
-
- public ostream {
- public:
- RWvostream(ostream& str) : ostream(str) { }
- RWvostream(streambuf* s) : ostream(s) { }
-
- #endif
-
- virtual RWvostream& operator<<(const char*) = 0; // Treat as character string
- virtual RWvostream& operator<<(char) = 0; // Treat as character
- #ifndef CHAR_MATCHES_UCHAR
- virtual RWvostream& operator<<(unsigned char) = 0;
- #endif
- virtual RWvostream& operator<<(double) = 0;
- virtual RWvostream& operator<<(float) = 0;
- virtual RWvostream& operator<<(int) = 0;
- virtual RWvostream& operator<<(unsigned int) = 0;
- virtual RWvostream& operator<<(long) = 0;
- virtual RWvostream& operator<<(unsigned long) = 0;
- virtual RWvostream& operator<<(short) = 0;
- virtual RWvostream& operator<<(unsigned short) = 0;
-
- virtual RWvostream& put(char) = 0; // Treat as number
- virtual RWvostream& put(const char* p, unsigned N) = 0; // Treat as vector of numbers
- #ifndef CHAR_MATCHES_UCHAR
- virtual RWvostream& put(unsigned char) = 0;
- virtual RWvostream& put(const unsigned char* p, unsigned N) = 0;
- #endif
- virtual RWvostream& put(const short* p, unsigned N) = 0;
- virtual RWvostream& put(const unsigned short* p, unsigned N) = 0;
- virtual RWvostream& put(const int* p, unsigned N) = 0;
- virtual RWvostream& put(const unsigned int* p, unsigned N) = 0;
- virtual RWvostream& put(const long* p, unsigned N) = 0;
- virtual RWvostream& put(const unsigned long* p, unsigned N) = 0;
- virtual RWvostream& put(const float* p, unsigned N) = 0;
- virtual RWvostream& put(const double* p, unsigned N) = 0;
- };
-
- pragma pop_align_members();
- #endif /* __RWVSTREAM_H__ */
-