Not that we would like to promote the use of C locale_t over C++
std::locale, but we need former for sprintf and we need decent support
for it.
Signed-off-by: Simon Rozman <simon@rozman.si>
One can always revert to default locale by specifying NULL. Mind that
stdlib locale_t is used, as we are using its sprintf() implementation
and it is not simple to convert from std::locale to locale_t.
Signed-off-by: Simon Rozman <simon@rozman.si>
Functions are allowed to be called with nullptr string input as long as
the length of those strings is set to 0.
Signed-off-by: Simon Rozman <simon@rozman.si>
This information is a side product of these templates and saves an extra
strnlen when caller plans on appending dst string some more data.
Signed-off-by: Simon Rozman <simon@rozman.si>
POSIX C strchr and strstr implementations return pointers and pointer
arithmetic is error prone. Switch to std C++ index search offsets.
Signed-off-by: Simon Rozman <simon@rozman.si>
These files are C++ only. They should either have no extension like
standard C++ headers (which is cumbersome on Windows environments), or
.hpp.
.h is used for C and hybrid C/C++ headers.
Signed-off-by: Simon Rozman <simon@rozman.si>