Classes | |
| class | CmdNotFound |
| Thrown by sys::require_cmd when a command cannot be located on the system. More... | |
Functions | |
| std::optional< fs::path > | path_to_libmim () |
| Yields std::nullopt if an error occurred. | |
| std::string | exec (std::string cmd) |
Executes command cmd. | |
| std::string | find_cmd (std::string) |
| std::string | require_cmd (std::string_view name) |
Locates name on the system or throws CmdNotFound. | |
| int | system (std::string) |
| Wraps std::system and makes the return value usable. | |
| void | require_run (const std::string &cmd) |
Runs cmd via sys::system and throws if it exits with a non-zero status. | |
| int | run (std::string cmd, std::string args={}) |
Wraps sys::system and puts .exe at the back (Windows) and ./ at the front (otherwise) of cmd. | |
| std::string | escape (const std::filesystem::path &path) |
Returns the path as std::string and escapes all whitespaces with backslash. | |
| std::string mim::sys::escape | ( | const std::filesystem::path & | path | ) |
| std::string mim::sys::exec | ( | std::string | cmd | ) |
Executes command cmd.
Definition at line 83 of file sys.cpp.
Referenced by find_cmd().
| std::string mim::sys::find_cmd | ( | std::string | cmd | ) |
| std::optional< fs::path > mim::sys::path_to_libmim | ( | ) |
Yields std::nullopt if an error occurred.
The returned path is adjusted so <parent>/mim resolves to the default in-tree plugin directory when possible.
Definition at line 52 of file sys.cpp.
References mim_lib_anchor().
Referenced by mim::Driver::Driver().
| std::string mim::sys::require_cmd | ( | std::string_view | name | ) |
Locates name on the system or throws CmdNotFound.
Definition at line 101 of file sys.cpp.
References find_cmd().
| void mim::sys::require_run | ( | const std::string & | cmd | ) |
Runs cmd via sys::system and throws if it exits with a non-zero status.
Definition at line 113 of file sys.cpp.
References system().
| int mim::sys::run | ( | std::string | cmd, |
| std::string | args = {} ) |
Wraps sys::system and puts .exe at the back (Windows) and ./ at the front (otherwise) of cmd.
Definition at line 117 of file sys.cpp.
References system().
| int mim::sys::system | ( | std::string | cmd | ) |
Wraps std::system and makes the return value usable.
Definition at line 107 of file sys.cpp.
Referenced by require_run(), and run().