summaryrefslogtreecommitdiff
path: root/AK/FlyString.h
AgeCommit message (Collapse)Author
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-06-18AK: Add a way to disable the trimming of whitespace in to_*intsin-ack
This behavior might not always be desirable, and so this patch adds a way to disable it.
2021-06-13AK: Add FlyString::from_fly_impl()Andreas Kling
This allows you to create a FlyString directly from a known-fly StringImpl instance.
2021-06-06Revert "Revert "AK: Always inline FlyString::view()""Linus Groh
This reverts commit f09216ac42bac9108e7f36ed2938c6f278f497e4. This was supposed to be a local test only, didn't mean to push it. :^)
2021-06-06Revert "AK: Always inline FlyString::view()"Linus Groh
This reverts commit 66f15c2e0c34caed8ce56075a366b20c4d1819af.
2021-06-05AK: Always inline FlyString::view()Andreas Kling
2021-06-04AK: Inline *String::is_one_of<Ts...>()Ali Mohammad Pur
Previously this was generating a crazy number of symbols, and it was also pretty-damn-slow as it was defined recursively, which made the compiler incapable of inlining it (due to the many many layers of recursion before it terminated). This commit replaces the recursion with a pack expansion and marks it always-inline.
2021-06-03AK: Allow inlining more string functionsGunnar Beutner
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-01-12AK: Simplify constructors and conversions from nullptr_tLenny Maiorani
Problem: - Many constructors are defined as `{}` rather than using the ` = default` compiler-provided constructor. - Some types provide an implicit conversion operator from `nullptr_t` instead of requiring the caller to default construct. This violates the C++ Core Guidelines suggestion to declare single-argument constructors explicit (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit). Solution: - Change default constructors to use the compiler-provided default constructor. - Remove implicit conversion operators from `nullptr_t` and change usage to enforce type consistency without conversion.
2020-12-21AK: Generalize AK::String::to_int() for more typesSahan Fernando
2020-07-28AK: Tweak String::is_one_of() and FlyString::is_one_of()Andreas Kling
Switch the comparisons from "other == *this" to "*this == other".
2020-07-21AK: Add case insensitive version of starts_withLuke
2020-06-12AK: Make string-to-number conversion helpers return OptionalAndreas Kling
Get rid of the weird old signature: - int StringType::to_int(bool& ok) const And replace it with sensible new signature: - Optional<int> StringType::to_int() const
2020-05-30AK: Make {String,FlyString}::is_one_of() constAndreas Kling
Also, make the zero-argument variant private since it's not meant to be called by clients directly.
2020-05-26AK: Unify FlyString/StringView::ends_with implementation on ↵Brian Gianforcaro
StringUtils::ends_with This creates a unified implementation of ends_with with case sensitivity across String/StringView/FlyString.
2020-05-25AK: Add String::is_one_of(...)Andreas Kling
This allows you to compare a string against an arbitrary number of other strings with a single call.
2020-05-05AK: Some FlyString improvementsAndreas Kling
We're now clever enough to notice when we're constructing a FlyString from a String that is actually already a FlyString. :^)
2020-04-30AK: Add ALWAYS_INLINE, NEVER_INLINE and FLATTEN macrosAndreas Kling
It's tedious to write (and look at) [[gnu::always_inline]] etc. :^)
2020-04-16AK: Add FlyString::is_empty()Andreas Kling
2020-04-13AK: Let FlyString::hash() assume that the string was already hashedAndreas Kling
Since the FlyString deduplication mechanism uses a HashTable, we know that any StringImpl inside a non-null FlyString will already have its lazily computed hash.
2020-04-10AK: Add FlyString::hash()Andreas Kling
2020-03-28AK: Add some string comparison operatorsAndreas Kling
Some of these are very inefficient. It's nice to have some optimization opportunities in the future though. :^)
2020-03-24AK: Add FlyString::is_null()Andreas Kling
2020-03-23AK: Reduce header dependency graph of String.hAndreas Kling
String.h no longer pulls in StringView.h. We do this by moving a bunch of String functions out-of-line.
2020-03-22AK: Add FlyString::to_lowercase() and LogStream operator<<(FlyString)Andreas Kling
2020-03-22AK: Add FlyString::equals_ignoring_case(StringView)Andreas Kling
And share the code with String by moving the logic to StringUtils. :^)
2020-03-22AK: Add FlyString, a simple flyweight string classAndreas Kling
FlyString is a flyweight string class that wraps a RefPtr<StringImpl> known to be unique among the set of FlyStrings. The class is very unoptimized at the moment. When to use FlyString: - When you want O(1) string comparison - When you want to deduplicate a lot of identical strings When not to use FlyString: - For strings that don't need either of the above features - For strings that are likely to be unique