libsshpp v0.1.7
Modern C++17 wrapper for libssh
Loading...
Searching...
No Matches
sshpp::Exec Class Reference

#include <exec.hpp>

Public Member Functions

 Exec (Session &session)
 
Execenv (std::string_view name, std::string_view value)
 
Execpty (bool enable=true, std::string_view term="xterm-256color", PtySize size={})
 
Execstdin_data (std::string data)
 
Exectimeout (std::chrono::milliseconds t)
 
Execmax_output (std::size_t bytes)
 
Execmerge_stderr (bool v=true)
 
Execsink (OutputSink s)
 
Result< ExecResulttry_run (std::string_view command)
 
ExecResult run (std::string_view command)
 
Result< ExecResulttry_run (const std::vector< std::string > &argv)
 Builds an argv-style command with correct POSIX shell quoting.
 

Detailed Description

One-shot remote command execution: opens a channel, requests exec, pumps stdout/stderr without stalling on the interleaving hazard, waits for exit. See docs/design/05 ยง5.3.

Constructor & Destructor Documentation

◆ Exec()

sshpp::Exec::Exec ( Session session)
inlineexplicit

Member Function Documentation

◆ env()

SSHPP_INLINE Exec & sshpp::Exec::env ( std::string_view  name,
std::string_view  value 
)

◆ pty()

SSHPP_INLINE Exec & sshpp::Exec::pty ( bool  enable = true,
std::string_view  term = "xterm-256color",
PtySize  size = {} 
)

◆ stdin_data()

SSHPP_INLINE Exec & sshpp::Exec::stdin_data ( std::string  data)

◆ timeout()

Exec & sshpp::Exec::timeout ( std::chrono::milliseconds  t)
inline

◆ max_output()

Exec & sshpp::Exec::max_output ( std::size_t  bytes)
inline

◆ merge_stderr()

Exec & sshpp::Exec::merge_stderr ( bool  v = true)
inline

◆ sink()

Exec & sshpp::Exec::sink ( OutputSink  s)
inline

◆ try_run() [1/2]

SSHPP_INLINE Result< ExecResult > sshpp::Exec::try_run ( std::string_view  command)

◆ run()

SSHPP_INLINE ExecResult sshpp::Exec::run ( std::string_view  command)

◆ try_run() [2/2]

SSHPP_INLINE Result< ExecResult > sshpp::Exec::try_run ( const std::vector< std::string > &  argv)

Builds an argv-style command with correct POSIX shell quoting.


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