OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::RedirectStd Class Reference

#include <redir.hpp>

Inheritance diagram for openvpn::RedirectStd:
[legend]
Collaboration diagram for openvpn::RedirectStd:
[legend]

Public Member Functions

 RedirectStd (const std::string &in_fn, const std::string &out_fn, const int out_flags=FLAGS_OVERWRITE, const mode_t out_mode=MODE_ALL, const bool combine_out_err_arg=true)
 
- Public Member Functions inherited from openvpn::RedirectStdFD
void redirect () noexcept override
 
void close () override
 
- Public Member Functions inherited from openvpn::RedirectBase
 OPENVPN_EXCEPTION (redirect_std_err)
 
virtual ~RedirectBase ()=default
 

Static Public Attributes

static constexpr int FLAGS_OVERWRITE = O_CREAT | O_WRONLY | O_TRUNC
 
static constexpr int FLAGS_APPEND = O_CREAT | O_WRONLY | O_APPEND
 
static constexpr int FLAGS_MUST_NOT_EXIST = O_CREAT | O_WRONLY | O_EXCL
 
static constexpr mode_t MODE_ALL = 0777
 
static constexpr mode_t MODE_USER_GROUP = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP
 
static constexpr mode_t MODE_USER = S_IRUSR | S_IWUSR
 

Protected Member Functions

 RedirectStd ()
 
void open_input (const std::string &fn)
 
void open_output (const std::string &fn, const int flags, const mode_t mode)
 

Additional Inherited Members

- Public Attributes inherited from openvpn::RedirectStdFD
ScopedFD in
 
ScopedFD out
 
ScopedFD err
 
bool combine_out_err = false
 

Detailed Description

Definition at line 115 of file redir.hpp.

Constructor & Destructor Documentation

◆ RedirectStd() [1/2]

openvpn::RedirectStd::RedirectStd ( const std::string &  in_fn,
const std::string &  out_fn,
const int  out_flags = FLAGS_OVERWRITE,
const mode_t  out_mode = MODE_ALL,
const bool  combine_out_err_arg = true 
)
inline

Definition at line 128 of file redir.hpp.

◆ RedirectStd() [2/2]

openvpn::RedirectStd::RedirectStd ( )
inlineprotected

Definition at line 141 of file redir.hpp.

Member Function Documentation

◆ open_input()

void openvpn::RedirectStd::open_input ( const std::string &  fn)
inlineprotected

Definition at line 145 of file redir.hpp.

Here is the caller graph for this function:

◆ open_output()

void openvpn::RedirectStd::open_output ( const std::string &  fn,
const int  flags,
const mode_t  mode 
)
inlineprotected

Definition at line 156 of file redir.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ FLAGS_APPEND

constexpr int openvpn::RedirectStd::FLAGS_APPEND = O_CREAT | O_WRONLY | O_APPEND
staticconstexpr

Definition at line 120 of file redir.hpp.

◆ FLAGS_MUST_NOT_EXIST

constexpr int openvpn::RedirectStd::FLAGS_MUST_NOT_EXIST = O_CREAT | O_WRONLY | O_EXCL
staticconstexpr

Definition at line 121 of file redir.hpp.

◆ FLAGS_OVERWRITE

constexpr int openvpn::RedirectStd::FLAGS_OVERWRITE = O_CREAT | O_WRONLY | O_TRUNC
staticconstexpr

Definition at line 119 of file redir.hpp.

◆ MODE_ALL

constexpr mode_t openvpn::RedirectStd::MODE_ALL = 0777
staticconstexpr

Definition at line 124 of file redir.hpp.

◆ MODE_USER

constexpr mode_t openvpn::RedirectStd::MODE_USER = S_IRUSR | S_IWUSR
staticconstexpr

Definition at line 126 of file redir.hpp.

◆ MODE_USER_GROUP

constexpr mode_t openvpn::RedirectStd::MODE_USER_GROUP = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP
staticconstexpr

Definition at line 125 of file redir.hpp.


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