37 std::cout << __FILE__ << " " << __LINE__ << ": " << msg << std::endl
45#define __METHOD_NAME__ details::methodName(__PRETTY_FUNCTION__)
58inline std::string
methodName(
const std::string &pretty_function)
60 size_t colons = pretty_function.find(
"::");
61 size_t begin = pretty_function.substr(0, colons).rfind(
" ") + 1;
62 size_t end = pretty_function.rfind(
"(") - begin;
64 return pretty_function.substr(begin, end) +
"()";
107bool mkpath(std::string path,
int mode = 0777);
115std::string
dirname(
const std::string &path);
std::string methodName(const std::string &pretty_function)
Takes in the PRETTY_FUNCTION string and removes the return type.
bool mkpath(std::string path, int mode=0777)
Make path given.
std::string scientific_format(double d, int width=20, int prec=10)
Turns a double into a string written in scientific format.
std::string dirname(const std::string &path)
Get the directory name of the path.