summaryrefslogtreecommitdiff
path: root/AK
AgeCommit message (Collapse)Author
2020-05-28AK: Add StringView::split_view() taking a StringViewAnotherTest
Since the task of splitting a string via another is pretty common, we might as well have this overload of split_view() as well.
2020-05-27AK: Add a simple randomness APIAndreas Kling
This can be used in code that builds on non-Serenity platforms.
2020-05-26AK: Mark some popular String member functions ALWAYS_INLINEAndreas Kling
I don't wanna see String::length() in a profile, jeez. :^)
2020-05-26AK: Rename FileSystemPath -> LexicalPathSergey Bugaev
And move canonicalized_path() to a static method on LexicalPath. This is to make it clear that FileSystemPath/canonicalized_path() only perform *lexical* canonicalization.
2020-05-26Build: Fix cmake test runner, so it knows when tests failBrian Gianforcaro
The CMake runner looks at the return code if you don't set the pattern. Since the AK test suite setup doesn't use return codes, we were missing test failures.
2020-05-26AK: Temporarily disable failing relative_paths tests in FileSystemPath suiteBrian Gianforcaro
It appears this got broken in a3e4dfdf9859a9b955bf4728328f740a47de5851. I filed a tracking bug https://github.com/SerenityOS/serenity/issues/2388
2020-05-26AK: Expand string tests to include ends_with case insensitivityBrian Gianforcaro
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-26AK: Add case insensitive String::ends_with supportBrian Gianforcaro
FileSystemPath::has_extension was jumping through hoops and allocating memory to do a case insensitive comparison needlessly. Extend the existing String::ends_with method to allow the caller to specify the case sensitivity required.
2020-05-26AK: Move String::ends_with implementation to StringUtilsBrian Gianforcaro
Centralizing so it can be used by other string implementations
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-23Kernel+LibC: Fix various build issues introduced by ssize_tAndreas Kling
Now that ssize_t is derived from size_t, we have to
2020-05-23AK: Fix inconsistent signature for dbgputstr()Andreas Kling
2020-05-23AK: Simplify Types.h a little bitAndreas Kling
2020-05-23AK: Add MakeSigned<T> helper templateAndreas Kling
2020-05-23AK: Allow NumericLimits.h to compile in a kernel contextAndreas Kling
We explicitly disallow floating point numbers during kernel compilation so we have to #ifdef out those parts here.
2020-05-23AK: Fix URL::complete_url behaviour for when a fragment is passedFalseHonesty
Previously, passing a fragment string ("#section3") to the complete_url method would result in a URL that looked like "file:///home/anon/www/#section3" which was obviously incorrect. Now the result looks like "file:///home/anon/www/afrag.html#section3".
2020-05-22AK: Fix .. handling in FileSystemPathSergey Bugaev
We shouldn't just drop leading ..-s for relative paths. At the same time, we should handle paths like ../foo/../../bar correctly: the first .. after the foo cancels out the foo, but the second one should get treated as a leading one and not get dropped. Note that since this path resolution is purely lexical, it's never going to be completely correct with respect to symlinks and other filesystem magic. Better don't use it when dealing with files.
2020-05-22AK: Make JsonValue and JsonObjectSerializer speak int/long/long longAndreas Kling
While width-oriented integer types are nicer from the programmer's perspective, we have to accept that C++ thinks in int/long/long long.
2020-05-21AK: StringUtils, add "convert_to_uint_from_hex" methodHüseyin ASLITÜRK
New method to convert hex string unsigned integer.
2020-05-20Revert "AK: Add InitializerList, an implementation of std::initializer_list"Andreas Kling
This reverts commit 0a2cab09282edf357647d2f6e61f9b0680492dca.
2020-05-20Revert "AK+LibC: Move non-placement new/delete into LibC"Andreas Kling
This reverts commit 2c823473930121aecbacf0422c8372a0912e581b.
2020-05-20Revert "AK: Add AtomicRef, for atomically accesing a reference to a varaible"Andreas Kling
This reverts commit aff594f1e790feff0cd7dda3e9f0ecd5573c51bf.
2020-05-20Revert "AK: Don't demangle in serenity :("Andreas Kling
This reverts commit 4361a502255e409f04c9325ef73f3cd10f9cafdb.
2020-05-20AK: Include Platform.h in RefCounted.h so we have ALWAYS_INLINEAndreas Kling
Otherwise Lagom doesn't build on my host machine.
2020-05-20AK+Kernel: Help the compiler inline a bunch of trivial methodsSergey Bugaev
If these methods get inlined, the compiler is able to statically eliminate most of the assertions. Alas, it doesn't realize this, and believes inlining them to be too expensive. So give it a strong hint that it's not the case. This *decreases* the kernel binary size.
2020-05-20AK: Don't demangle in serenity :(Andrew Kaster
In order to remove libstdc++ completely, we need to give up on their implementation of abi::__cxa_demangle. The demangler logic will actually have to be quite complex, and included in both the kernel and userspace. A definite fixme for the future, to parse the mangled names into real deal names.
2020-05-20AK: Add AtomicRef, for atomically accesing a reference to a varaibleAndrew Kaster
This is distintly different from Atomic<T*>, because we want to atomically access a variable that the atomic object itself does not own.
2020-05-20AK+LibC: Move non-placement new/delete into LibCAndrew Kaster
This allows operator new and operator delete to be available to anyone that links -lc (everyone) rather than just people that include kmalloc.h (almost no one).
2020-05-20AK: Add InitializerList, an implementation of std::initializer_listAndrew Kaster
Use the AK version of std::initializer_list in AK::Vector, but only when in serenity. When building AK for a non-serenity target, the header <initializer_list> should be always available.
2020-05-20AK: Fix Checked::multiplication_would_overflow() signatureSergey Bugaev
The two-argument version doesn't need an extra template parameter.
2020-05-18AK: Make Utf32View::substring_view() with 0 length not crashAndreas Kling
Just make it hand out a zero-length Utf32View :^)
2020-05-18AK: Add a way to get the number of valid bytes in a Utf8ViewAnotherTest
2020-05-17AK: Add StringBuilder::append(Utf32View)Andreas Kling
This encodes the incoming UTF-32 sequence as UTF-8.
2020-05-17AK: Add a very basic Utf32View classAndreas Kling
This allows you to wrap a { const u32* codepoints, size_t length } in a simple object.
2020-05-17AK: Make sure URL retains trailing slash if present in complete_urlConrad Pankoff
2020-05-17AK: Add Utf8View::length_in_codepoints()Andreas Kling
2020-05-17AK: Set default port in URL to 1965 for gemini protocolConrad Pankoff
2020-05-16AK: Handle "protocol relative URLs" in URL::complete_url()Linus Groh
2020-05-16AK: Fix URL's operator<<() and use itLinus Groh
2020-05-16Kernel: Absorb LibBareMetal back into the kernelAndreas Kling
This was supposed to be the foundation for some kind of pre-kernel environment, but nobody is working on it right now, so let's move everything back into the kernel and remove all the confusion.
2020-05-16Build: FreeBSD supportDominik Madarasz
2020-05-16AK: Remove experimental clang -Wconsumed stuffAndreas Kling
This stopped working quite some time ago due to Clang losing track of typestates for some reason and everything becoming "unknown". Since we're primarily using GCC anyway, it doesn't seem worth it to try and maintain this non-working experiment for a secondary compiler. Also it doesn't look like the Clang team is actively maintaining this flag anyway. So good-bye, -Wconsumed. :/
2020-05-15AK: StringBuilder with 0 initial capacity shouldn't build null StringAndreas Kling
With 0 initial capacity, we don't allocate an underlying ByteBuffer for the StringBuilder, which would then lead to a null String() being returned from to_string(). This patch makes sure we always build a valid String.
2020-05-14AK: Make FileSystemPath::extension() return what's after the last '.'Andreas Kling
2020-05-14Build: Switch to CMake :^)Sergey Bugaev
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-13AK: Add StringView::equals_ignoring_case()Linus Groh
StringUtils::equals_ignoring_case() already operates on a StringView&, so StringView should have the method directly without having to go through a temporary String (which also has the method).
2020-05-13AK: Replace String::trim_spaces() with String::trim_whitespace()Linus Groh
As suggested by @awesomekling in a code review and (initially) ignored by me :^) Implementation is roughly based on LibJS's trim_string(), but with a fix for trimming all-whitespace strings.
2020-05-12AK: Fix gcc 10.1 compiler warnings in Vector.hLinus Groh
It's complaining about "size_t >= 0" checks. Fixes #2196.
2020-05-11AK: Add String::trim_spaces()Linus Groh