Releases: gershnik/sys_string
Releases · gershnik/sys_string
2.15
This is a bug fix release for 2.x code
Fixed
- Invalid character access in unicode mappings.
3.0
This is a major release with some breaking changes
Changed
- 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
Added
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
Fixed
- 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
Fixed
- Missing standard header causing compilation error on some systems.
2.13
Fixed
- Compilation error with Python strings under Python 3.12
- Apple CLang compilation errors with XCode 15
2.12
Fixed
- Fixed CLang compilation errors
- Fixed CMake installation not producing proper version when run from extracted official archive
- Fixed various compiler warnings
2.11
Changed
- Updated CMake configuration to modernize it and allow local installation
2.10
- Made Python strings work with GCC
2.9
- Making Python strings work with PyPy implementation
2.8
- Added support for Python strings
- Updated documentation
2.7
- 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.