7f6af6dd00
Cambios aplicados:
- [[nodiscard]] añadido a funciones que retornan valores
- .starts_with() en lugar de .find() == 0
- Inicializadores designados {.x=0, .y=0}
- auto en castings obvios
- = default para constructores triviales
- Funciones deleted movidas a public
- std::numbers::pi_v<float> (C++20)
Checks excluidos:
- use-trailing-return-type: Estilo controversial
- avoid-c-arrays: Arrays C aceptables en ciertos contextos
27 lines
665 B
C++
27 lines
665 B
C++
// resource_helper.hpp - Funcions d'ajuda per gestió de recursos
|
|
// © 2025 Port a C++20 amb SDL3
|
|
// API simplificada i normalització de rutes
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace Resource::Helper {
|
|
|
|
// Inicialització del sistema
|
|
bool initializeResourceSystem(const std::string& pack_file, bool fallback);
|
|
|
|
// Càrrega de fitxers
|
|
std::vector<uint8_t> loadFile(const std::string& filepath);
|
|
bool fileExists(const std::string& filepath);
|
|
|
|
// Normalització de rutes
|
|
std::string getPackPath(const std::string& asset_path);
|
|
std::string normalizePath(const std::string& path);
|
|
|
|
// Estat
|
|
bool isPackLoaded();
|
|
|
|
} // namespace Resource::Helper
|