#ifndef INCLUDED_BOBCAT_REDIRECTOR_
#define INCLUDED_BOBCAT_REDIRECTOR_

#include <bobcat/exception>

namespace FBB
{

class Redirector
{
    int d_fd;

    public:
        enum StandardFilenos
        {
            STDIN = 0,
            STDOUT,
            STDERR
        };

        explicit Redirector(int fd);                            // 1.f

        void accessVia(int alternateFd) const;                  // .f
        void swallow(int alternateFd) const;
        void through(int alternateFd) const;
};

inline Redirector::Redirector(int fd)
:
    d_fd(fd)
{}
inline void Redirector::accessVia(int alternateFd) const
{
    swallow(alternateFd);
}

} // FBB

#endif
