|
Android-cuttlefish cvd tool
|
#include <command.h>

Public Types | |
| enum class | StdIoChannel { kStdIn = 0 , kStdOut = 1 , kStdErr = 2 } |
Public Member Functions | |
| Command (std::string executable, SubprocessStopper stopper=KillSubprocess) | |
| Command (Command &&)=default | |
| Command (const Command &)=delete | |
| Command & | operator= (const Command &)=delete |
| ~Command () | |
| const std::string & | Executable () const |
| Command & | SetExecutable (std::string executable) & |
| Command | SetExecutable (std::string executable) && |
| Command & | SetName (std::string name) & |
| Command | SetName (std::string name) && |
| Command & | SetExecutableAndName (std::string name) & |
| Command | SetExecutableAndName (std::string name) && |
| Command & | SetStopper (SubprocessStopper stopper) & |
| Command | SetStopper (SubprocessStopper stopper) && |
| Command & | SetEnvironment (std::vector< std::string > env) & |
| Command | SetEnvironment (std::vector< std::string > env) && |
| Command & | AddEnvironmentVariable (std::string_view env_var, std::string_view value) & |
| Command | AddEnvironmentVariable (std::string_view env_var, std::string_view value) && |
| Command & | UnsetFromEnvironment (std::string_view env_var) & |
| Command | UnsetFromEnvironment (std::string_view env_var) && |
| template<typename... Args> | |
| Command & | AddParameter (Args &&... args) & |
| template<typename... Args> | |
| Command | AddParameter (Args &&... args) && |
| Command & | AddParameter (std::string arg) & |
| Command | AddParameter (std::string arg) && |
| template<typename... Args> | |
| Command & | AppendToLastParameter (Args... args) & |
| template<typename... Args> | |
| Command | AppendToLastParameter (Args... args) && |
| Command & | RedirectStdIO (StdIoChannel channel, SharedFD shared_fd) & |
| Command | RedirectStdIO (StdIoChannel channel, SharedFD shared_fd) && |
| Command & | RedirectStdIO (StdIoChannel subprocess_channel, StdIoChannel parent_channel) & |
| Command | RedirectStdIO (StdIoChannel subprocess_channel, StdIoChannel parent_channel) && |
| Command & | SetWorkingDirectory (const std::string &path) & |
| Command | SetWorkingDirectory (const std::string &path) && |
| Command & | SetWorkingDirectory (SharedFD dirfd) & |
| Command | SetWorkingDirectory (SharedFD dirfd) && |
| Command & | AddPrerequisite (const std::function< Result< void >()> &prerequisite) & |
| Command | AddPrerequisite (const std::function< Result< void >()> &prerequisite) && |
| Subprocess | Start (SubprocessOptions options=SubprocessOptions()) const |
| std::string | GetShortName () const |
| std::string | ToString () const |
| std::string | AsBashScript (const std::string &redirected_stdio_path="") const |
Private Member Functions | |
| template<typename T > | |
| void | BuildParameter (std::stringstream *stream, T t) |
| void | BuildParameter (std::stringstream *stream, SharedFD shared_fd) |
| void | BuildParameter (std::stringstream *stream, Fd fd) |
| void | BuildParameter (std::stringstream *stream, bool arg) |
| template<typename T , typename... Args> | |
| void | BuildParameter (std::stringstream *stream, T &&t, Args &&... args) |
Private Attributes | |
| std::optional< std::string > | executable_ |
| std::vector< std::string > | command_ |
| std::vector< std::function< Result< void >()> > | prerequisites_ |
| std::map< SharedFD, int > | inherited_fds_ {} |
| std::map< StdIoChannel, int > | redirects_ {} |
| std::vector< std::string > | env_ {} |
| SubprocessStopper | subprocess_stopper_ |
| SharedFD | working_directory_ |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const Command &command) |
|
strong |
| cuttlefish::Command::Command | ( | std::string | executable, |
| SubprocessStopper | stopper = KillSubprocess |
||
| ) |
|
default |
|
delete |
| cuttlefish::Command::~Command | ( | ) |
| Command & cuttlefish::Command::AddEnvironmentVariable | ( | std::string_view | env_var, |
| std::string_view | value | ||
| ) | & |
| Command cuttlefish::Command::AddEnvironmentVariable | ( | std::string_view | env_var, |
| std::string_view | value | ||
| ) | && |
|
inline |
|
inline |
| Command & cuttlefish::Command::AddParameter | ( | std::string | arg | ) | & |
| Command cuttlefish::Command::AddParameter | ( | std::string | arg | ) | && |
| Command & cuttlefish::Command::AddPrerequisite | ( | const std::function< Result< void >()> & | prerequisite | ) | & |
| Command cuttlefish::Command::AddPrerequisite | ( | const std::function< Result< void >()> & | prerequisite | ) | && |
|
inline |
|
inline |
| std::string cuttlefish::Command::AsBashScript | ( | const std::string & | redirected_stdio_path = "" | ) | const |
|
private |
|
private |
|
private |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inline |
| Command & cuttlefish::Command::RedirectStdIO | ( | Command::StdIoChannel | channel, |
| SharedFD | shared_fd | ||
| ) | & |
| Command cuttlefish::Command::RedirectStdIO | ( | Command::StdIoChannel | channel, |
| SharedFD | shared_fd | ||
| ) | && |
| Command & cuttlefish::Command::RedirectStdIO | ( | Command::StdIoChannel | subprocess_channel, |
| Command::StdIoChannel | parent_channel | ||
| ) | & |
| Command cuttlefish::Command::RedirectStdIO | ( | Command::StdIoChannel | subprocess_channel, |
| Command::StdIoChannel | parent_channel | ||
| ) | && |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| Command & cuttlefish::Command::SetWorkingDirectory | ( | const std::string & | path | ) | & |
| Command cuttlefish::Command::SetWorkingDirectory | ( | const std::string & | path | ) | && |
| Subprocess cuttlefish::Command::Start | ( | SubprocessOptions | options = SubprocessOptions() | ) | const |
| std::string cuttlefish::Command::ToString | ( | ) | const |
| Command & cuttlefish::Command::UnsetFromEnvironment | ( | std::string_view | env_var | ) | & |
| Command cuttlefish::Command::UnsetFromEnvironment | ( | std::string_view | env_var | ) | && |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |