summaryrefslogtreecommitdiff
path: root/AK
AgeCommit message (Collapse)Author
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
2020-05-10AK: Add support for about: URLsAndreas Kling
2020-05-09AK: Add missing copyright header to TestStringUtils.cppLinus Groh
2020-05-09AK: Add missing copyright header to Memory.hLinus Groh
2020-05-09AK: Unbreak parsing of file:// URLs with no hostAndreas Kling
We should still accept file:/// in the URL parser. :^)
2020-05-09AK: Allow file:// URLs to have a hostnameAndreas Kling
2020-05-08AK: Add templated NonnullOwnPtr::release_nonnull()Andreas Kling
This allows you to release a NonnullOwnPtr<T> into a NonnullOwnPtr<U>
2020-05-08AK: Declare LogStream::operator<<(const LogStream&, long) (#2155)Devashish Jaiswal
LogStream::operator<<(const LogStream&, long) was implemented in AK/LogStream.cpp but the declaration was missing from the header.
2020-05-06AK: Fix Bitmap not finding unset ranges at the end of the mapAndreas Kling
When we switched the Bitmap code to operating 32 bits at a time, we neglected to look in the trailing remainder bits after the last full 32-bit word. This patch fixes that and adds a couple of tests for Bitmap that I hacked up while tracking down this bug. I found this bug when noticing that the kernel would OOM while there were still some pages left in the physical page allocator.
2020-05-06Misc: Replace "String(string_view)" with "string_view.to_string()"Linus Groh
StringView::to_string() was added in 917ccb1 but not actually used anywhere yet.
2020-05-06AK: Add to_string() method to StringViewEmanuel Sprung
This allows easy creation of a new string from an existing StringView. Can be used e.g. for output with printf(..., view.to_string().characters()) instead of writing printf(..., String{view}.characters()).