|
FE 0.13.1
Header-only C++ frontend library
|
Classes | |
| class | CmdNotFound |
| Thrown by sys::require_cmd when a command cannot be located on the system. More... | |
Functions | |
| std::optional< std::filesystem::path > | path_to_lib (const void *addr) |
Path of the executable or dynamic library that contains addr. | |
| std::string | exec (std::string cmd) |
Executes command cmd. | |
| std::string | find_cmd (std::string cmd) |
Locates cmd via sys::which; the resulting path may not exist. | |
| std::string | require_cmd (std::string_view name) |
Locates name on the system or throws CmdNotFound. | |
| int | system (std::string cmd) |
| 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. | |
Variables | |
| static constexpr auto | which |
| Name of the command that locates an executable on this platform. | |
| std::string fe::sys::escape | ( | const std::filesystem::path & | path | ) |
| std::string fe::sys::exec | ( | std::string | cmd | ) |
| std::string fe::sys::find_cmd | ( | std::string | cmd | ) |
Locates cmd via sys::which; the resulting path may not exist.
References find_cmd().
Referenced by find_cmd().
| std::optional< std::filesystem::path > fe::sys::path_to_lib | ( | const void * | addr | ) |
Path of the executable or dynamic library that contains addr.
Pass the address of a function of your own to find out where you have been loaded from.
References path_to_lib().
Referenced by path_to_lib().
| std::string fe::sys::require_cmd | ( | std::string_view | name | ) |
Locates name on the system or throws CmdNotFound.
References require_cmd().
Referenced by require_cmd().
| void fe::sys::require_run | ( | const std::string & | cmd | ) |
Runs cmd via sys::system and throws if it exits with a non-zero status.
References require_run().
Referenced by require_run().
| int fe::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.
References run().
Referenced by run().
| int fe::sys::system | ( | std::string | cmd | ) |