home *** CD-ROM | disk | FTP | other *** search
- #ifndef __RWPSTREAM_H__
- #define __RWPSTREAM_H__
- pragma push_align_members(64);
-
- /*
- * rwp[io]stream --- Portable I/O streams (use escape sequences for
- * writing special characters.
- *
- * $Header: E:/vcs/rw/pstream.h_v 1.8 17 Mar 1992 12:26:48 KEFFER $
- *
- ****************************************************************************
- *
- * Rogue Wave Software, Inc.
- * 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/pstream.h_v $
- *
- * Rev 1.8 17 Mar 1992 12:26:48 KEFFER
- * Removed RWTV3_COMPATIBLE macro hooks.
- *
- * Rev 1.7 18 Feb 1992 09:54:32 KEFFER
- *
- * Rev 1.6 13 Nov 1991 11:09:16 keffer
- * Removed "near" qualifiers. Both putwrap()'s are now out of line.
- *
- * Rev 1.5 05 Nov 1991 13:52:50 keffer
- * Can now live in the DLL
- *
- * Rev 1.4 17 Oct 1991 09:12:46 keffer
- * Changed include path to <rw/xxx.h>
- *
- * Rev 1.2 29 Jul 1991 11:33:32 keffer
- * Macro CHAR_MATCHES_UCHAR checks for overloaded unsigned char
- *
- */
-
- #include "rw/vstream.h"
-
- /************************************************
- * *
- * class RWpistream *
- * *
- ************************************************/
-
- class RWExport RWpistream :
-
- #ifdef HAS_IOSTREAMS
- public istream, public RWvistream {
- #else
- public RWvistream {
- #endif
-
- public:
- RWpistream(istream& str);
- RWpistream(streambuf* s);
-
- virtual int get();
- virtual RWvistream& get(char&);
- #ifndef CHAR_MATCHES_UCHAR
- virtual RWvistream& get(unsigned char&);
- #endif
- virtual RWvistream& get(char*, unsigned N);
- virtual RWvistream& get(double*, unsigned N);
- virtual RWvistream& get(float*, unsigned N);
- virtual RWvistream& get(int*, unsigned N);
- virtual RWvistream& get(long*, unsigned N);
- virtual RWvistream& get(short*, unsigned N);
- #ifndef CHAR_MATCHES_UCHAR
- virtual RWvistream& get(unsigned char*, unsigned N);
- #endif
- virtual RWvistream& get(unsigned short*, unsigned N);
- virtual RWvistream& get(unsigned int*, unsigned N);
- virtual RWvistream& get(unsigned long*, unsigned N);
- virtual RWvistream& getString(char* s, unsigned maxlen);
- virtual RWvistream& operator>>(char&);
- virtual RWvistream& operator>>(double&);
- virtual RWvistream& operator>>(float&);
- virtual RWvistream& operator>>(int&);
- virtual RWvistream& operator>>(long&);
- virtual RWvistream& operator>>(short&);
- #ifndef CHAR_MATCHES_UCHAR
- virtual RWvistream& operator>>(unsigned char&);
- #endif
- virtual RWvistream& operator>>(unsigned int&);
- virtual RWvistream& operator>>(unsigned long&);
- virtual RWvistream& operator>>(unsigned short&);
- protected:
- void checkRead();
- void overflowErr(unsigned, const char*);
- void syntaxErr(const char* expect, char was);
- char getCChar();
- };
-
- /************************************************
- * *
- * class RWpostream *
- * *
- ************************************************/
-
- class RWExport RWpostream :
-
- #ifdef HAS_IOSTREAMS
- public ostream , public RWvostream {
- #else
- public RWvostream {
- #endif
-
- public:
- RWpostream(ostream& str);
- RWpostream(streambuf* s);
-
- virtual RWvostream& operator<<(const char*);
- virtual RWvostream& operator<<(char);
- #ifndef CHAR_MATCHES_UCHAR
- virtual RWvostream& operator<<(unsigned char);
- #endif
- virtual RWvostream& operator<<(double);
- virtual RWvostream& operator<<(float);
- virtual RWvostream& operator<<(int);
- virtual RWvostream& operator<<(unsigned int);
- virtual RWvostream& operator<<(long);
- virtual RWvostream& operator<<(unsigned long);
- virtual RWvostream& operator<<(short);
- virtual RWvostream& operator<<(unsigned short);
-
- virtual RWvostream& put(char);
- virtual RWvostream& put(const char* p, unsigned N);
- #ifndef CHAR_MATCHES_UCHAR
- virtual RWvostream& put(unsigned char);
- virtual RWvostream& put(const unsigned char* p, unsigned N);
- #endif
- virtual RWvostream& put(const short* p, unsigned N);
- virtual RWvostream& put(const unsigned short* p, unsigned N);
- virtual RWvostream& put(const int* p, unsigned N);
- virtual RWvostream& put(const unsigned int* p, unsigned N);
- virtual RWvostream& put(const long* p, unsigned N);
- virtual RWvostream& put(const unsigned long* p, unsigned N);
- virtual RWvostream& put(const float* p, unsigned N);
- virtual RWvostream& put(const double* p, unsigned N);
- protected:
- unsigned column;
- static const unsigned MAXCOL;
- void putwrap(char);
- #ifndef CHAR_MATCHES_UCHAR
- void putwrap(unsigned char c);
- #endif
- void putwrap(const char* s, unsigned len);
- void putCChars(const char* s);
- };
-
- pragma pop_align_members();
- #endif /* __RWPSTREAM_H__ */
-