3.8.0
Freundlich's C++ toolkit
Classes | Typedefs | Functions
fcppt::io Namespace Reference

IO-related typedefs and functions. More...

Classes

class  basic_scoped_rdbuf
 Changes the streambuf of a stream temporarily. More...
 

Typedefs

using buffer = fcppt::container::raw_vector::object< char >
 
using istream = std::basic_istream< fcppt::char_type >
 Typedef to either std::istream or std::wistream, depending on fcppt::char_type. More...
 
using istringstream = std::basic_istringstream< fcppt::char_type >
 Typedef to either std::istringstream or std::wistringstream, depending on fcppt::char_type. More...
 
using optional_buffer = fcppt::optional::object< fcppt::io::buffer >
 
using ostream = std::basic_ostream< fcppt::char_type >
 Typedef to either std::ostream or std::wostream, depending on fcppt::char_type. More...
 
using ostringstream = std::basic_ostringstream< fcppt::char_type >
 Typedef to either std::ostringstream or std::wostringstream, depending on fcppt::char_type. More...
 
using scoped_rdbuf = fcppt::io::basic_scoped_rdbuf< fcppt::char_type >
 
using stringstream = std::basic_stringstream< fcppt::char_type >
 Typedef to either std::stringstream or std::wstringstream, depending on fcppt::char_type. More...
 

Functions

FCPPT_DETAIL_SYMBOL fcppt::io::ostreamcerr ()
 Returns either std::cerr or std::wcerr, depending on fcppt::char_type. More...
 
FCPPT_DETAIL_SYMBOL fcppt::io::istreamcin ()
 Returns either std::cin or std::wcin, depending on fcppt::char_type. More...
 
FCPPT_DETAIL_SYMBOL fcppt::io::ostreamclog ()
 Returns either std::clog or std::wclog, depending on fcppt::char_type. More...
 
FCPPT_DETAIL_SYMBOL fcppt::io::ostreamcout ()
 Returns either std::cout or std::wcout, depending on fcppt::char_type. More...
 
template<typename Ch , typename Traits , typename Type >
std::basic_istream< Ch, Traits > & expect (std::basic_istream< Ch, Traits > &_stream, Type const &_value)
 Fails a stream if it does not read the expected value. More...
 
template<typename Type , typename Ch , typename Traits >
fcppt::optional::object< Type > extract (std::basic_istream< Ch, Traits > &_stream)
 Reads a value from a stream, returning an optional. More...
 
template<typename Ch , typename Traits >
fcppt::optional::object< Ch > get (std::basic_istream< Ch, Traits > &_stream)
 Gets a character from a stream. More...
 
template<typename Ch , typename Traits >
fcppt::optional::object< std::string > narrow_string (std::basic_ios< Ch, Traits > const &_ios, std::basic_string_view< Ch, Traits > const &_string)
 Uses narrow on every character.Calls fcppt::io::narrow_string_locale using the locale from _ios. More...
 
template<typename Ch , typename Traits >
fcppt::optional::object< std::string > narrow_string_locale (std::basic_string_view< Ch, Traits > const &_string, std::locale const &_locale)
 Uses narrow on every character.Let _string = c_1 ... c_n and d_i = narrow(c_i,0) for i = 1,...,n, where narrow is the function from std::ctype<Ch>. Then this function returns the string d_1, ..., d_n if and only if d_i != 0 for i = 1,...,n. More...
 
template<typename Ch , typename Traits >
fcppt::optional::object< Ch > peek (std::basic_istream< Ch, Traits > &_stream)
 Peeks at a character from a stream. More...
 
template<typename Type >
fcppt::optional::object< Type > read (std::istream &_stream, fcppt::endianness::format const _format)
 Reads an object of arithmetic type from a stream. More...
 
FCPPT_DETAIL_SYMBOL fcppt::io::optional_buffer read_chars (std::istream &stream, std::size_t count)
 Reads a number of chars. More...
 
template<typename Ch , typename Traits >
fcppt::optional::object< std::basic_string< Ch, Traits > > stream_to_string (std::basic_istream< Ch, Traits > &_input)
 Reads the contents of a stream into a string. More...
 
fcppt::io::detail::widen_string widen_string (std::string _string)
 Creates a string that outputs each character by widening. More...
 
template<typename Type >
void write (std::ostream &_stream, Type const &_value, fcppt::endianness::format const _format)
 Writes an object of arithmetic type to a stream. More...
 
FCPPT_DETAIL_SYMBOL bool write_chars (std::ostream &stream, char const *data, std::size_t count)
 Writes a number of chars. More...
 

Detailed Description

IO-related typedefs and functions.

Typedef Documentation

◆ buffer

◆ optional_buffer

◆ scoped_rdbuf