Skip to content

Releases: zrax/string_theory

String Theory 3.8

02 Oct 18:35
3.8
39cdcdc
Compare
Choose a tag to compare
  • Fix UB in find and related operations, which could read past the end of the string in certain cases.
  • Fix <cstdint> include in st_string.h
  • Fix some compiler warnings with newer versions of MSVC and GCC

String Theory 3.7

17 Apr 20:43
3.7
Compare
Choose a tag to compare
  • 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

07 Jun 15:57
3.6
8bcd9bb
Compare
Choose a tag to compare
  • 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

08 Sep 20:09
3.5
a5f6805
Compare
Choose a tag to compare
  • Add a data() method to ST::string for better STL compatibility/consistency.
  • Add overloads to find(), find_last() and contains() 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

06 Nov 23:11
3.4
Compare
Choose a tag to compare
  • Fix ST_WCHAR_LITERAL, ST_UTF16_LITERAL and ST_UTF32_LITERAL macros, which would previously create an incorrectly-sized buffer for non-empty strings.
  • Add ST::buffer<T>::clear() and ST::string::clear() methods
  • Deprecate ST::null and ST::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.

String Theory 3.3

15 Jul 18:59
3.3
Compare
Choose a tag to compare
  • 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.
  • Remove support for std::experimental::string_view and std::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 using std::filesystem.

String Theory 3.2

11 May 16:47
3.2
Compare
Choose a tag to compare
  • 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

28 Jan 21:37
3.1
Compare
Choose a tag to compare

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 the signed char and unsigned char overloads, to help catch places where int8_t and uint8_t might be aliased to something unexpected. 8-bit integers can be streamed by first casting them to the appropriate int type (int or unsigned int).

String Theory 3.0

06 Jan 23:38
3.0
Compare
Choose a tag to compare

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 use using 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 the ST::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 with compare() and operator<().
  • 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 and ST::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 and ST::set_default_assert_handler were removed since ST_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

20 Nov 18:31
2.4
Compare
Choose a tag to compare
  • Allow the user to explicitly specify a C++ standard to build against with -DST_CXX_STANDARD=NN. The default is latest, 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 of std::string support.
    • This removes the ST_NO_STL_STRINGS CMake flag and adds ST_ENABLE_STL_STRINGS and ST_ENABLE_STL_FILESYSTEM in its place. The default for both settings is ON.
  • 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.