Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
thorin::sys Namespace Reference

Functions

std::optional< fs::path > path_to_curr_exe ()
 Yields std::nullopt if an error occurred.
 
std::string exec (std::string cmd)
 Executes command cmd.
 
std::string find_cmd (std::string)
 
int system (std::string)
 Wraps std::system and makes the return value usable.
 
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.
 

Function Documentation

◆ exec()

std::string thorin::sys::exec ( std::string  cmd)

Executes command cmd.

Returns
the output as string.

Definition at line 55 of file sys.cpp.

References thorin::error().

Referenced by find_cmd().

◆ find_cmd()

std::string thorin::sys::find_cmd ( std::string  cmd)

Definition at line 64 of file sys.cpp.

References exec(), and THORIN_WHICH.

Referenced by main().

◆ path_to_curr_exe()

std::optional< fs::path > thorin::sys::path_to_curr_exe ( )

Yields std::nullopt if an error occurred.

Definition at line 27 of file sys.cpp.

Referenced by thorin::Driver::Driver().

◆ run()

int thorin::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 76 of file sys.cpp.

References system().

Referenced by thorin::ll::compile_and_run().

◆ system()

int thorin::sys::system ( std::string  cmd)

Wraps std::system and makes the return value usable.

Definition at line 70 of file sys.cpp.

Referenced by thorin::ll::compile(), and run().