Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C++ Class Library Definition - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

class ostream : virtual public ios {
public:
        // constructors and destructor
                _Cdecl ostream(streambuf*);
virtual _Cdecl ~ostream();
        // Obsolete constructors, for streams 1.2 compatibility
                _Cdecl ostream(int _fd); // obsolete, use fstream
                _Cdecl ostream(int _sz, char*); // obsolete, use strstream

        int _Cdecl opfx();      // output prefix function
        void _Cdecl osfx();     // output suffix function
    ostream& _Cdecl flush();

        // set/read the put pointer's position
    ostream& _Cdecl seekp(streampos);
    ostream& _Cdecl seekp(streamoff, seek_dir);
    streampos _Cdecl tellp();

        /*
         * Unformatted insertion operations
         */
        ostream& _Cdecl put(char);  // insert the character
        ostream& _Cdecl write(const   signed char*, int); // insert the string
        ostream& _Cdecl write(const unsigned char*, int); // insert the string

        /*
         * Formatted insertion operations
         */
        // insert the character
    ostream& _Cdecl operator<< (  signed char);
    ostream& _Cdecl operator<< (unsigned char);

        // for the following, insert character representation of numeric value
    ostream& _Cdecl operator<< (short);
    ostream& _Cdecl operator<< (unsigned short);
    ostream& _Cdecl operator<< (int);
    ostream& _Cdecl operator<< (unsigned int);
    ostream& _Cdecl operator<< (long);
    ostream& _Cdecl operator<< (unsigned long);
    ostream& _Cdecl operator<< (float);
    ostream& _Cdecl operator<< (double);
    ostream& _Cdecl operator<< (long double);

        // insert the null-terminated string
    ostream& _Cdecl operator<< (const   signed char*);
    ostream& _Cdecl operator<< (const unsigned char*);

        // insert character representation of the value of the pointer
    ostream& _Cdecl operator<< (void*);

        // extract from streambuf, insert into this ostream
    ostream& _Cdecl operator<< (streambuf*);

        // manipulators
    ostream& _Cdecl operator<< (ostream& (*_f)(ostream&));
    ostream& _Cdecl operator<< (ios& (*_f)(ios&));

protected:
        int     _Cdecl do_opfx();   // implementation of opfx
        void    _Cdecl do_osfx();   // implementation of osfx
            _Cdecl ostream();



private:
    void    _Cdecl outstr(const signed char*, const signed char*);
};
inline int  _Cdecl ostream::opfx() { return ospecial ? do_opfx() : 1; }
inline void _Cdecl ostream::osfx()
                        { if( x_flags & (stdio | unitbuf) ) do_osfx(); }
#ifdef _BIG_INLINE_
inline ostream& _Cdecl ostream::operator<< (signed char _c) {
                if( opfx() )
                    if( bp->sputc(_c) == EOF ) setstate(badbit);
                        osfx();
                return *this;
                }
#endif
inline ostream& _Cdecl ostream::operator<< (unsigned char _c) {
                return *this << (signed char)_c;
                }
inline ostream& _Cdecl ostream::operator<< (const signed char* _s) {
                outstr(_s, (const signed char*)0);
                return *this;
                }
inline ostream& _Cdecl ostream::operator<< (const unsigned char* _s) {
                outstr((const signed char*)_s, (const signed char*)0);
                return *this;
                }
inline ostream& _Cdecl ostream::operator<< (short _i) {
                return *this << (long) _i;
                }
inline ostream& _Cdecl ostream::operator<< (unsigned short _i) {
                return *this << (unsigned long) _i;
                }
inline ostream& _Cdecl ostream::operator<< (int _i) {
                return *this << (long) _i;
                 }
inline ostream& _Cdecl ostream::operator<< (unsigned int _i) {
                return *this << (unsigned long) _i;
                }
inline ostream& _Cdecl ostream::operator<< (float _f) {
                return *this << (long double) _f;
                }
inline ostream& _Cdecl ostream::operator<< (double _d) {
                return *this << (long double) _d;
                }
inline ostream& _Cdecl ostream::operator<< (ostream& (*_f)(ostream&)) {
                return (*_f)(*this);
                }
inline ostream& _Cdecl ostream::write(const unsigned char* _s, int _n) {
                return write((const signed char*)_s, _n);
                }
inline ostream& _Cdecl ostream::put(char _c) {
                if( bp->sputc(_c) == EOF ) setstate(badbit);
                return *this;
                }
#ifdef _BIG_INLINE_
inline ostream& _Cdecl ostream::write(const signed char* _s, int _n) {
                if( ! fail() )
                    if( bp->sputn((const char*)_s, _n) != _n )
                        setstate(badbit);
                return *this;
                }
#endif











class iostream : public istream, public ostream {
public:
        _Cdecl iostream(streambuf*);
virtual _Cdecl ~iostream();

protected:
        _Cdecl iostream();
};


class istream_withassign : public istream {
public:
                // does no initialization
        _Cdecl istream_withassign();

virtual _Cdecl ~istream_withassign();

        // gets buffer from istream and does entire initialization
    istream_withassign& _Cdecl operator= (istream&);

        // associates streambuf with stream and does entire initialization
    istream_withassign& _Cdecl operator= (streambuf*);
};


class ostream_withassign : public ostream {
public:
                // does no initialization
        _Cdecl ostream_withassign();

virtual _Cdecl ~ostream_withassign();

        // gets buffer from istream and does entire initialization
    ostream_withassign& _Cdecl operator= (ostream&);

        // associates streambuf with stream and does entire initialization
    ostream_withassign& _Cdecl operator= (streambuf*);
};


class iostream_withassign : public iostream {
public:
                // does no initialization
        _Cdecl iostream_withassign();

virtual _Cdecl ~iostream_withassign();

        // gets buffer from stream and does entire initialization
    iostream_withassign& _Cdecl operator= (ios&);

        // associates streambuf with stream and does entire initialization
    iostream_withassign& _Cdecl operator= (streambuf*);
};


/*
 * The predefined streams
 */
extern istream_withassign _Cdecl cin;
extern ostream_withassign _Cdecl cout;
extern ostream_withassign _Cdecl cerr;
extern ostream_withassign _Cdecl clog;



/*
 * Manipulators
 */
ostream& _Cdecl endl(ostream&); // insert newline and flush
ostream& _Cdecl ends(ostream&); // insert null to terminate string
ostream& _Cdecl flush(ostream&);// flush the ostream
ios&     _Cdecl dec(ios&);      // set conversion base to decimal
ios&     _Cdecl hex(ios&);      // set conversion base to hexidecimal
ios&     _Cdecl oct(ios&);      // set conversion base to octal
istream& _Cdecl ws(istream&);   // extract whitespace characters

#endif

See Also: iostream.h (1)

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson