Pipe stream to or from a process. More...
#include <popen.hpp>
Public Member Functions | |
PStream (const char *cmd, const char *modes) | |
Construct a new PStream object. More... | |
PStream (const PStream &)=delete | |
PStream (PStream &&) | |
void | close () |
Close the stream. More... | |
void | open (const char *cmd, const char *modes) |
Open a new stream. More... | |
void | open (std::string_view cmd, std::string_view modes) |
bool | try_open (const char *cmd, const char *modes) |
Trt open a new stream. More... | |
bool | try_open (std::string_view cmd, std::string_view modes) |
bool | bad () |
Check the stream status. More... | |
bool | eof () |
Check the stream at eof. More... | |
PStream & | operator= (PStream &&) |
Assign from a lval stream. More... | |
FILE * | operator* () const noexcept |
operator bool () | |
Friends | |
PStream & | operator>> (PStream &, std::string &) |
Read a line to string. More... | |
PStream & | operator<< (PStream &, std::string_view) |
Write String to stream It w. More... | |
Pipe stream to or from a process.
|
inline |
Construct a new PStream object.
cmd | The commond line |
modes | The pipe mode |
|
inline |
Check the stream status.
|
inline |
Close the stream.
|
inline |
Check the stream at eof.
|
inline |
Open a new stream.
cmd | The command line |
modes | The pipe mode |
Assign from a lval stream.
|
inline |
Trt open a new stream.
cmd | The command line |
modes | The pipe mode |
Write String to stream It w.