std::istrstream(3)
std::istrstream(3) π
okay so bestie, this is the std::istrstream(3) page from the C++ Standard Libary manual β yes, thatβs the spelling up top, weβre not fixing it, itβs iconic β and the name is literally just std::istrstream. no cap.
πΈ NAME πΈ
std::istrstream β std::istrstream. thatβs it. thatβs the name. slay.
β¨ Synopsis β¨
Defined in header <strstream>:
class istrstream : public std::istream (deprecated in C++98)
(removed in C++26)
The class istrstream implements input operations on array-backed streams. It essentially wraps a raw array I/O device implementation (std::strstreambuf) into the higher-level interface of std::basic_istream.
The typical implementation of istrstream holds only one non-derived data member: an object of type std::strstreambuf.
π Notes π
istrstream has been deprecated since C++98 and removed since C++26.
std::istringstream, std::ispanstream (since C++23), and boost::iostreams::array_source are the recommended replacements.
π«Ά Member functions π«Ά
constructorβ constructs anistrstreamobject, optionally allocating the buffer (public member function)destructorβ destructs anistrstreamobject, optionally deallocating the buffer[virtual]β (virtual public member function)rdbufβ obtains a pointer to the associatedstrstreambuf(public member function)strβ accesses the output buffer (public member function)
π¦ Inherited from std::basic_istream π¦
β¨ Member functions β¨
Formatted input
operator>>β extracts formatted data (public member function ofstd::basic_istream<CharT,Traits>)
Unformatted input
getβ extracts characters (public member function ofstd::basic_istream<CharT,Traits>)peekβ reads the next character without extracting it (public member function ofstd::basic_istream<CharT,Traits>)ungetβ unextracts a character (public member function ofstd::basic_istream<CharT,Traits>)putbackβ puts a character into input stream (public member function ofstd::basic_istream<CharT,Traits>)getlineβ extracts characters until the given character is found (public member function ofstd::basic_istream<CharT,Traits>)ignoreβ extracts and discards characters until the given character is found (public member function ofstd::basic_istream<CharT,Traits>)readβ extracts blocks of characters (public member function ofstd::basic_istream<CharT,Traits>)readsomeβ extracts already available blocks of characters (public member function ofstd::basic_istream<CharT,Traits>)gcountβ returns number of characters extracted by last unformatted input operation (public member function ofstd::basic_istream<CharT,Traits>)
Positioning
tellgβ returns the input position indicator (public member function ofstd::basic_istream<CharT,Traits>)seekgβ sets the input position indicator (public member function ofstd::basic_istream<CharT,Traits>)
Miscellaneous
syncβ synchronizes with the underlying storage device (public member function ofstd::basic_istream<CharT,Traits>)
π Member classes π
sentryβ implements basic logic for preparation of the stream for input operations (public member class ofstd::basic_istream<CharT,Traits>)
π Inherited from std::basic_ios π
π Member types π
char_typeβCharTtraits_typeβTraitsint_typeβTraits::int_typepos_typeβTraits::pos_typeoff_typeβTraits::off_type
π Member functions π
State functions
goodβ checks if no error has occurred i.e. I/O operations are available (public member function ofstd::basic_ios<CharT,Traits>)eofβ checks if end-of-file has been reached (public member function ofstd::basic_ios<CharT,Traits>)failβ checks if an error has occurred (public member function ofstd::basic_ios<CharT,Traits>)badβ checks if a non-recoverable error has occurred (public member function ofstd::basic_ios<CharT,Traits>)operator!β checks if an error has occurred (synonym offail()) (public member function ofstd::basic_ios<CharT,Traits>)operator boolβ checks if no error has occurred (synonym of!fail()) (public member function ofstd::basic_ios<CharT,Traits>)rdstateβ returns state flags (public member function ofstd::basic_ios<CharT,Traits>)setstateβ sets state flags (public member function ofstd::basic_ios<CharT,Traits>)clearβ modifies state flags (public member function ofstd::basic_ios<CharT,Traits>)
Formatting
copyfmtβ copies formatting information (public member function ofstd::basic_ios<CharT,Traits>)fillβ manages the fill character (public member function ofstd::basic_ios<CharT,Traits>)
Miscellaneous
exceptionsβ manages exception mask (public member function ofstd::basic_ios<CharT,Traits>)imbueβ sets the locale (public member function ofstd::basic_ios<CharT,Traits>)rdbufβ manages associated stream buffer (public member function ofstd::basic_ios<CharT,Traits>)tieβ manages tied stream (public member function ofstd::basic_ios<CharT,Traits>)narrowβ narrows characters (public member function ofstd::basic_ios<CharT,Traits>)widenβ widens characters (public member function ofstd::basic_ios<CharT,Traits>)
π Inherited from std::ios_base π
π§ Member functions π§
Formatting
flagsβ manages format flags (public member function ofstd::ios_base)setfβ sets specific format flag (public member function ofstd::ios_base)unsetfβ clears specific format flag (public member function ofstd::ios_base)precisionβ manages decimal precision of floating point operations (public member function ofstd::ios_base)widthβ manages field width (public member function ofstd::ios_base)
Locales
imbueβ sets locale (public member function ofstd::ios_base)getlocβ returns current locale (public member function ofstd::ios_base)
Internal extensible array
xalloc[static]β returns a program-wide unique integer that is safe to use as index topword()andiword()(public static member function ofstd::ios_base)iwordβ resizes the private storage if necessary and access to thelongelement at the given index (public member function ofstd::ios_base)pwordβ resizes the private storage if necessary and access to thevoid*element at the given index (public member function ofstd::ios_base)
Miscellaneous
register_callbackβ registers event callback function (public member function ofstd::ios_base)sync_with_stdio[static]β sets whether C++ and C I/O libraries are interoperable (public static member function ofstd::ios_base)
π Member classes π
failureβ stream exception (public member class ofstd::ios_base)Initβ initializes standard stream objects (public member class ofstd::ios_base)
okay so hereβs the member-types-and-constants part, bestie β itβs giving βkeep this tab open foreverβ energy, and honestly same π
openmodeβ stream open mode type (typedef). The following constants are also defined:appβ seek to the end of stream before each writebinaryβ open in binary modeinβ open for readingoutβ open for writingtruncβ discard the contents of the stream when openingateβ seek to the end of stream immediately after opennoreplace(C++23) β open in exclusive mode
fmtflagsβ formatting flags type (typedef). The following constants are also defined:decβ use decimal base for integer I/O: seestd::decoctβ use octal base for integer I/O: seestd::octhexβ use hexadecimal base for integer I/O: seestd::hexbasefieldβdec | oct | hex. Useful for masking operationsleftβ left adjustment (adds fill characters to the right): seestd::leftrightβ right adjustment (adds fill characters to the left): seestd::rightinternalβ internal adjustment (adds fill characters to the internal designated point): seestd::internaladjustfieldβleft | right | internal. Useful for masking operationsscientificβ generate floating point types using scientific notation, or hex notation if combined withfixed: seestd::scientificfixedβ generate floating point types using fixed notation, or hex notation if combined withscientific: seestd::fixedfloatfieldβscientific | fixed. Useful for masking operationsboolalphaβ insert and extractbooltype in alphanumeric format: seestd::boolalphashowbaseβ generate a prefix indicating the numeric base for integer output, require the currency indicator in monetary I/O: seestd::showbaseshowpointβ generate a decimal-point character unconditionally for floating-point number output: seestd::showpointshowposβ generate a+character for non-negative numeric output: seestd::showposskipwsβ skip leading whitespace before certain input operations: seestd::skipwsunitbufβ flush the output after each output operation: seestd::unitbufuppercaseβ replace certain lowercase letters with their uppercase equivalents in certain output operations: seestd::uppercase
iostateβ state of the stream type (typedef). The following constants are also defined:goodbitβ no errorbadbitβ irrecoverable stream errorfailbitβ input/output operation failed (formatting or extraction error)eofbitβ associated input sequence has reached end-of-file
seekdirβ seeking direction type (typedef). The following constants are also defined:begβ the beginning of a streamendβ the ending of a streamcurβ the current position of stream position indicator
eventβ specifies event type (enum)event_callbackβ callback function type (typedef)
okay thatβs the whole reference-table moment, bestie β you ate, no crumbs π
β¨ The footer energy is cppreference.com, version/date 2024.06.10, for std::istrstream(3) β mwah, go slay some streams ππ¦
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms