Go to the documentation of this file.
375 #ifndef CGU_FDSTREAM_H
376 #define CGU_FDSTREAM_H
382 #include <sys/types.h>
427 template <
class charT ,
class Traits = std::
char_traits<
charT> >
441 static const int buf_size = 1024;
442 #if defined(CGU_USE_GLIB_MEMORY_SLICES_COMPAT) || defined(CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT)
472 #ifndef FDSTREAM_USE_STD_N_READ_WRITE
524 std::ios_base::seekdir way,
525 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
558 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
625 void attach_fd(
int fd_,
bool manage_ =
true);
709 template <
class charT ,
class Traits = std::
char_traits<
charT> >
891 template <
class charT ,
class Traits = std::
char_traits<
charT> >
906 static const int putback_size = 4;
907 static const int buf_size = 1024;
908 char_type buffer[buf_size + putback_size];
926 #ifndef FDSTREAM_USE_STD_N_READ_WRITE
976 std::ios_base::seekdir way,
977 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
1010 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
1061 void attach_fd(
int fd_,
bool manage_ =
true);
1143 template <
class charT ,
class Traits = std::
char_traits<
charT> >
1420 #include <c++-gtk-utils/fdstream.tpp>
basic_fdistream & operator=(const basic_fdistream &)=delete
void set_buffered(bool buffered)
Definition: fdstream.h:856
basic_fdostream< char > fdostream
Output stream for file descriptors for char type.
Definition: fdstream.h:1326
Definition: application.h:44
basic_fdoutbuf & operator=(const basic_fdoutbuf &)=delete
virtual pos_type seekpos(pos_type p, std::ios_base::openmode m=std::ios_base::in|std::ios_base::out)
void set_byteswap(bool swap)
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)
traits_type::int_type int_type
Definition: fdstream.h:897
basic_fdistream< wchar_t > wfdistream
Input stream for file descriptors for wchar_t type.
Definition: fdstream.h:1348
basic_fdoutbuf< char32_t > u32fdoutbuf
Output stream buffer for file descriptors for char32_t type.
Definition: fdstream.h:1400
basic_fdinbuf< char32_t > u32fdinbuf
Input stream buffer for file descriptors for char32_t type.
Definition: fdstream.h:1393
int get_fd() const
Definition: fdstream.h:1087
basic_fdostream & operator=(const basic_fdostream &)=delete
Output stream for unix file descriptors.
Definition: fdstream.h:710
charT char_type
Definition: fdstream.h:431
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 attach(int fd, bool manage=true)
Definition: fdstream.h:1216
basic_fdostream< wchar_t > wfdostream
Output stream for file descriptors for wchar_t type.
Definition: fdstream.h:1356
virtual pos_type seekpos(pos_type p, std::ios_base::openmode m=std::ios_base::in|std::ios_base::out)
basic_fdinbuf< char16_t > u16fdinbuf
Input stream buffer for file descriptors for char16_t type.
Definition: fdstream.h:1363
basic_fdoutbuf< char16_t > u16fdoutbuf
Output stream buffer for file descriptors for char16_t type.
Definition: fdstream.h:1370
basic_fdoutbuf< char > fdoutbuf
Output stream buffer for file descriptors for char type.
Definition: fdstream.h:1310
Traits traits_type
Definition: fdstream.h:432
basic_fdistream(int fd, bool manage=true)
Definition: fdstream.h:1174
basic_fdostream< char32_t > u32fdostream
Output stream for file descriptors for char32_t type.
Definition: fdstream.h:1416
traits_type::pos_type pos_type
Definition: fdstream.h:898
basic_fdistream< char16_t > u16fdistream
Input stream for file descriptors for char16_t type.
Definition: fdstream.h:1378
void swap(Cgu::AsyncQueue< T, Container > &q1, Cgu::AsyncQueue< T, Container > &q2)
Definition: async_queue.h:1481
A deleter functor for use as the second (Dealloc) template parameter of the SharedHandle,...
Definition: shared_handle.h:421
void attach_fd(int fd_, bool manage_=true)
basic_fdinbuf & operator=(const basic_fdinbuf &)=delete
int filedesc() const
Definition: fdstream.h:1245
basic_fdoutbuf(const basic_fdoutbuf &)=delete
Input stream for unix file descriptors.
Definition: fdstream.h:1144
bool can_seek() const
Definition: fdstream.h:1288
basic_fdistream< char > fdistream
Input stream for file descriptors for char type.
Definition: fdstream.h:1318
virtual ~basic_fdoutbuf()
traits_type::off_type off_type
Definition: fdstream.h:899
#define CGU_GLIB_MEMORY_SLICES_FUNCS
Definition: cgu_config.h:84
virtual std::streamsize xsputn(const char_type *, std::streamsize)
Input stream buffer for unix file descriptors.
Definition: fdstream.h:892
void close()
Definition: fdstream.h:1233
Traits traits_type
Definition: fdstream.h:896
traits_type::pos_type pos_type
Definition: fdstream.h:434
traits_type::int_type int_type
Definition: fdstream.h:433
void attach(int fd, bool manage=true)
Definition: fdstream.h:799
bool can_seek() const
Definition: fdstream.h:873
virtual int_type overflow(int_type)
void set_byteswap(bool swap)
Definition: fdstream.h:1271
This is a generic scoped class for managing the lifetime of objects allocated on freestore.
Definition: shared_handle.h:452
basic_fdinbuf< wchar_t > wfdinbuf
Input stream buffer for file descriptors for wchar_t type.
Definition: fdstream.h:1333
basic_fdinbuf< char > fdinbuf
Input stream buffer for file descriptors for char type.
Definition: fdstream.h:1303
void close()
Definition: fdstream.h:816
basic_fdistream()
Definition: fdstream.h:1188
int filedesc() const
Definition: fdstream.h:828
basic_fdostream()
Definition: fdstream.h:763
int get_fd() const
Definition: fdstream.h:651
basic_fdinbuf(const basic_fdinbuf &)=delete
void attach_fd(int fd_, bool manage_=true)
virtual int_type underflow()
basic_fdostream< char16_t > u16fdostream
Output stream for file descriptors for char16_t type.
Definition: fdstream.h:1386
traits_type::off_type off_type
Definition: fdstream.h:435
basic_fdistream< char32_t > u32fdistream
Input stream for file descriptors for char32_t type.
Definition: fdstream.h:1408
charT char_type
Definition: fdstream.h:895
basic_fdostream(int fd, bool manage=true)
Definition: fdstream.h:749
Output stream buffer for unix file descriptors.
Definition: fdstream.h:428
basic_fdoutbuf< wchar_t > wfdoutbuf
Output stream buffer for file descriptors for wchar_t type.
Definition: fdstream.h:1340
virtual std::streamsize xsgetn(char_type *, std::streamsize)
void set_buffered(bool buffered)