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

A class determining the used file descriptor from prefered (if available) and fallback file descriptor. More...

#include <fdstream.hpp>

Public Member Functions

 fdaccessor (int, int)
 Constrcutor of the class determining the resulting used descriptor. More...
 
int get_fd () const
 Getter of the chosen file descriptor, either the prefered, or fallback one. More...
 
bool is_redirected () const
 Getter of the redirected flag informing whether prefered or fallback file descriptor is used. More...
 

Detailed Description

A class determining the used file descriptor from prefered (if available) and fallback file descriptor.

The prefered descriptor is used if the descriptor of the given number is available in the runtime.

Constructor & Destructor Documentation

◆ fdaccessor()

ext::fdaccessor::fdaccessor ( int  new_fd,
int  fallback_fd 
)
explicit

Constrcutor of the class determining the resulting used descriptor.

Member Function Documentation

◆ get_fd()

int ext::fdaccessor::get_fd ( ) const

Getter of the chosen file descriptor, either the prefered, or fallback one.

Returns
the chosen file descriptor.
Here is the caller graph for this function:

◆ is_redirected()

bool ext::fdaccessor::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 caller graph for this function:

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