std::basic_ios::widen

char_type widen( char c ) const; Converts a character c to its equivalent in the current locale. The result is converted from char to character type used within the stream if needed. Effectively calls std::use_facet< std::ctype<char_type> >(getloc()).widen(c). Parameters c - character to convert Return value Character converted to char_type. See also narrow narrows characters (public member function) do_widen [virtual] converts a character or char

std::basic_ios::tie

std::basic_ostream<CharT,Traits>* tie() const; (1) std::basic_ostream<CharT,Traits>* tie( std::basic_ostream<CharT,Traits>* str ); (2) Manages the tied stream. A tied stream is an output stream which is synchronized with the sequence controlled by the stream buffer (rdbuf()), that is, flush() is called on the tied stream before any input/output operation on *this. 1) Returns the current tied stream. If there is no tied stream, NULL is returned. 2) Sets the curr

std::basic_ios::swap

protected: void swap( basic_ios& other ); (since C++11) Exchanges the states of *this and other, except for the associated rdbuf objects. rdbuf() and other.rdbuf() returns the same values as before the call. This swap function is protected: it is called by the swap member functions of the derived stream classes such as std::basic_ofstream or std::basic_istringstream, which know how to correctly swap the associated streambuffers. Parameters other - the basic_ios object to exc

std::basic_ios::set_rdbuf

protected: void set_rdbuf( std::basic_streambuf<CharT,Traits>* sb ); Sets the associated stream buffer to sb without clearing the error state. This member function is protected: it is called by the move constructors of the derived streams such as std::basic_ofstream or std::basic_istringstream, as the final step after constructing the base class and after moving the stream buffer: only the most derived stream class knows how to correctly move the stream buffer, but std::basic_ios

std::basic_ios::setstate

void setstate( iostate state ); Sets the stream error flags state in addition to currently set flags. Essentially calls clear(rdstate() | state). May throw an exception. Parameters state - stream error state flags to set. It can be a combination of the following constants: Constant Explanation goodbit no error badbit irrecoverable stream error failbit input/output operation failed (formatting or extraction error) eofbit associated input sequence has reached en

std::basic_ios::rdstate

iostate rdstate() const; Returns the current stream error state. Parameters (none). Return value current stream error state. It is a bitmask type and can be a combination of the following constants: Constant Explanation goodbit no error badbit irrecoverable stream error failbit input/output operation failed (formatting or extraction error) eofbit associated input sequence has reached end-of-file Example #include <iostream> #include <sstream>

std::basic_ios::rdbuf

std::basic_streambuf<CharT, Traits>* rdbuf() const; (1) std::basic_streambuf<CharT, Traits>* rdbuf( std::basic_streambuf<CharT, Traits>* sb ); (2) Manages the associated stream buffer. 1) Returns the associated stream buffer. If there is no associated stream buffer, returns NULL. 2) Sets the associated stream buffer to sb. The error state is cleared by calling clear(). Returns the associated stream buffer before the operation. If there is no associated stream b

std::basic_ios::operator bool

operator void*() const; (1) (until C++11) explicit operator bool() const; (2) (since C++11) Checks whether the stream has no errors. 1) Returns a null pointer if fail() returns true, otherwise returns a non-null pointer. This pointer is implicitly convertible to bool and may be used in boolean contexts. 2) Returns true if the stream has no errors and is ready for I/O operations. Specifically, returns !fail(). This operator makes it possible to use streams and functions that ret

std::basic_ios::narrow

char narrow( char_type c, char dfault ) const; Converts a current locale-specific character c to its standard equivalent. The result is converted from char_type to char if needed. If no conversion can be performed, the function returns dfault. Effectively calls std::use_facet< std::ctype<char_type> >(getloc()).narrow(c, dfault);. Parameters c - character to convert dfault - character to return if the conversion was unsuccessful Return value Character conv

std::basic_ios::move

protected: void move( basic_ios& other ); (since C++11) protected: void move( basic_ios&& other ); (since C++11) Replaces the current state with that of other, except for the associated rdbuf. other is in valid, but unspecified state after the call. After the call to this function, rdbuf() returns NULL, and other.rdbuf() returns the same value as before the call. This member function is protected: it is called by the protected move constructors of the derived stream cl