MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::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 mim::sys::exec ( std::string cmd)

Executes command cmd.

Returns
the output as string.

Definition at line 55 of file sys.cpp.

References mim::error().

Referenced by find_cmd().

◆ find_cmd()

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

Definition at line 64 of file sys.cpp.

References exec(), and MIM_WHICH.

Referenced by main().

◆ path_to_curr_exe()

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

Yields std::nullopt if an error occurred.

Definition at line 27 of file sys.cpp.

Referenced by mim::Driver::Driver().

◆ run()

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

References system().

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

◆ system()

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

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

Definition at line 70 of file sys.cpp.

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