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)
470 virtual int_type
overflow(int_type);
472 #ifndef FDSTREAM_USE_STD_N_READ_WRITE
484 virtual std::streamsize
xsputn(
const char_type*, std::streamsize);
523 virtual pos_type
seekoff(off_type off,
524 std::ios_base::seekdir way,
525 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
557 virtual pos_type
seekpos(pos_type p,
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];
910 static void swap_element(char_type&);
926 #ifndef FDSTREAM_USE_STD_N_READ_WRITE
938 virtual std::streamsize
xsgetn(char_type*, std::streamsize);
975 virtual pos_type
seekoff(off_type off,
976 std::ios_base::seekdir way,
977 std::ios_base::openmode m = std::ios_base::in | std::ios_base::out);
1009 virtual pos_type
seekpos(pos_type p,
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>
Input stream for unix file descriptors.
Definition: fdstream.h:1144
basic_fdinbuf< char32_t > u32fdinbuf
Input stream buffer for file descriptors for char32_t type.
Definition: fdstream.h:1393
Output stream buffer for unix file descriptors.
Definition: fdstream.h:428
basic_fdostream< char32_t > u32fdostream
Output stream for file descriptors for char32_t type.
Definition: fdstream.h:1416
void set_buffered(bool buffered)
Definition: fdstream.h:856
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:1370
bool can_seek() const
Definition: fdstream.h:1288
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:434
virtual int_type overflow(int_type)
basic_fdostream< wchar_t > wfdostream
Output stream for file descriptors for wchar_t type.
Definition: fdstream.h:1356
basic_fdistream< char32_t > u32fdistream
Input stream for file descriptors for char32_t type.
Definition: fdstream.h:1408
basic_fdostream & operator=(const basic_fdostream &)=delete
basic_fdistream(int fd, bool manage=true)
Definition: fdstream.h:1174
traits_type::int_type int_type
Definition: fdstream.h:433
void attach(int fd, bool manage=true)
Definition: fdstream.h:1216
basic_fdinbuf< char16_t > u16fdinbuf
Input stream buffer for file descriptors for char16_t type.
Definition: fdstream.h:1363
void attach_fd(int fd_, bool manage_=true)
basic_fdoutbuf< char > fdoutbuf
Output stream buffer for file descriptors for char type.
Definition: fdstream.h:1310
int get_fd() const
Definition: fdstream.h:651
traits_type::off_type off_type
Definition: fdstream.h:435
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:1326
void set_buffered(bool buffered)
basic_fdinbuf< char > fdinbuf
Input stream buffer for file descriptors for char type.
Definition: fdstream.h:1303
basic_fdinbuf< wchar_t > wfdinbuf
Input stream buffer for file descriptors for wchar_t type.
Definition: fdstream.h:1333
int filedesc() const
Definition: fdstream.h:1245
basic_fdistream< wchar_t > wfdistream
Input stream for file descriptors for wchar_t type.
Definition: fdstream.h:1348
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:1340
Input stream buffer for unix file descriptors.
Definition: fdstream.h:892
charT char_type
Definition: fdstream.h:895
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:899
traits_type::pos_type pos_type
Definition: fdstream.h:898
Definition: application.h:44
charT char_type
Definition: fdstream.h:431
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:1271
Output stream for unix file descriptors.
Definition: fdstream.h:710
Traits traits_type
Definition: fdstream.h:432
basic_fdistream< char16_t > u16fdistream
Input stream for file descriptors for char16_t type.
Definition: fdstream.h:1378
void close()
Definition: fdstream.h:1233
basic_fdinbuf(const basic_fdinbuf &)=delete
void close()
Definition: fdstream.h:816
bool can_seek() const
Definition: fdstream.h:873
basic_fdostream()
Definition: fdstream.h:763
void attach(int fd, bool manage=true)
Definition: fdstream.h:799
Traits traits_type
Definition: fdstream.h:896
void set_byteswap(bool swap)
basic_fdostream(int fd, bool manage=true)
Definition: fdstream.h:749
basic_fdostream< char16_t > u16fdostream
Output stream for file descriptors for char16_t type.
Definition: fdstream.h:1386
basic_fdistream< char > fdistream
Input stream for file descriptors for char type.
Definition: fdstream.h:1318
basic_fdistream()
Definition: fdstream.h:1188
int get_fd() const
Definition: fdstream.h:1087
basic_fdoutbuf< char32_t > u32fdoutbuf
Output stream buffer for file descriptors for char32_t type.
Definition: fdstream.h:1400
int filedesc() const
Definition: fdstream.h:828
#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:897
basic_fdistream & operator=(const basic_fdistream &)=delete