Go to the documentation of this file.
464 #ifndef CGU_GSTREAM_H
465 #define CGU_GSTREAM_H
469 #if defined(DOXYGEN_PARSING) || GLIB_CHECK_VERSION(2,16,0)
482 #include <glib-object.h>
524 template <
class charT ,
class Traits = std::
char_traits<
charT> >
544 static const int output_buf_size = 1024;
545 static const int putback_size = 4;
546 static const int input_buf_size = 1024;
548 #if defined(CGU_USE_GLIB_MEMORY_SLICES_COMPAT) || defined(CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT)
561 void reset_input_buffer_pointers();
563 bool wind_back_input_buffer();
564 bool is_input_stored();
565 bool is_output_stored();
566 void set_input_error(GError*);
567 void set_output_error(GError*);
603 #ifndef CGU_GSTREAM_USE_STD_N_READ_WRITE
693 std::ios_base::seekdir way,
694 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
741 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
1368 template <
class charT ,
class Traits = std::
char_traits<
charT> >
1447 std::basic_ostream<charT, Traits>(0),
1448 buf(stream, manage, converter) {
1528 {buf.
attach_stream(stream, manage, converter); this->clear();}
1651 template <
class charT ,
class Traits = std::
char_traits<
charT> >
1728 std::basic_istream<charT, Traits>(0),
1729 buf(stream, manage, converter) {
1809 {buf.
attach_stream(stream, manage, converter); this->clear();}
1927 template <
class charT ,
class Traits = std::
char_traits<
charT> >
2012 std::basic_iostream<charT, Traits>(0),
2013 buf(stream, manage, input_converter, output_converter) {
2103 {buf.
attach_stream(stream, manage, input_converter, output_converter); this->clear();}
2435 #include <c++-gtk-utils/gstream.tpp>
2438 #warning gstreams are not available: glib >= 2.16.0 is required
void set_output_buffered(bool buffered)
Definition: gstream.h:2239
basic_gstreambuf< wchar_t > wgstreambuf
C++ stream buffer for GIO streams for wchar_t type.
Definition: gstream.h:2345
virtual ~basic_gstreambuf()
basic_gistream< char32_t > u32gistream
C++ input stream for GIO streams for char32_t type.
Definition: gstream.h:2415
C++ output stream for GIO streams.
Definition: gstream.h:1369
Definition: application.h:44
basic_gstreambuf< char > gstreambuf
C++ stream buffer for GIO streams for char type.
Definition: gstream.h:2314
basic_giostream< wchar_t > wgiostream
C++ input/output stream for GIO streams for wchar_t type.
Definition: gstream.h:2369
GError * is_output_error()
Definition: gstream.h:2278
basic_giostream(const GobjHandle< GIOStream > &stream, bool manage, const GobjHandle< GConverter > &input_converter=GobjHandle< GConverter >(), const GobjHandle< GConverter > &output_converter=GobjHandle< GConverter >())
Definition: gstream.h:2008
virtual pos_type seekoff(off_type off, std::ios_base::seekdir way, std::ios_base::openmode m=std::ios_base::in|std::ios_base::out)
void close()
Definition: gstream.h:2123
basic_giostream & operator=(const basic_giostream &)=delete
traits_type::off_type off_type
Definition: gstream.h:532
basic_gistream & operator=(const basic_gistream &)=delete
basic_gostream< wchar_t > wgostream
C++ output stream for GIO streams for wchar_t type.
Definition: gstream.h:2361
GError * is_output_error()
basic_gistream(const GobjHandle< GInputStream > &stream, bool manage, const GobjHandle< GConverter > &converter=GobjHandle< GConverter >())
Definition: gstream.h:1725
C++ input stream for GIO streams.
Definition: gstream.h:1652
bool can_seek() const
Definition: gstream.h:1314
void attach(const GobjHandle< GIOStream > &stream, bool manage, const GobjHandle< GConverter > &input_converter=GobjHandle< GConverter >(), const GobjHandle< GConverter > &output_converter=GobjHandle< GConverter >())
Definition: gstream.h:2099
virtual std::streamsize xsgetn(char_type *, std::streamsize)
basic_giostream< char > giostream
C++ input/output stream for GIO streams for char type.
Definition: gstream.h:2338
basic_gostream< char32_t > u32gostream
C++ output stream for GIO streams for char32_t type.
Definition: gstream.h:2423
void swap(Cgu::AsyncQueue< T, Container > &q1, Cgu::AsyncQueue< T, Container > &q2)
Definition: async_queue.h:1481
basic_gostream & operator=(const basic_gostream &)=delete
void set_byteswap(bool swap)
GError * is_error()
Definition: gstream.h:1634
void set_byteswap(bool swap)
Definition: gstream.h:1872
A deleter functor for use as the second (Dealloc) template parameter of the SharedHandle,...
Definition: shared_handle.h:421
basic_gstreambuf & operator=(const basic_gstreambuf &)=delete
traits_type::int_type int_type
Definition: gstream.h:530
void attach(const GobjHandle< GInputStream > &stream, bool manage, const GobjHandle< GConverter > &converter=GobjHandle< GConverter >())
Definition: gstream.h:1806
void set_buffered(bool buffered)
Definition: gstream.h:1596
basic_giostream< char16_t > u16giostream
C++ input/output stream for GIO streams for char16_t type.
Definition: gstream.h:2400
basic_giostream()
Definition: gstream.h:2026
basic_gostream< char > gostream
C++ output stream for GIO streams for char type.
Definition: gstream.h:2330
void set_output_buffered(bool buffered)
GobjHandle< GInputStream > get_istream() const
C++ input-output stream for GIO streams.
Definition: gstream.h:1928
GobjHandle< GIOStream > get_gio_io_stream() const
Definition: gstream.h:2138
GError * is_input_error()
Definition: gstream.h:2299
virtual int_type underflow()
virtual int_type overflow(int_type)
GobjHandle< GIOStream > get_iostream() const
GError * is_input_error()
basic_gostream()
Definition: gstream.h:1461
void attach(const GobjHandle< GOutputStream > &stream, bool manage, const GobjHandle< GConverter > &converter=GobjHandle< GConverter >())
Definition: gstream.h:1525
void attach_stream(const GobjHandle< GInputStream > &input_stream_, bool manage_, const GobjHandle< GConverter > &converter_=GobjHandle< GConverter >())
#define CGU_GLIB_MEMORY_SLICES_FUNCS
Definition: cgu_config.h:84
GobjHandle< GOutputStream > get_gio_output_stream() const
Definition: gstream.h:2156
GobjHandle< GInputStream > get_gio_stream() const
Definition: gstream.h:1846
basic_gstreambuf< char32_t > u32gstreambuf
C++ stream buffer for GIO streams for char32_t type.
Definition: gstream.h:2407
void close()
Definition: gstream.h:1829
basic_giostream< char32_t > u32giostream
C++ input/output stream for GIO streams for char32_t type.
Definition: gstream.h:2431
basic_gistream()
Definition: gstream.h:1742
GobjHandle< GOutputStream > get_gio_stream() const
Definition: gstream.h:1565
GobjHandle< GInputStream > get_gio_input_stream() const
Definition: gstream.h:2174
void close()
Definition: gstream.h:1548
basic_gostream< char16_t > u16gostream
C++ output stream for GIO streams for char16_t type.
Definition: gstream.h:2392
virtual pos_type seekpos(pos_type p, std::ios_base::openmode m=std::ios_base::in|std::ios_base::out)
This is a generic scoped class for managing the lifetime of objects allocated on freestore.
Definition: shared_handle.h:452
bool can_seek() const
Definition: gstream.h:1889
basic_gistream< char16_t > u16gistream
C++ input stream for GIO streams for char16_t type.
Definition: gstream.h:2384
traits_type::pos_type pos_type
Definition: gstream.h:531
C++ stream buffer for GIO streams.
Definition: gstream.h:525
basic_gistream< char > gistream
C++ input stream for GIO streams for char type.
Definition: gstream.h:2322
bool can_seek() const
Definition: gstream.h:2257
virtual std::streamsize xsputn(const char_type *, std::streamsize)
basic_gostream(const GobjHandle< GOutputStream > &stream, bool manage, const GobjHandle< GConverter > &converter=GobjHandle< GConverter >())
Definition: gstream.h:1444
basic_gistream< wchar_t > wgistream
C++ input stream for GIO streams for wchar_t type.
Definition: gstream.h:2353
GobjHandle< GOutputStream > get_ostream() const
void set_byteswap(bool swap)
Definition: gstream.h:2204
GError * is_error()
Definition: gstream.h:1910
basic_gstreambuf< char16_t > u16gstreambuf
C++ stream buffer for GIO streams for char16_t type.
Definition: gstream.h:2376
charT char_type
Definition: gstream.h:528
Traits traits_type
Definition: gstream.h:529
bool can_seek() const
Definition: gstream.h:1613