This header is part of theInput/Output library.
Classes | ||
(deprecated in C++98)(removed in C++26) | implements raw character array device (class)[edit] | |
(deprecated in C++98)(removed in C++26) | implements character array input operations (class)[edit] | |
(deprecated in C++98)(removed in C++26) | implements character array output operations (class)[edit] | |
(deprecated in C++98)(removed in C++26) | implements character array input/output operations (class)[edit] |
<strstream> is deprecated in C++98 and removed in C++26 (seeP2867R1).
The reason for removal is that C++20 and C++23 provide superior replacement facilities, such as the ability to move strings efficiently out ofstd::stringstreams (since C++20, seeP0408R7), and the<spanstream> library (since C++23, seeP0448R4).
namespace std{class strstreambuf;class istrstream;class ostrstream;class strstream;}
namespace std{class strstreambuf:public basic_streambuf<char>{public: strstreambuf(): strstreambuf(0){}explicit strstreambuf(streamsize alsize_arg); strstreambuf(void*(*palloc_arg)(size_t),void(*pfree_arg)(void*)); strstreambuf(char* gnext_arg, streamsize n,char* pbeg_arg= nullptr); strstreambuf(constchar* gnext_arg, streamsize n); strstreambuf(signedchar* gnext_arg, streamsize n,signedchar* pbeg_arg= nullptr); strstreambuf(constsignedchar* gnext_arg, streamsize n); strstreambuf(unsignedchar* gnext_arg, streamsize n,unsignedchar* pbeg_arg= nullptr); strstreambuf(constunsignedchar* gnext_arg, streamsize n); virtual ~strstreambuf(); void freeze(bool freezefl=true);char* str();int pcount(); protected: int_type overflow(int_type c=EOF) override; int_type pbackfail(int_type c=EOF) override; int_type underflow() override; pos_type seekoff(off_type off, ios_base::seekdir way, ios_base::openmode which= ios_base::in| ios_base::out) override; pos_type seekpos(pos_type sp, ios_base::openmode which= ios_base::in| ios_base::out) override; streambuf* setbuf(char* s, streamsize n) override; private:using strstate=/*bitmask type*/;// exposition onlystaticconst strstate allocated;// exposition onlystaticconst strstate constant;// exposition onlystaticconst strstate dynamic;// exposition onlystaticconst strstate frozen;// exposition only strstate strmode;// exposition only streamsize alsize;// exposition onlyvoid*(*palloc)(size_t);// exposition onlyvoid(*pfree)(void*);// exposition only};}
namespace std{class istrstream:public basic_istream<char>{public:explicit istrstream(constchar* s);explicit istrstream(char* s); istrstream(constchar* s, streamsize n); istrstream(char* s, streamsize n);virtual ~istrstream(); strstreambuf* rdbuf()const;char* str();private: strstreambuf sb;// exposition only};}
namespace std{class ostrstream:public basic_ostream<char>{public: ostrstream(); ostrstream(char* s,int n, ios_base::openmode mode= ios_base::out);virtual ~ostrstream(); strstreambuf* rdbuf()const;void freeze(bool freezefl=true);char* str();int pcount()const;private: strstreambuf sb;// exposition only};}
namespace std{class strstream:public basic_iostream<char>{public:// typesusing char_type=char;using int_type= char_traits<char>::int_type;using pos_type= char_traits<char>::pos_type;using off_type= char_traits<char>::off_type; // constructors/destructor strstream(); strstream(char* s,int n, ios_base::openmode mode= ios_base::in| ios_base::out);virtual ~strstream(); // members strstreambuf* rdbuf()const;void freeze(bool freezefl=true);int pcount()const;char* str(); private: strstreambuf sb;// exposition only};}