Releases: zrax/string_theory
Releases · zrax/string_theory
String Theory 3.8
String Theory 3.7
- Fix a clang optimization that would produce incorrect results for
ST::string::from_int
in Release builds - Update GTest to 1.11 to fix issues with newer compilers
- NOTE: GTest is now included as a git submodule rather than directly in the source tree.
String Theory 3.6
- Fix
std::filesystem
use on MacOS to correctly detect availability based on the target platform's SDK version. - Fix
ST::string::to_buffer(char_buffer &)
always returning Latin-1 data even when UTF-8 was requested. - Fix some warnings on GCC 11 and 12.
String Theory 3.5
- Add a
data()
method toST::string
for better STL compatibility/consistency. - Add overloads to
find()
,find_last()
andcontains()
for when the (C-style) substring size is known. - Improve performance of some string APIs.
- Fix
ST::buffer<T>::compare
and friends to work correctly with non-char
buffers. - Fix C++ feature detection to not return false negatives when building with
-Werror
- Fix a build failure on GCC 11.
- Disallow
ST::string::view()
on temporary (rvalue) objects. - Remove the redundant (and undocumented)
ST::string::from_literal
constructor method.
String Theory 3.4
- Fix
ST_WCHAR_LITERAL
,ST_UTF16_LITERAL
andST_UTF32_LITERAL
macros, which would previously create an incorrectly-sized buffer for non-empty strings. - Add
ST::buffer<T>::clear()
andST::string::clear()
methods - Deprecate
ST::null
andST::null_t
in favor of better alternatives:- Construction: Use
{}
or an explicit constructor (ST::string()
,ST::char_buffer()
) - Comparison: Use
.empty()
- Assignment: Use
.clear()
or assign a default-constructed object.
- Construction: Use
String Theory 3.3
- Add support for
}}
as an escape sequence for literal}
in format strings. This means that formatting a string with escaped literal{}
characters can be balanced:ST::format("... {{some-uuid}} ...") => "... {some-uuid} ..."
.- Warning: This is a potentially backwards-incompatible change. If you already have format strings that contain a double
}}
, they will need to be escaped now (}}}}
). - Note: There is no behavior change for a single
}
which is not already part of a format specifier. It will still be written as-is to the output, for backwards compatibility.
- Warning: This is a potentially backwards-incompatible change. If you already have format strings that contain a double
- Remove support for
std::experimental::string_view
andstd::experimental::filesystem
in favor of the non-experimental versions. - Fix a unit test for compatibility with musl libc.
- Clean up a few unnecessary includes and no-longer used internal support macros.
- Fix a few minor issues identified by cppcheck.
- GCC: Only link to
stdc++fs
when it is required for usingstd::filesystem
.
String Theory 3.2
- Fix
std::filesystem::path
support in MSVC 2019 when using C++17 instead of C++20. - Add more basic conversions (to/from short, long, long long) and deprecate to/from explicit int64 types.
- Remove some unused config macros.
String Theory 3.1
Bug fix release:
- Fix attribute detection so
[[nodiscard]]
is only used on compilers that support it without a warning. - Fix unit tests to not emit warnings on
[[nodiscard]]
functions. - Restore
ST::string_stream::operator<<(char)
and instead disable thesigned char
andunsigned char
overloads, to help catch places whereint8_t
anduint8_t
might be aliased to something unexpected. 8-bit integers can be streamed by first casting them to the appropriate int type (int
orunsigned int
).
String Theory 3.0
Major Changes
- String Theory 3.0 is now a header-only library. You still need CMake for configuring st_config.h and building the tests, but after installing it, only the include directory is necessary.
- Note: For CMake projects, no change is necessary to use 3.0. The provided library is converted to an INTERFACE library which includes the required include directory and removes any linked libs.
- String Theory 3.0 now requires C++11 at minimum. If you still need support for pre-C++11 compilers, you will need to stay on 2.x.
- Many parts of String Theory which previously called
ST_ASSERT
for interface violations have been updated to throw exceptions instead.ST_ASSERT
is now reserved only for unrecoverable failures in the library are not due to misuse of the API. - Breaking: The default format of individual characters in
ST::format
and friends is changed to their equivalent integral types, in order to avoid type aliasing issues in some environments. In order to remain compatible with both 2.x and 3.0, callers should use the"{c}"
format specifier to explicitly request character formatting.
Changes, Additions, Fixes
- Moved user-defined literals to the
ST::literals
namespace to avoid namespace collisions. When porting, you can useusing namespace ST::literals;
to re-enable their use. - Added an
_stfmt
user-defined literal which can be used for literal format strings. For example:
"The {} is {}"_stfmt("answer", 42);
- De-obfuscated the mechanism for declaring custom formatters. The old macros will still work, but new code should declare a
format_type
overload directly now. See Defining Custom Formatters for details. - Conversion between all supported encodings (UTF-8, UTF-16, UTF-32, Latin-1 and
wchar_t
) is now available outside of theST::string
class, including between encodings which previously did not have any direct conversion available. See the wiki for details. - Support basic (case-sensitive) comparison on
ST::buffer<T>
objects withcompare()
andoperator<()
. - Fix UTF-8 conversions to not skip invalid sequence bytes when converting with substitutes. This behavior matches other UTF-8 implementations, including Python and Qt5.
- Add more support for STL string classes in
ST::format
andST::string_stream
(Thanks @Hoikas) - Several performance improvements.
- Several unit testing improvements in both coverage and functionality.
Removed Features
- APIs marked deprecated in 2.0 are now removed.
ST::set_assert_handler
andST::set_default_assert_handler
were removed sinceST_ASSERT
is no longer used for interface violations.ST::utf_validation_t::assert_validity
is removed since it no longer makes any sense.- Removed implicit conversions to
std::string_view
.
String Theory 2.4
- Allow the user to explicitly specify a C++ standard to build against with
-DST_CXX_STANDARD=NN
. The default islatest
, which matches the previous behavior to detect and use the latest standard supported by the compiler. - Allow
std::filesystem
support to be enabled/disabled independently ofstd::string
support.- This removes the
ST_NO_STL_STRINGS
CMake flag and addsST_ENABLE_STL_STRINGS
andST_ENABLE_STL_FILESYSTEM
in its place. The default for both settings isON
.
- This removes the
- Fix some build issues with older compilers.
- Fix support for latest MSVC2019 updates.
- Optimize string/buffer moves, and provide better exception safety in buffer copies.