summaryrefslogtreecommitdiff
path: root/AK
AgeCommit message (Collapse)Author
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()).
2020-05-06AK: Make tests compilable with the serenity target toolchainEmanuel Sprung
2020-05-05AK: Add URL::basename()Andreas Kling
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-05-05AK: run clang-format on PrintfImplementation.hEmanuele Torre
2020-05-04AK: Rename variables with camelCase names in PrintfImplementation.h (#2095)Emanuele Torre
zeroPad => zero_pad leftPad => left_pad fieldWidth => field_width These were the only variables with names in camelCase. We were not consistent with the naming of these variables: some times we called them zeroPad, leftPad, fieldWidth; other times we called them zero_pad, left_pad, field_width. These inconsistencies made the code hard to read, so I changed their names to snake_case. Also rename width => field_width in AK::print_hex()
2020-05-04AK: Add StringView::find_first/last_ofAndrew Kaster
These methods search from the beginning or end of a string for the first character in the input StringView and returns the position in the string of the first match. Note that this is not a substring match. Each comes with single char overloads for efficiency.
2020-05-03AK: Add Vector::resize_and_keep_capacity()Andreas Kling
This function is just like resize() except it does not deallocate the vector buffer when shrinking.
2020-05-03AK+FileManager: Move out human_readable_size to AK::NumberFormatAnotherTest
2020-05-02AK: Inline busy functions in VectorAnotherTest
2020-05-02AK: Correct ByteBuffer::{overwrite,slice*} bounds checkAnotherTest
2020-05-01AK: Make Checked.h work with ClangAndreas Kling
Apparently Clang does not have __builtin_foo_overflow_p() Fixes #2044.
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-30AK: Always inline trivial StringView constructorsSergey Bugaev
2020-04-30AK: Assert that we don't create StringViews of negative lengthSergey Bugaev
Due to us using size_t for the length, the actual value will always be positive. If, for example, we calculate the length as "0 - 1", we'll get SIZE_T_MAX. What we can do is check that adding the characters pointer and the length together doesn't overflow.
2020-04-30AK: Add Checked::addition_would_overflow()Sergey Bugaev
And switch the two-argument version of Checked::multiplication_would_overflow() to use __builtin_mul_overflow_p(). This helps GCC optimize the code better.
2020-04-28AK: Add FileSystemPath::is_absolute()Linus Groh
2020-04-27AK: Add SinglyLinkedListIterator::is_begin()Brian Gianforcaro
It's useful to be able to tell if we are at the beginning of the list when using the list as a queue.
2020-04-26AK: Make URL::to_string() produce a data URL for data URLs :^)Andreas Kling
2020-04-26AK: Add a simple and inefficient Base64 decoderAndreas Kling
2020-04-26AK: Teach URL how to parse data: URLs :^)Andreas Kling
2020-04-26AK: Add timeval_to_timespec and timespec_to_timeval conversion methodsBrian Gianforcaro
Add the ability to easily convert between timeval and timespec.
2020-04-22AK: Tweak exchange() implementationAndreas Kling
Make it constexpr and do perfect forwarding.
2020-04-21AK: Simplify Result class so we can start using itAndreas Kling
There were some ideas about how to use this class but we never actually started using it, so let's just simplify it and get it ready for use. The basic idea is: a function returns a Result<ValueType, ErrorType>. Callers check if the result object is_error(). If so, an ErrorType can be fetched with the error() getter. Otherwise, a ValueType is fetched with the value() getter. That's it. :^)
2020-04-21AK: Remove unused Error templateAndreas Kling
2020-04-20LibDebug: Parse line number information from DWARF formatItamar
DWARF line number information, if generated, is stored in the .debug_line section of an object file. The information is encoded as instructions for a VM that is defined in the DWARF specification. By executing these instructions, we can extract the encoded line number information.
2020-04-20AK: Allow having ref counted pointers to const objectItamar
We allow the ref-counting parts of an object to be mutated even when the object itself is a const. An important detail is that we allow invoking 'will_be_destroyed' and 'one_ref_left', which are not required to be const qualified, on const objects.
2020-04-19AK: Add URL::create_with_url_or_path()Sergey Bugaev
This is an utility to create a URL from a given string, which may be either a URL such as http://example.com (which will be used as-is), or a file path such as /etc/fstab (which will be transformed into file:///etc/fstab).
2020-04-19AK: Consider more URLs invalidSergey Bugaev
Not just http or https. This fixes "foo" being recognized as a valid URL with protocol "foo", empty host and empty path.
2020-04-18AK: Add URL::create_with_file_protocol(path)Andreas Kling
This is a convenience helper that allows you to easily construct a file:// URL from an absolute path.
2020-04-18AK: Dual pivot quicksort implementation (#1838)wilsonk
2020-04-17AK: Add StringView::contains(char)Stephan Unverwerth
2020-04-16AK: Add FlyString::is_empty()Andreas Kling
2020-04-15AK: Add Checked<T>::multiplication_would_overflow()Andreas Kling
This allows you to comfortably test if multiply 2 or 3 values would cause arithmetic overflow.
2020-04-15AK: Add a Checked<T> templateAndreas Kling
A Checked<T> is a boxed integer type that asserts if you try to use its value after an arithmetic overflow.
2020-04-15AK: Add MakeUnsigned<T> helper templateAndreas Kling
2020-04-15AK: Add a simple NumericLimits<T> templateAndreas Kling
This provides min(), max() and is_signed() for the basic integer types.
2020-04-14AK: Add a little test for String::split()Andreas Kling
Just to verify that the parts are all null-terminated.
2020-04-13LibELF: Add find_demangled_functionItamar
Also, added AK::String::index_of and fixed a bug in ELF::Loader::symbol_ptr
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-12AK: Inline Optional functions more aggressivelyAndreas Kling
This turns into much less code in the most common cases, here's why: The normal Optional usage pattern is something like: auto foo = get_me_an_optional(); if (foo.has_value()) do_stuff_with(foo.value()); In this typical scenario, we check has_value() before calling value(). Without inlining, value() will double-check has_value() itself and assert if it fails. Inlining allows the compiler to optimize all of this away.
2020-04-12AK: Add LogStream operator<< overloads for float and doubleAndreas Kling
2020-04-12AK: Parse query and fragment in URL::parse()Linus Groh
2020-04-12AK: Support fragment in URLLinus Groh