jaulib v1.4.1
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
jau::unsafe Namespace Reference

Functions

template<typename... Args>
constexpr std::string format_string (const std::string_view format, const Args &...args)
 Returns a (non-truncated) string according to snprintf() formatting rules using an initially string length of 1023 w/o EOS and variable number of arguments following the format argument.
 
template<typename... Args>
constexpr std::string format_string_h (const std::size_t strLenHint, const std::string_view format, const Args &...args)
 Returns a (non-truncated) string according to snprintf() formatting rules and variable number of arguments following the format argument.
 
template<typename... Args>
constexpr std::string format_string_n (const std::size_t maxStrLen, const std::string_view &format, const Args &...args)
 Returns a (potentially truncated) string according to snprintf() formatting rules and variable number of arguments following the format argument.
 

Function Documentation

◆ format_string_n()

template<typename... Args>
std::string jau::unsafe::format_string_n ( const std::size_t maxStrLen,
const std::string_view & format,
const Args &... args )
constexpr

Returns a (potentially truncated) string according to snprintf() formatting rules and variable number of arguments following the format argument.

This variant doesn't validate format against given arguments, see jau::format_string_n.

Resulting string is truncated to min(maxStrLen, formatLen), with formatLen being the given formatted string length of output w/o limitation.

Parameters
maxStrLenmaximum resulting string length
formatprintf() compliant format string
argsoptional arguments matching the format string

Definition at line 537 of file string_util.hpp.

Here is the caller graph for this function:

◆ format_string_h()

template<typename... Args>
std::string jau::unsafe::format_string_h ( const std::size_t strLenHint,
const std::string_view format,
const Args &... args )
constexpr

Returns a (non-truncated) string according to snprintf() formatting rules and variable number of arguments following the format argument.

This variant doesn't validate format against given arguments, see jau::format_string_h.

Resulting string size matches formated output w/o limitation.

Parameters
strLenHintinitially used string length w/o EOS
formatprintf() compliant format string
argsoptional arguments matching the format string

Definition at line 569 of file string_util.hpp.

Here is the caller graph for this function:

◆ format_string()

template<typename... Args>
std::string jau::unsafe::format_string ( const std::string_view format,
const Args &... args )
constexpr

Returns a (non-truncated) string according to snprintf() formatting rules using an initially string length of 1023 w/o EOS and variable number of arguments following the format argument.

This variant doesn't validate format against given arguments, see jau::format_string_h.

Resulting string size matches formated output w/o limitation.

Parameters
formatprintf() compliant format string
argsoptional arguments matching the format string

Definition at line 621 of file string_util.hpp.