ui-utilcpp  1.10.0
Data Structures | Functions
UI::Util::Sys Namespace Reference

Namespace for system/library calls. More...

Data Structures

class  Exception
 Use this exception class if you want to catch failures on system/library calls. More...
 

Functions

uid_t fsidFromProcfs (pid_t const pid, std::string const &lineId)
 

Detailed Description

Namespace for system/library calls.

Purpose

If you use a call that matches any of the points above, please include a wrapper here.

Example usage

Call any of the wrapper somewhere in your code:

...
myStr = getPath();
UI::Util::Sys::remove(myStr);
// as usual, assume success
...

Somewhere in your context-specific exception handler:

...
catch (UI::Util::Sys::Exception const & e)
{
  std::cerr << "System error        : " << e.what() << std::endl;
  std::cerr << "Errno error code was: " << e.getCode() << std::endl;
  std::cerr << "Exception debug     : " << e.getDebug() << std::endl;
}
...

How to add wrappers