clang-tidy modernize
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h> // Para size_t
|
||||
|
||||
#include <array> // Para array
|
||||
#include <string> // Para string, basic_string
|
||||
#include <array> // Para array
|
||||
#include <cstddef> // Para size_t
|
||||
#include <string> // Para string, basic_string
|
||||
|
||||
#include "utils.h" // Para trim
|
||||
|
||||
@@ -23,13 +22,13 @@ class EnterName {
|
||||
void incIndex(); // Incrementa el índice del carácter en la lista
|
||||
void decIndex(); // Decrementa el índice del carácter en la lista
|
||||
|
||||
std::string getFinalName(); // Obtiene el nombre final introducido
|
||||
std::string getCurrentName() const { return trim(name_); } // Obtiene el nombre actual en proceso
|
||||
auto getFinalName() -> std::string; // Obtiene el nombre final introducido
|
||||
[[nodiscard]] auto getCurrentName() const -> std::string { return trim(name_); } // Obtiene el nombre actual en proceso
|
||||
|
||||
int getPosition() const { return position_; } // Posición actual del carácter editado
|
||||
bool getPositionOverflow() const { return position_overflow_; } // Indica si la posición excede el límite
|
||||
[[nodiscard]] auto getPosition() const -> int { return position_; } // Posición actual del carácter editado
|
||||
[[nodiscard]] auto getPositionOverflow() const -> bool { return position_overflow_; } // Indica si la posición excede el límite
|
||||
|
||||
private:
|
||||
private:
|
||||
std::string character_list_; // Lista de caracteres permitidos
|
||||
std::string name_; // Nombre en proceso
|
||||
size_t position_ = 0; // Índice del carácter que se edita
|
||||
@@ -38,6 +37,6 @@ class EnterName {
|
||||
|
||||
void updateNameFromCharacterIndex(); // Actualiza "name_" según "character_index_"
|
||||
void initCharacterIndex(const std::string &name); // Inicializa índices desde el nombre
|
||||
int findIndex(char character) const; // Busca el índice de un carácter en "character_list_"
|
||||
static std::string getRandomName(); // Devuelve un nombre al azar
|
||||
[[nodiscard]] auto findIndex(char character) const -> int; // Busca el índice de un carácter en "character_list_"
|
||||
static auto getRandomName() -> std::string; // Devuelve un nombre al azar
|
||||
};
|
||||
Reference in New Issue
Block a user