home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-05-30 | 3.3 KB | 126 lines | [TEXT/TBB6] |
- // istream standard header
- #ifndef _ISTREAM_
- #define _ISTREAM_
- #include <streambuf>
-
- #if __MWERKS__
- #pragma options align=mac68k
- #endif
-
- // class istream
- class istream : virtual public ios {
- public:
- istream(streambuf *_S)
- : _Chcount(0) { init(_S); }
- istream(_Uninitialized)
- : ios(_Noinit) {}
- virtual ~istream();
- _Bool ipfx(int = 0);
- void isfx()
- {}
- istream& operator>>(istream& (*_F)(istream&))
- {return ((*_F)(*this)); }
- istream& operator>>(ios& (*_F)(ios&))
- {(*_F)(*(ios *)this); return (*this); }
- istream& operator>>(char *);
- istream& operator>>(unsigned char *_S)
- {return (*this >> (char *)_S); }
- istream& operator>>(char&);
- istream& operator>>(unsigned char& _C)
- {return (*this >> *(char *)&_C); }
- istream& operator>>(short&);
- istream& operator>>(unsigned short&);
- istream& operator>>(int&);
- istream& operator>>(unsigned int&);
- istream& operator>>(long&);
- istream& operator>>(unsigned long&);
- istream& operator>>(float&);
- istream& operator>>(double&);
- istream& operator>>(long double&);
- istream& operator>>(void *&);
- istream& operator>>(streambuf&);
- int get();
- istream& get(char *, int, char = '\n');
- istream& get(unsigned char *_S, int _N, char _D = '\n')
- {return(get((char *)_S, _N, _D)); }
- istream& get(char&);
- istream& get(unsigned char& _C)
- {return (get((char&)_C)); }
- istream& get(streambuf&, char = '\n');
- istream& getline(char *, int, char = '\n');
- istream& getline(unsigned char *_S, int _N, char _D = '\n')
- {return(getline((char *)_S, _N, _D)); }
- istream& ignore(int = 1, int = EOF);
- istream& read(char *, int);
- istream& read(unsigned char *_S, int _N)
- {return(read((char *)_S, _N)); }
- int peek();
- istream& putback(char);
- istream& unget();
- int gcount() const
- {return (_Chcount); }
- int sync();
- streampos tellg(void)
- { streampos pos = rdbuf()->pubseekoff(0, ios::cur, ios::in);
- if( pos == streampos(EOF) )
- setstate(ios::badbit);
- return pos;
- }
- istream& seekg(streamoff off, ios::seekdir dir)
- {
- streampos pos = rdbuf()->pubseekoff(off,dir,ios::in);
- if (pos == streampos(EOF))
- setstate(ios::badbit);
- return *this;
- }
- istream& seekg(streampos pos)
- {
- pos = rdbuf()->pubseekpos(pos, ios::in);
- if (pos == streampos(EOF))
- setstate(ios::badbit);
- return *this;
- }
- #if _HAS_SIGNED_CHAR
- istream& operator>>(signed char *_S)
- {return (*this >> (char *)_S); }
- istream& operator>>(signed char& _C)
- {return (*this >> *(char *)&_C); }
- istream& get(signed char *_S, int _N, char _D = '\n')
- {return (get((char *)_S, _N, _D)); }
- istream& get(signed char& _C)
- {return (get((char&)_C)); }
- istream& getline(signed char *_S, int _N, char _D = '\n')
- {return (getline((char *)_S, _N, _D)); }
- istream& read(signed char *_S, int _N)
- {return (read((char *)_S, _N)); }
- #endif /* _HAS_SIGNED_CHAR */
- protected:
- int _Getffld(char [_MAX_EXP_DIG + _MAX_SIG_DIG + 16]);
- int _Getifld(char [_MAX_INT_DIG], _Bool = 0);
- private:
- int _Chcount;
- };
- // manipulators
- istream& ws(istream&);
-
- #if __MWERKS__
- #pragma options align=reset
- #endif
-
- #endif
-
- /*
- * Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
- * Consult your license regarding permissions and restrictions.
- */
-
- /* Change log:
- * 1994-06-04: PlumHall baseline
- * 1994-09-30: Applied diffs for Fri Aug 26 00:51:20 1994
- * 1994-10-07: Inserted MW changes.
- * 1994-10-14: XL04 change istream(streambuf *_S) to init derived
- */
-
- /* Change log:
- */
-