home *** CD-ROM | disk | FTP | other *** search
- #ifndef __RWRSTREAM_H__
- #define __RWRSTREAM_H__
- pragma push_align_members(64);
-
- /*
- * Includes either stream.h or iostream.h, depending
- * on the compiler.
- *
- * $Header: E:/vcs/rw/rstream.h_v 1.8 04 Mar 1992 10:20:22 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/rstream.h_v $
- *
- * Rev 1.8 04 Mar 1992 10:20:22 KEFFER
- * Includes "rw/defs.h" instead of "rw/compiler.h"
- *
- * Rev 1.7 18 Feb 1992 09:54:36 KEFFER
- *
- * Rev 1.6 27 Oct 1991 17:39:06 keffer
- * Corrected Glock inclusion of iostream.hxx
- *
- * Rev 1.5 17 Oct 1991 09:12:56 keffer
- * Changed include path to <rw/xxx.h>
- *
- * Rev 1.3 24 Sep 1991 11:08:10 keffer
- * Zortech now includes iostream.hpp; Glock iostream.hxx.
- *
- * Rev 1.2 08 Sep 1991 19:10:08 keffer
- * Changed name of eatwhite() to rwEatwhite()
- *
- * Rev 1.1 24 Jul 1991 13:06:46 keffer
- * Added pvcs keywords
- *
- */
-
- #include "rw/defs.h"
-
- #ifdef HAS_IOSTREAMS
- # ifdef __ZTC__
- # include <iostream.hpp>
- # else
- # ifdef __GLOCK__
- # include <iostream.hxx>
- # else
- # include <iostream.h>
- # endif
- # endif
- #else
- # ifdef __ZTC__
- # include <stream.hpp>
- # include <generic.hpp>
- # else
- # include <stream.h>
- # include <generic.h>
- # endif
- #endif
-
- /*
- * The macros OPENISTREAM and OPENOSTREAM are useful for opening a stream
- * with either V1.2 or V2.X style streams.
- *
- * The function rwEatwhite(istream&) will eat whitespace for either V1.2 or
- * V2.X style streams.
- */
-
- #ifdef HAS_IOSTREAMS
-
- # define OPENOSTREAM(filename, streamname) ofstream streamname(filename);
- # define OPENISTREAM(filename, streamname) ifstream streamname(filename);
- inline istream& rwEatwhite(istream& s) {return s >> ws;}
-
- #else /* Does not have iostreams */
-
- # define OPENOSTREAM(filename, streamname) \
- filebuf name2(fbuf,streamname); \
- name2(fbuf,streamname).open(filename,output);\
- ostream streamname(&name2(fbuf,streamname));
- # define OPENISTREAM(filename, streamname) \
- filebuf name2(fbuf,streamname); \
- name2(fbuf,streamname).open(filename,input); \
- istream streamname(&name2(fbuf,streamname));
- inline istream& rwEatwhite(istream& s) {whitespace dumb; return s >> dumb;}
-
- #endif /* HAS_IOSTREAMS */
-
- pragma pop_align_members();
- #endif /* __RWRSTREAM_H__ */
-