Pasaeta de cppcheck, ale

This commit is contained in:
2024-10-22 09:24:19 +02:00
parent 1d0c2e01a5
commit 5df85e1b1a
28 changed files with 164 additions and 194 deletions

View File

@@ -23,7 +23,6 @@ std::shared_ptr<TextFile> loadTextFile(const std::string &file_path)
}
// Abre el fichero para leer los valores
const std::string file_name = file_path.substr(file_path.find_last_of("\\/") + 1).c_str();
std::ifstream file(file_path);
if (file.is_open() && file.good())
@@ -56,15 +55,15 @@ std::shared_ptr<TextFile> loadTextFile(const std::string &file_path)
};
// Cierra el fichero
printWithDots("Text File : ", file_name, "[ LOADED ]");
printWithDots("Text File : ", getFileName(file_path), "[ LOADED ]");
file.close();
}
// El fichero no se puede abrir
else
{
std::cerr << "Error: Fichero no encontrado " << file_path << std::endl;
throw std::runtime_error("Fichero no encontrado: " + file_path);
std::cerr << "Error: Fichero no encontrado " << getFileName(file_path) << std::endl;
throw std::runtime_error("Fichero no encontrado: " + getFileName(file_path));
}
// Establece las coordenadas para cada caracter ascii de la cadena y su ancho