28 lines
697 B
C++
28 lines
697 B
C++
#include <iomanip>
|
|
#include <sstream>
|
|
#include <system_error>
|
|
|
|
#include "misc.h"
|
|
|
|
std::string quote(const std::string& str) {
|
|
std::stringstream ss;
|
|
ss << std::quoted(str);
|
|
return ss.str();
|
|
}
|
|
|
|
std::system_error make_system_error(int err, const char* what) {
|
|
return std::system_error(err, std::generic_category(), what);
|
|
}
|
|
|
|
std::system_error make_system_error(int err, std::string what) {
|
|
return std::system_error(err, std::generic_category(), std::move(what));
|
|
}
|
|
|
|
std::system_error make_system_error(const char* what) {
|
|
return make_system_error(errno, what);
|
|
}
|
|
|
|
std::system_error make_system_error(std::string what) {
|
|
return make_system_error(errno, std::move(what));
|
|
}
|