VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
Validation.hpp File Reference
#include <VoltMod/Core/Log.hpp>
#include <VoltMod/Core/Text/Strings.hpp>
#include <concepts>
#include <cstddef>
#include <format>
#include <optional>
#include <string>
#include <string_view>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  VoltMod
 
namespace  VoltMod::Validation
 

Functions

void VoltMod::Validation::NormalizeTag (std::string &value, std::size_t maxLen, std::string_view fallback, std::string_view what)
 Declarative helpers for post-load config validation: skip bad entries with a warning instead of failing the whole load, and fall back to sane defaults.
 
template<class T >
void VoltMod::Validation::FilterValid (std::vector< T > &items, std::invocable< const T &, std::size_t > auto &&validate, std::string_view what)
 
template<class T >
bool VoltMod::Validation::FallbackIfEmpty (std::vector< T > &items, const std::vector< T > &defaults, std::string_view what)
 
template<class T >
bool VoltMod::Validation::FallbackIfEmpty (std::vector< T > &items, std::invocable auto &&makeDefaults, std::string_view what)
 
std::vector< int > VoltMod::Validation::ParseDurations (const std::vector< std::string > &entries, const std::vector< std::string > &defaults, std::string_view what)