Go to the documentation of this file.
446 #ifndef CGU_GSTREAM_H
447 #define CGU_GSTREAM_H
451 #if defined(DOXYGEN_PARSING) || GLIB_CHECK_VERSION(2,16,0)
464 #include <glib-object.h>
499 template <
class charT ,
class Traits = std::
char_traits<
charT> >
519 static const int output_buf_size = 1024;
520 static const int putback_size = 4;
521 static const int input_buf_size = 1024;
523 #if defined(CGU_USE_GLIB_MEMORY_SLICES_COMPAT) || defined(CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT)
536 void reset_input_buffer_pointers();
538 bool wind_back_input_buffer();
539 bool is_input_stored();
540 bool is_output_stored();
541 void set_error(GError*);
542 void set_input_error(GError*);
543 void set_output_error(GError*);
582 #ifndef CGU_GSTREAM_USE_STD_N_READ_WRITE
673 std::ios_base::seekdir way,
674 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
723 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
1364 template <
class charT ,
class Traits = std::
char_traits<
charT> >
1435 std::basic_ostream<charT, Traits>(0),
1436 buf(stream, manage, converter) {
1519 {buf.
attach_stream(stream, manage, converter); this->clear();}
1650 template <
class charT ,
class Traits = std::
char_traits<
charT> >
1720 std::basic_istream<charT, Traits>(0),
1721 buf(stream, manage, converter) {
1804 {buf.
attach_stream(stream, manage, converter); this->clear();}
1930 template <
class charT ,
class Traits = std::
char_traits<
charT> >
2008 std::basic_iostream<charT, Traits>(0),
2009 buf(stream, manage, input_converter, output_converter) {
2102 {buf.
attach_stream(stream, manage, input_converter, output_converter); this->clear();}
2386 #include <c++-gtk-utils/gstream.tpp>
2389 #warning gstreams are not available: glib >= 2.16.0 is required
void set_output_buffered(bool buffered)
Definition: gstream.h:2250
basic_gstreambuf< wchar_t > wgstreambuf
C++ stream buffer for GIO streams for wchar_t type.
Definition: gstream.h:2358
virtual ~basic_gstreambuf()
C++ output stream for GIO streams.
Definition: gstream.h:1365
Definition: application.h:45
basic_gstreambuf< char > gstreambuf
C++ stream buffer for GIO streams for char type.
Definition: gstream.h:2327
basic_giostream< wchar_t > wgiostream
C++ input/output stream for GIO streams for wchar_t type.
Definition: gstream.h:2382
GError * is_output_error()
Definition: gstream.h:2291
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:2004
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:2124
traits_type::off_type off_type
Definition: gstream.h:507
basic_gostream< wchar_t > wgostream
C++ output stream for GIO streams for wchar_t type.
Definition: gstream.h:2374
GError * is_output_error()
basic_gistream(const GobjHandle< GInputStream > &stream, bool manage, const GobjHandle< GConverter > &converter=GobjHandle< GConverter >())
Definition: gstream.h:1717
C++ input stream for GIO streams.
Definition: gstream.h:1651
bool can_seek() const
Definition: gstream.h:1310
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:2098
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:2351
void swap(Cgu::AsyncQueue< T, Container > &q1, Cgu::AsyncQueue< T, Container > &q2)
Definition: async_queue.h:784
void set_byteswap(bool swap)
GError * is_error()
Definition: gstream.h:1633
void set_byteswap(bool swap)
Definition: gstream.h:1873
A deleter functor for use as the second (Dealloc) template parameter of the SharedHandle,...
Definition: shared_handle.h:380
traits_type::int_type int_type
Definition: gstream.h:505
void attach(const GobjHandle< GInputStream > &stream, bool manage, const GobjHandle< GConverter > &converter=GobjHandle< GConverter >())
Definition: gstream.h:1801
void set_buffered(bool buffered)
Definition: gstream.h:1593
basic_giostream()
Definition: gstream.h:2023
basic_gostream< char > gostream
C++ output stream for GIO streams for char type.
Definition: gstream.h:2343
void set_output_buffered(bool buffered)
GobjHandle< GInputStream > get_istream() const
C++ input-output stream for GIO streams.
Definition: gstream.h:1931
GobjHandle< GIOStream > get_gio_io_stream() const
Definition: gstream.h:2141
GError * is_input_error()
Definition: gstream.h:2312
virtual int_type underflow()
virtual int_type overflow(int_type)
GobjHandle< GIOStream > get_iostream() const
GError * is_input_error()
basic_gostream()
Definition: gstream.h:1450
void attach(const GobjHandle< GOutputStream > &stream, bool manage, const GobjHandle< GConverter > &converter=GobjHandle< GConverter >())
Definition: gstream.h:1516
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:2161
GobjHandle< GInputStream > get_gio_stream() const
Definition: gstream.h:1845
void close()
Definition: gstream.h:1826
basic_gistream()
Definition: gstream.h:1735
GobjHandle< GOutputStream > get_gio_stream() const
Definition: gstream.h:1560
GobjHandle< GInputStream > get_gio_input_stream() const
Definition: gstream.h:2181
void close()
Definition: gstream.h:1541
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:411
bool can_seek() const
Definition: gstream.h:1892
traits_type::pos_type pos_type
Definition: gstream.h:506
C++ stream buffer for GIO streams.
Definition: gstream.h:500
basic_gistream< char > gistream
C++ input stream for GIO streams for char type.
Definition: gstream.h:2335
bool can_seek() const
Definition: gstream.h:2270
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:1432
basic_gistream< wchar_t > wgistream
C++ input stream for GIO streams for wchar_t type.
Definition: gstream.h:2366
GobjHandle< GOutputStream > get_ostream() const
void set_byteswap(bool swap)
Definition: gstream.h:2213
GError * is_error()
Definition: gstream.h:1913
charT char_type
Definition: gstream.h:503
Traits traits_type
Definition: gstream.h:504
bool can_seek() const
Definition: gstream.h:1612