millorat printWithDots() i Resource::List per a calcular el nom de fitxer mes llarg correctament
This commit is contained in:
@@ -320,11 +320,11 @@ auto getPath(const std::string& full_path) -> std::string {
|
||||
}
|
||||
|
||||
// Imprime por pantalla una linea de texto de tamaño fijo rellena con puntos
|
||||
void printWithDots(const std::string& text1, const std::string& text2, const std::string& text3) {
|
||||
void printWithDots(const std::string& text1, const std::string& text2, const std::string& text3, size_t width) {
|
||||
std::cout.setf(std::ios::left, std::ios::adjustfield);
|
||||
std::cout << text1;
|
||||
|
||||
std::cout.width(50 - text1.length() - text3.length());
|
||||
std::cout.width(static_cast<std::streamsize>(width - text1.length() - text3.length()));
|
||||
std::cout.fill('.');
|
||||
std::cout << text2;
|
||||
|
||||
|
||||
@@ -78,4 +78,4 @@ auto getPath(const std::string& full_path) -> std::string; // Extrae directorio
|
||||
void fillTextureWithColor(SDL_Renderer* renderer, SDL_Texture* texture, Uint8 r, Uint8 g, Uint8 b, Uint8 a); // Rellena textura
|
||||
|
||||
// OUTPUT Y UTILIDADES DE CONSOLA
|
||||
void printWithDots(const std::string& text1, const std::string& text2, const std::string& text3); // Imprime línea con puntos
|
||||
void printWithDots(const std::string& text1, const std::string& text2, const std::string& text3, size_t width); // Imprime línea con puntos
|
||||
Reference in New Issue
Block a user