mirror of
https://github.com/arun11299/cpp-subprocess.git
synced 2025-08-04 12:26:19 -04:00
Create Popen::communicate overload for std::string (#82)
* Create Popen::communicate overload for std::string * Create Popen::send overload for std::string
This commit is contained in:
parent
cbc9e82158
commit
1392c47cbb
@ -1288,6 +1288,9 @@ public:
|
||||
int send(const char* msg, size_t length)
|
||||
{ return stream_.send(msg, length); }
|
||||
|
||||
int send(const std::string& msg)
|
||||
{ return send(msg.c_str(), msg.size()); }
|
||||
|
||||
int send(const std::vector<char>& msg)
|
||||
{ return stream_.send(msg); }
|
||||
|
||||
@ -1298,6 +1301,11 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
std::pair<OutBuffer, ErrBuffer> communicate(const std::string& msg)
|
||||
{
|
||||
return communicate(msg.c_str(), msg.size());
|
||||
}
|
||||
|
||||
std::pair<OutBuffer, ErrBuffer> communicate(const std::vector<char>& msg)
|
||||
{
|
||||
auto res = stream_.communicate(msg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user