Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions
ext::ofdstream Class Reference

A class implementing an output stream interface, with destination specified by file descriptor. More...

#include <fdstream.hpp>

Inheritance diagram for ext::ofdstream:
[legend]
Collaboration diagram for ext::ofdstream:
[legend]

Public Member Functions

 ofdstream (int fd, int fallback_fd=FAIL_FD)
 A constructor of the output file descriptor stream with specified prefered and fallback file descriptors. More...
 
 ~ofdstream () override
 A desctructor of the output file descriptor. More...
 
bool is_redirected () const
 Getter of the redirected flag informing whether prefered or fallback file descriptor is used. More...
 
- Public Member Functions inherited from ext::ostream
 ostream (std::basic_streambuf< char > *sb)
 
virtual ~ostream () noexcept
 
ostreamput (char ch)
 
ostreamwrite (const char *s, std::streamsize count)
 
std::streampos tellp ()
 
ostreamseekp (std::streampos pos)
 
ostreamseekp (std::streamoff off, std::ios_base::seekdir dir)
 
ostreamflush ()
 
std::streambuf * rdbuf () const
 
std::streambuf * rdbuf (std::streambuf *buf)
 
void setstate (std::ios_base::iostate state)
 
void clear (std::ios_base::iostate state=std::ios_base::goodbit)
 

Additional Inherited Members

- Protected Member Functions inherited from ext::ostream
 ostream (ostream &&rhs) noexcept
 
ostreamoperator= (ostream &&rhs) noexcept
 
 operator std::ostream & () &
 
 operator const std::ostream & () const &
 

Detailed Description

A class implementing an output stream interface, with destination specified by file descriptor.

Constructor & Destructor Documentation

◆ ofdstream()

ext::ofdstream::ofdstream ( int  fd,
int  fallback_fd = FAIL_FD 
)
explicit

A constructor of the output file descriptor stream with specified prefered and fallback file descriptors.

Parameters
preferedFDthe prefered destination file descriptor
fallbackFDthe fallback destination file descriptor
Here is the call graph for this function:

◆ ~ofdstream()

ext::ofdstream::~ofdstream ( )
overridedefault

A desctructor of the output file descriptor.

Member Function Documentation

◆ is_redirected()

bool ext::ofdstream::is_redirected ( ) const

Getter of the redirected flag informing whether prefered or fallback file descriptor is used.

Returns
true if the prefered file descriptor is used or false if the fallback is used
Here is the call graph for this function:

The documentation for this class was generated from the following files: