#include "utility.h" std::string Utility::truncate(std::string str, size_t width, bool show_ellipsis) { if (str.length() > width) if (show_ellipsis) return str.substr(0, width) + "..."; else return str.substr(0, width); return str; }