The last use of these functions was removed in ae299d5e66.
And that's a good thing, because snprintf-style interfaces
make zero sense in times of variable-length character
encodings.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Had to rewrite the thing, because gcc's warnings don't work
with templatized var-args. Since there is no string-format.cpp
and I didn't want to inline it, moved it to format.cpp.
String formatting is distributed around at least four
headers: membuffer.h, subsurface-string.h, format.h
and format-string.h. This really should be unified!
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
We had locale aware formatting functions that generated QStrings.
Create an alternative that creates std::string, since we want that
in the core.
This commit is unfortunate for two reasons:
- The function is called "casprintf()" for analogy with the QString
version. However, the non locale aware function is called
"format_string_std()" for analogy with "format_string()".
Ultimately these names should be unified. Probably, once there
are no membuffer users left.
- This does UTF-16->UTF-8->UTF-16 roundtrips. The core formatting
functions should render UTF-8 and only convert to UTF-16, in
the UI layer.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
qthelper.cpp is already quite voluminous. Move the recently
introduced localized versions of (v)snprintf() and put_format()
into their own translation unit.
Moreover, adopt C-style semantics for asprintf_loc(). This function
will be used to remove fixed-size buffers in core/plannernotes.c.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>