Service Menu: afegides opcions per als mandos
This commit is contained in:
@@ -383,4 +383,16 @@ auto getFileName(const std::string &path) -> std::string {
|
||||
auto getPath(const std::string &full_path) -> std::string {
|
||||
std::filesystem::path path(full_path);
|
||||
return path.parent_path().string();
|
||||
}
|
||||
|
||||
// Trunca un string y le añade puntos suspensivos
|
||||
auto truncateWithEllipsis(const std::string &input, size_t length) -> std::string {
|
||||
if (input.size() <= length) {
|
||||
return input;
|
||||
}
|
||||
if (length <= 3) {
|
||||
// Not enough space for any content plus ellipsis
|
||||
return std::string(length, '.');
|
||||
}
|
||||
return input.substr(0, length) + "...";
|
||||
}
|
||||
Reference in New Issue
Block a user