summaryrefslogtreecommitdiff
path: root/AK/Utf16View.h
AgeCommit message (Collapse)Author
2023-01-09AK: Add Utf16View::to_utf8 to convert the view to a UTF-8 AK::StringTimothy Flynn
2023-01-09AK+Everywhere: Rename Utf16View::to_utf8 to to_deprecated_stringTimothy Flynn
A subsequent commit will add to_utf8 back to create an AK::String.
2023-01-08AK+Everywhere: Make UTF-16 to UTF-8 converter fallibleTimothy Flynn
This could fail to allocate the underlying storage needed to store the UTF-8 data. Propagate this error.
2023-01-08AK+Everywhere: Make UTF-8 and UTF-32 to UTF-16 converters fallibleTimothy Flynn
These could fail to allocate the underlying storage needed to store the UTF-16 data. Propagate these errors.
2023-01-08AK+LibJS+LibRegex: Define an alias for UTF-16 string data storageTimothy Flynn
Instead of writing out "Vector<u16, 1>" everywhere, let's have a name for it.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-26AK: Make it possible to not `using` AK classes into the global namespaceAndreas Kling
This patch adds the `USING_AK_GLOBALLY` macro which is enabled by default, but can be overridden by build flags. This is a step towards integrating Jakt and AK types.
2022-11-06Everywhere: Remove redundant inequality comparison operatorsDaniel Bertalan
C++20 can automatically synthesize `operator!=` from `operator==`, so there is no point in writing such functions by hand if all they do is call through to `operator==`. This fixes a compile error with compilers that implement P2468 (Clang 16 currently). This paper restores the C++17 behavior that if both `T::operator==(U)` and `T::operator!=(U)` exist, `U == T` won't be rewritten in reverse to call `T::operator==(U)`. Removing `!=` operators makes the rewriting possible again. See https://reviews.llvm.org/D134529#3853062
2022-01-31AK: Add a Utf16View::code_unit_offset_of(Utf16CodePointIterator) helperIdan Horowitz
This helper can be used to used to retrieve the code unit offset of an active Utf16CodePointIterator efficiently.
2022-01-31Everywhere: Update copyrights with my new serenityos.org e-mail :^)Timothy Flynn
2021-11-17AK: Convert AK::Format formatting helpers to returning ErrorOr<void>Andreas Kling
This isn't a complete conversion to ErrorOr<void>, but a good chunk. The end goal here is to propagate buffer allocation failures to the caller, and allow the use of TRY() with formatting functions.
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-10-02AK: Simplify Utf16View::operator==(Utf16View)Andreas Kling
2021-10-02LibJS+AK: Use Vector<u16, 1> for UTF-16 string storageAndreas Kling
It's very common to encounter single-character strings in JavaScript on the web. We can make such strings significantly lighter by having a 1-character inline capacity on the Vectors.
2021-08-10AK: Add a formatter overload for Utf16ViewTimothy Flynn
2021-08-04AK+LibJS: Implement String.from{CharCode,CodePoint} using UTF-16 stringsTimothy Flynn
Most of String.prototype and RegExp.prototype is implemented with UTF-16 so this is to prevent extra copying of the string data.
2021-08-04AK+LibRegex: Add Utf16View::code_point_at and use it in RegexStringViewTimothy Flynn
The current method of iterating through the string to access a code point hurts performance quite badly for very large strings. The test262 test "RegExp/property-escapes/generated/Any.js" previously took 3 hours to complete; this one change brings it down to under 10 seconds.
2021-07-23AK+LibRegex: Partially implement case insensitive UTF-16 comparisonTimothy Flynn
This will work for ASCII code points. Unicode case folding will be needed for non-ASCII.
2021-07-23AK: Add UTF-16 helper methods required for use within LibRegexTimothy Flynn
To be used as a RegexStringView variant, Utf16View must provide a couple more helper methods. It must also not default its assignment operators, because that implicitly deletes move/copy constructors.
2021-07-22AK: Add Utf16View for decoding UTF-16 stringsTimothy Flynn
Also includes a way to transcode from and to UTF-8 strings.