clang-tidy modernize
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h> // Para size_t
|
||||
|
||||
#include <cstddef> // Para size_t
|
||||
#include <memory> // Para unique_ptr
|
||||
#include <string> // Para basic_string, string
|
||||
#include <utility> // Para pair
|
||||
@@ -34,7 +33,7 @@ class ServiceMenu {
|
||||
|
||||
static void init();
|
||||
static void destroy();
|
||||
static ServiceMenu *get();
|
||||
static auto get() -> ServiceMenu *;
|
||||
|
||||
void toggle();
|
||||
void render();
|
||||
@@ -49,17 +48,17 @@ class ServiceMenu {
|
||||
void moveBack();
|
||||
|
||||
// --- Getters para que el Renderer pueda leer el estado ---
|
||||
bool isEnabled() const { return enabled_; }
|
||||
const std::string &getTitle() const { return title_; }
|
||||
SettingsGroup getCurrentGroup() const { return current_settings_group_; }
|
||||
GroupAlignment getCurrentGroupAlignment() const;
|
||||
const std::vector<MenuOption *> &getDisplayOptions() const { return display_options_; }
|
||||
const std::vector<std::unique_ptr<MenuOption>> &getAllOptions() const { return options_; }
|
||||
size_t getSelectedIndex() const { return selected_; }
|
||||
const std::vector<std::pair<std::string, std::string>> &getOptionPairs() const { return option_pairs_; }
|
||||
size_t countOptionsInGroup(SettingsGroup group) const;
|
||||
[[nodiscard]] auto isEnabled() const -> bool { return enabled_; }
|
||||
[[nodiscard]] auto getTitle() const -> const std::string & { return title_; }
|
||||
[[nodiscard]] auto getCurrentGroup() const -> SettingsGroup { return current_settings_group_; }
|
||||
[[nodiscard]] auto getCurrentGroupAlignment() const -> GroupAlignment;
|
||||
[[nodiscard]] auto getDisplayOptions() const -> const std::vector<MenuOption *> & { return display_options_; }
|
||||
[[nodiscard]] auto getAllOptions() const -> const std::vector<std::unique_ptr<MenuOption>> & { return options_; }
|
||||
[[nodiscard]] auto getSelectedIndex() const -> size_t { return selected_; }
|
||||
[[nodiscard]] auto getOptionPairs() const -> const std::vector<std::pair<std::string, std::string>> & { return option_pairs_; }
|
||||
[[nodiscard]] auto countOptionsInGroup(SettingsGroup group) const -> size_t;
|
||||
|
||||
private:
|
||||
private:
|
||||
// --- Lógica de estado del menú (Modelo) ---
|
||||
bool enabled_ = false;
|
||||
std::vector<std::unique_ptr<MenuOption>> options_;
|
||||
@@ -88,19 +87,19 @@ class ServiceMenu {
|
||||
void applyVideoSettings();
|
||||
void applyAudioSettings();
|
||||
void applySettingsSettings();
|
||||
MenuOption *getOptionByCaption(const std::string &caption) const;
|
||||
[[nodiscard]] auto getOptionByCaption(const std::string &caption) const -> MenuOption *;
|
||||
void adjustListValues();
|
||||
void playMoveSound();
|
||||
void playAdjustSound();
|
||||
void playSelectSound();
|
||||
void playBackSound();
|
||||
std::string settingsGroupToString(SettingsGroup group) const;
|
||||
[[nodiscard]] auto settingsGroupToString(SettingsGroup group) const -> std::string;
|
||||
void setHiddenOptions();
|
||||
|
||||
// --- Singleton ---
|
||||
ServiceMenu();
|
||||
~ServiceMenu() = default;
|
||||
ServiceMenu(const ServiceMenu &) = delete;
|
||||
ServiceMenu &operator=(const ServiceMenu &) = delete;
|
||||
auto operator=(const ServiceMenu &) -> ServiceMenu & = delete;
|
||||
static ServiceMenu *instance;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user