361 #ifndef CGU_FDSTREAM_H
362 #define CGU_FDSTREAM_H
368 #include <sys/types.h>
413 template <
class charT ,
class Traits = std::
char_traits<
charT> >
427 static const int buf_size = 1024;
428 #if defined(CGU_USE_GLIB_MEMORY_SLICES_COMPAT) || defined(CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT)
456 virtual int_type
overflow(int_type);
458 #ifndef FDSTREAM_USE_STD_N_READ_WRITE
470 virtual std::streamsize
xsputn(
const char_type*, std::streamsize);
509 virtual pos_type
seekoff(off_type off,
510 std::ios_base::seekdir way,
511 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
543 virtual pos_type
seekpos(pos_type p,
544 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
611 void attach_fd(
int fd_,
bool manage_ =
true);
695 template <
class charT ,
class Traits = std::
char_traits<
charT> >
877 template <
class charT ,
class Traits = std::
char_traits<
charT> >
892 static const int putback_size = 4;
893 static const int buf_size = 1024;
894 char_type buffer[buf_size + putback_size];
896 static void swap_element(char_type&);
912 #ifndef FDSTREAM_USE_STD_N_READ_WRITE
924 virtual std::streamsize
xsgetn(char_type*, std::streamsize);
961 virtual pos_type
seekoff(off_type off,
962 std::ios_base::seekdir way,
963 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
995 virtual pos_type
seekpos(pos_type p,
996 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
1047 void attach_fd(
int fd_,
bool manage_ =
true);
1129 template <
class charT ,
class Traits = std::
char_traits<
charT> >
1406 #include <c++-gtk-utils/fdstream.tpp>
Input stream for unix file descriptors.
Definition: fdstream.h:1130
basic_fdinbuf< char32_t > u32fdinbuf
Input stream buffer for file descriptors for char32_t type.
Definition: fdstream.h:1379
Output stream buffer for unix file descriptors.
Definition: fdstream.h:414
basic_fdostream< char32_t > u32fdostream
Output stream for file descriptors for char32_t type.
Definition: fdstream.h:1402
void set_buffered(bool buffered)
Definition: fdstream.h:842
virtual std::streamsize xsputn(const char_type *, std::streamsize)
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)
virtual ~basic_fdoutbuf()
virtual pos_type seekpos(pos_type p, std::ios_base::openmode m=std::ios_base::in|std::ios_base::out)
basic_fdoutbuf< char16_t > u16fdoutbuf
Output stream buffer for file descriptors for char16_t type.
Definition: fdstream.h:1356
bool can_seek() const
Definition: fdstream.h:1274
void swap(Cgu::AsyncQueue< T, Container > &q1, Cgu::AsyncQueue< T, Container > &q2)
Definition: async_queue.h:1483
traits_type::pos_type pos_type
Definition: fdstream.h:420
virtual int_type overflow(int_type)
basic_fdostream< wchar_t > wfdostream
Output stream for file descriptors for wchar_t type.
Definition: fdstream.h:1342
basic_fdistream< char32_t > u32fdistream
Input stream for file descriptors for char32_t type.
Definition: fdstream.h:1394
basic_fdostream & operator=(const basic_fdostream &)=delete
basic_fdistream(int fd, bool manage=true)
Definition: fdstream.h:1160
traits_type::int_type int_type
Definition: fdstream.h:419
void attach(int fd, bool manage=true)
Definition: fdstream.h:1202
basic_fdinbuf< char16_t > u16fdinbuf
Input stream buffer for file descriptors for char16_t type.
Definition: fdstream.h:1349
void attach_fd(int fd_, bool manage_=true)
basic_fdoutbuf< char > fdoutbuf
Output stream buffer for file descriptors for char type.
Definition: fdstream.h:1296
int get_fd() const
Definition: fdstream.h:637
traits_type::off_type off_type
Definition: fdstream.h:421
A deleter functor for use as the second (Dealloc) template parameter of the SharedHandle, SharedLockHandle or ScopedHandle template classes, which calls glib's g_slice_free1().
Definition: shared_handle.h:418
virtual int_type underflow()
basic_fdostream< char > fdostream
Output stream for file descriptors for char type.
Definition: fdstream.h:1312
void set_buffered(bool buffered)
basic_fdinbuf< char > fdinbuf
Input stream buffer for file descriptors for char type.
Definition: fdstream.h:1289
basic_fdinbuf< wchar_t > wfdinbuf
Input stream buffer for file descriptors for wchar_t type.
Definition: fdstream.h:1319
int filedesc() const
Definition: fdstream.h:1231
basic_fdistream< wchar_t > wfdistream
Input stream for file descriptors for wchar_t type.
Definition: fdstream.h:1334
basic_fdoutbuf & operator=(const basic_fdoutbuf &)=delete
basic_fdoutbuf< wchar_t > wfdoutbuf
Output stream buffer for file descriptors for wchar_t type.
Definition: fdstream.h:1326
Input stream buffer for unix file descriptors.
Definition: fdstream.h:878
charT char_type
Definition: fdstream.h:881
This is a generic scoped class for managing the lifetime of objects allocated on freestore.
Definition: shared_handle.h:449
traits_type::off_type off_type
Definition: fdstream.h:885
traits_type::pos_type pos_type
Definition: fdstream.h:884
Definition: application.h:44
charT char_type
Definition: fdstream.h:417
void attach_fd(int fd_, bool manage_=true)
virtual pos_type seekpos(pos_type p, std::ios_base::openmode m=std::ios_base::in|std::ios_base::out)
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 set_byteswap(bool swap)
Definition: fdstream.h:1257
Output stream for unix file descriptors.
Definition: fdstream.h:696
Traits traits_type
Definition: fdstream.h:418
basic_fdistream< char16_t > u16fdistream
Input stream for file descriptors for char16_t type.
Definition: fdstream.h:1364
void close()
Definition: fdstream.h:1219
basic_fdinbuf(const basic_fdinbuf &)=delete
void close()
Definition: fdstream.h:802
bool can_seek() const
Definition: fdstream.h:859
basic_fdostream()
Definition: fdstream.h:749
void attach(int fd, bool manage=true)
Definition: fdstream.h:785
Traits traits_type
Definition: fdstream.h:882
void set_byteswap(bool swap)
basic_fdostream(int fd, bool manage=true)
Definition: fdstream.h:735
basic_fdostream< char16_t > u16fdostream
Output stream for file descriptors for char16_t type.
Definition: fdstream.h:1372
basic_fdistream< char > fdistream
Input stream for file descriptors for char type.
Definition: fdstream.h:1304
basic_fdistream()
Definition: fdstream.h:1174
int get_fd() const
Definition: fdstream.h:1073
basic_fdoutbuf< char32_t > u32fdoutbuf
Output stream buffer for file descriptors for char32_t type.
Definition: fdstream.h:1386
int filedesc() const
Definition: fdstream.h:814
#define CGU_GLIB_MEMORY_SLICES_FUNCS
Definition: cgu_config.h:84
virtual std::streamsize xsgetn(char_type *, std::streamsize)
basic_fdoutbuf(const basic_fdoutbuf &)=delete
basic_fdinbuf & operator=(const basic_fdinbuf &)=delete
traits_type::int_type int_type
Definition: fdstream.h:883
basic_fdistream & operator=(const basic_fdistream &)=delete