All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
3.0 - 2024-12-02
This is a major release with some breaking changes
- C++20 or higher is now required for compilation. In particular, the following C++20 features must be available:
- Ranges support in standard library (
__cpp_lib_ranges >= 201911
) - Three-way comparison (spaceship operator)
char8_t
typestd::endian
support in standard library (__cpp_lib_endian >= 201907
)- Minimal compilers known to work include: GCC 12, Clang 16, Apple Clang 15.4 and MSVC 17.6.
- Ranges support in standard library (
- The library has been range-ified.
- All methods that used to accept iterator pairs now take iterator/sentinel pairs.
- All these methods now also have overloads that accept ranges
- Existing informal ranges (
sys_string::char_access
,sys_string::utf_view
, etc.) are now formal ranges or views. - As part of the above
sys_string::utfX_view
classes has been renamed tosys_string::utfX_access
(because they are not formally views as defined by standard library). The old names have been retained for compatibility but annotated as deprecated. Note thatsys_string_builder::utf_view
remains under the same name since it is a view. - Breaking change: as part of the above change the
sys_string::utf_access
andsys_string_builder::utf_view
now return distinct iterators and sentinels (that is they no longer satisfystd::ranges::common_range
concept). You will need to use ranges algorithms with their iterators (e.g.std::ranges::for_each
rather thanstd::for_each
). - The global
utf_view
template has been split into two:utf_ref_view
that takes underlying range by reference (similar tostd::ref_view
) andutf_owning_view
that owns a movable underlying range (similar tostd::owning_view
). These are automatically produced byas_utf
range adapter closures (see below in Added section) - Breaking change: the non-standard
Cursor
classes has been removed.
- The library has been concept-ified.
- Most templated library calls now have concepts checks that validate their argument types.
- Primitive
std::enable_if
used before have been subsumed by these and removed.
- Unicode data used for case folding and whitespace detection has been updated to version 16.0.0
sys_string_t
can now be+
-ed with any forward range of any type of character (including C strings and std::string). This results in a the same optimized addition as when addingsys_string_t
objects.sys_string_t
objects can now be formatted viastd::format
(if available in your library). On platforms wherewchar_t
is UTF-16 or UTF-32 you can also use wide character formatting.sys_string_t::std_format
method. This formats a newsys_string_t
(similar to the existingsys_string_t::format
) but usesstd::format
machinery and formatting string syntax.- Range adapter closures:
as_utf8
,as_utf18
,as_utf32
and genericas_utf<encoding>
.- These can be used to create
utf_ref_view
/utf_owning_view
from any range/view. For exampleas_utf16(std::string("abc"))
- If you library supports custom adapter closures (usually
__cpp_lib_ranges >= 202202L
) they can be used in view pipelines likestd::string("abc") | as_utf16 | std::views::take(2)
etc.
- These can be used to create
- Printing
sys_string_t
objects intostd::ostream
(andstd::wostream
if available) now functions correctly in presence of stream formatting flags. Flags are currently ignored. This might change in a future version. - Printing/formatting
sys_string_t
objects that usechar
storage type now does not perform sanitizing transcoding. The content of the string is printed as-is. This allows faithful round-tripping and support for invalid Unicode for those scenarios. Similar behavior applies towchar_t
on platform where it is UTF-16 or UTF-32. operator<<
no longer pollutes global namespace
2.14 - 2024-05-02
- Missing standard header causing compilation error on some systems.
2.13 - 2023-11-18
- Compilation error with Python strings under Python 3.12
- Apple CLang compilation errors with XCode 15
2.12 - 2023-07-31
- Fixed CLang compilation errors
- Fixed CMake installation not producing proper version when run from extracted official archive
- Fixed various compiler warnings
2.11 - 2023-07-24
- Updated CMake configuration to modernize it and allow local installation
2.10 - 2023-03-30
- Made Python strings work with GCC
2.9 - 2023-03-30
- Making Python strings work with PyPy implementation
2.8 - 2023-03-18
- Added support for Python strings
- Updated documentation
2.7 - 2023-02-02
- Added support for Emscripten/JavaScript storage and interop. Strings are stored in UTF16 encoding and transformation methods to/from JavaScript are available similar to how Android/Java interop works. Docs to follow.
- Fixed creation of longer Apple strings
- Fixed warnings in newer Xcode versions.
2.5 - 2022-11-07
- Made generic Unix support work for any Unix, not just Linux/BSD
- Fixed broken `swap()`` method for some storage types
2.4 - 2022-07-02
- Fixed compilation with GCC >= 10 and <= 11.2 which were broken due to compiler bug. GCC 9 and >= 11.3 are unaffected.
- Updated Catch library to fix tests not building on some Linux versions
2.3 - 2022-06-09
- FreeBSD is now supported (identical to Linux)
- Generic `char *`` storage is now supported on Windows
- Removed spurious output during CMake build
2.2 - 2022-05-23
- String partitioning methods:
- Returning one side
suffix_after_first(str_or_char)
prefix_before_first(str_or_char)
suffix_after_last(str_or_char)
prefix_before_last(str_or_char)
- Returning both sides (as
std::pair
)partition_at_first(str_or_char)
partition_at_last(str_or_char)
- Returning one side
2.1 - 2022-05-19
- Support for GCC 12
- Workarounds for Xcode 13 libc++ issues
- Minor internal tweaks and improvements
- Better naming in parser configuration
- Updated documentation
2.0 - 2021-12-07
sys_string
is now a template on storage policy which leads to- ability to select different storage types for each platform
- ability to use multiple storage types in the same project, if desired
- New storage types on Windows:
BSTR
and plainwchar_t *
- Breaking change: default storage type switched to plain
wchar_t *
- Breaking change: default storage type switched to plain
- Performance improvements
- Various minor bug fixes
1.1 - 2021-11-05
- Bug fixes and performance improvements
1.0 - 2021-05-03
- Initial version