Player12
An open source football management simulator
Loading...
Searching...
No Matches
TextEncoding Namespace Reference

Functions

template<typename T >
requires std::is_integral_v<T>
void appendInt (std::string &out, T value)
 
void appendShortest (std::string &out, float value)
 
void appendFixed (std::string &out, float value, int decimals)
 

Detailed Description

Allocation-free text encoders for the save repositories (CSV and JSON columns written for every row on every save).

Function Documentation

◆ appendFixed()

void TextEncoding::appendFixed ( std::string &  out,
float  value,
int  decimals 
)
inline

Appends value with decimals (0-4) fixed decimals, rounded half away from zero (like "{:.Nf}" except for exact binary ties).

◆ appendInt()

template<typename T >
requires std::is_integral_v<T>
void TextEncoding::appendInt ( std::string &  out,
T  value 
)
inline

Appends an integer.

◆ appendShortest()

void TextEncoding::appendShortest ( std::string &  out,
float  value 
)
inline

Appends a float in its shortest form that parses back to the same float.