3#ifndef PL_INCLUDING_BASICS_H
4# error "Please don't include FormatStringArgs.h directly, but instead include Foundation/Basics.h"
15 inline explicit plArgI(plInt64 value, plUInt8 uiWidth = 1,
bool bPadWithZeros =
false, plUInt8 uiBase = 10)
18 , m_bPadWithZeros(bPadWithZeros)
31 inline explicit plArgU(plUInt64 value, plUInt8 uiWidth = 1,
bool bPadWithZeros =
false, plUInt8 uiBase = 10,
bool bUpperCase =
false)
34 , m_bPadWithZeros(bPadWithZeros)
35 , m_bUpperCase(bUpperCase)
49 inline explicit plArgF(
double value, plInt8 iPrecision = -1,
bool bScientific =
false, plUInt8 uiWidth = 1,
bool bPadWithZeros =
false)
52 , m_bPadWithZeros(bPadWithZeros)
53 , m_bScientific(bScientific)
54 , m_iPrecision(iPrecision)
67 inline explicit plArgC(
char value)
77 inline explicit plArgP(
const void* value)
96 inline plArgHumanReadable(
const double value,
const plUInt64 uiBase,
const char*
const*
const pSuffixes, plUInt32 uiSuffixCount)
99 , m_Suffixes(pSuffixes)
100 , m_SuffixCount(uiSuffixCount)
104 inline plArgHumanReadable(
const plInt64 value,
const plUInt64 uiBase,
const char*
const*
const pSuffixes, plUInt32 uiSuffixCount)
110 :
plArgHumanReadable(value, 1000u, m_DefaultSuffixes, PL_ARRAY_SIZE(m_DefaultSuffixes))
115 :
plArgHumanReadable(
static_cast<double>(value), 1000u, m_DefaultSuffixes, PL_ARRAY_SIZE(m_DefaultSuffixes))
119 const double m_Value;
120 const plUInt64 m_Base;
121 const char*
const*
const m_Suffixes;
122 const char*
const m_DefaultSuffixes[6] = {
"",
"K",
"M",
"G",
"T",
"P"};
123 const plUInt32 m_SuffixCount;
129 :
plArgHumanReadable(
static_cast<double>(value), 1024u, m_ByteSuffixes, PL_ARRAY_SIZE(m_ByteSuffixes))
133 const char*
const m_ByteSuffixes[6] = {
"B",
"KB",
"MB",
"GB",
"TB",
"PB"};
142 : m_ErrorCode(uiErrorCode)
146 plUInt32 m_ErrorCode;
151#if PL_ENABLED(PL_PLATFORM_LINUX) || PL_ENABLED(PL_PLATFORM_ANDROID)
158 inline explicit plArgErrno(plInt32 iErrno)
165PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
const plArgErrno& arg);
179 : m_sSensitiveInfo(sSensitiveInfo)
180 , m_szContext(szContext)
185 const char* m_szContext;
188 PL_FOUNDATION_DLL
static BuildStringCallback s_BuildStringCB;
194PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
const plArgI& arg);
195PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength, plInt64 iArg);
196PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength, plInt32 iArg);
197PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
const plArgU& arg);
198PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength, plUInt64 uiArg);
199PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength, plUInt32 uiArg);
200PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
const plArgF& arg);
201PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
double fArg);
202PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
bool bArg);
203PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
const char* szArg);
204PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
const wchar_t* pArg);
207PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
const plArgC& arg);
208PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
const plArgP& arg);
211PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
const plAngle& arg);
214PL_FOUNDATION_DLL
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
const plTime& arg);
218#if PL_ENABLED(PL_COMPILER_GCC) || PL_ENABLED(PL_COMPILER_CLANG)
222PL_ALWAYS_INLINE
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
long int iArg)
224 return BuildString(szTmp, uiLength,
static_cast<plInt64
>(iArg));
227PL_ALWAYS_INLINE
plStringView BuildString(
char* szTmp, plUInt32 uiLength,
unsigned long int uiArg)
229 return BuildString(szTmp, uiLength,
static_cast<plUInt64
>(uiArg));
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
A class which can be used to represent rational numbers by stating their numerator and denominator.
Definition Rational.h:13
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
Definition FormatStringArgs.h:66
Converts a windows HRESULT into an error code and a human-readable error message. Pass in GetLastErro...
Definition FormatStringArgs.h:140
Definition FormatStringArgs.h:48
Definition FormatStringArgs.h:127
Formats a given number such that it will be in format [0, base){suffix} with suffix representing a po...
Definition FormatStringArgs.h:95
Definition FormatStringArgs.h:14
Definition FormatStringArgs.h:76
Wraps a string that may contain sensitive information, such as user file paths.
Definition FormatStringArgs.h:177
static PL_FOUNDATION_DLL plStringView BuildString_SensitiveUserData_Hash(char *szTmp, plUInt32 uiLength, const plArgSensitive &arg)
Set s_BuildStringCB to this function to enable scrambling of sensitive data.
Definition FormatString.cpp:368
Definition FormatStringArgs.h:30
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12