#include "utils.h" #include #include #include std::string to_utf8(std::wstring wide_string) { static std::wstring_convert> utf8_conv; return utf8_conv.to_bytes(wide_string); } std::wstring from_utf8(std::string string) { static std::wstring_convert> utf8_conv; return utf8_conv.from_bytes(string); } std::string get_path_relative_to_home(std::string path) { return std::string(std::getenv("HOME")) + "/" + path; } template bool vector_contains_element(const std::vector& vector, const T& to_find) { for (const T& element : vector) { if (element == to_find) return true; } return false; } //ужас template bool vector_contains_element(const std::vector& vector, const std::string& to_find);