-inline std::string ExePath(void)
-{
- char buf[256];
- ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
- len = len > 0 ? len : 0;
- buf[len] = '\0';
- return std::string(buf);
-}
-
-inline std::string GetFileContents(const std::string &fn)
-{
- std::ifstream t(fn.c_str());
- return std::string((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>());