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

Functions

void errPrint (FILE *out, const char *msg, bool addErrno, bool addBacktrace, const char *func, const char *file, const int line, const char *format,...) noexcept
 
std::string format_string (const char *format,...) noexcept
 Returns a (non-truncated) string according to snprintf() formatting rules and variable number of arguments following the format argument while utilizing the unsafe vsnprintf.
 
std::string format_string_h (const std::size_t strLenHint, const char *format,...) noexcept
 Returns a (non-truncated) string according to snprintf() formatting rules and variable number of arguments following the format argument while utilizing the unsafe vsnprintf.
 
std::string format_string_n (const std::size_t maxStrLen, const char *format,...) noexcept
 Returns a (potentially truncated) string according to snprintf() formatting rules and variable number of arguments following the format argument while utilizing the unsafe vsnprintf.
 
std::string vformat_string_h (const std::size_t strLenHint, const char *format, va_list args) noexcept
 
std::string vformat_string_n (const std::size_t maxStrLen, const char *format, va_list args) noexcept
 

Function Documentation

◆ format_string_n()

std::string jau::unsafe::format_string_n ( const std::size_t maxStrLen,
const char * format,
... )
noexcept

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

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 579 of file basic_types.cpp.

◆ vformat_string_n()

std::string jau::unsafe::vformat_string_n ( const std::size_t maxStrLen,
const char * format,
va_list args )
noexcept

Definition at line 553 of file basic_types.cpp.

Here is the caller graph for this function:

◆ format_string_h()

std::string jau::unsafe::format_string_h ( const std::size_t strLenHint,
const char * format,
... )
noexcept

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

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 625 of file basic_types.cpp.

◆ vformat_string_h()

std::string jau::unsafe::vformat_string_h ( const std::size_t strLenHint,
const char * format,
va_list args )
noexcept

Definition at line 587 of file basic_types.cpp.

Here is the caller graph for this function:

◆ format_string()

std::string jau::unsafe::format_string ( const char * format,
... )
noexcept

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

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

Resulting string size matches formated output w/o limitation.

Parameters
formatprintf() compliant format string
argsoptional arguments matching the format string
Examples
test_stringfmt_format.cpp.

Definition at line 633 of file basic_types.cpp.

Here is the caller graph for this function:

◆ errPrint()

void jau::unsafe::errPrint ( FILE * out,
const char * msg,
bool addErrno,
bool addBacktrace,
const char * func,
const char * file,
const int line,
const char * format,
... )
noexcept

Definition at line 641 of file basic_types.cpp.

Here is the caller graph for this function: