summaryrefslogtreecommitdiff
path: root/AK
AgeCommit message (Collapse)Author
2020-03-26AK: Use print_string() for %c formattingSergey Bugaev
Instead of simply outputting the character. This way, we get proper padding support and other niceties strings enjoy.
2020-03-24AK: Fix JsonParser kernel build (no floats/doubles in kernel code)Andreas Kling
2020-03-24AK: Add parsing of JSON double valuesEmanuel Sprung
This patch adds the parsing of double values to the JSON parser. There is another char buffer that get's filled when a "." is present in the number parsing. When number finished, a divider is calculated to transform the number behind the "." to the actual fraction value.
2020-03-24AK: Add get_or() method to JsonObjectEmanuel Sprung
This allows to retrieve a default value for items thare are not available in the json object.
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: Run clang-format on StringUtils.{cpp,h}Andreas Kling
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
2020-03-20AK: Add StringBuilder::join() for joining collections with a separatorAndreas Kling
This patch adds a generic StringBuilder::join(separator, collection): Vector<String> strings = { "well", "hello", "friends" }; StringBuilder builder; builder.join("+ ", strings); builder.to_string(); // "well + hello + friends"
2020-03-10AK: Add begin() and end() to String and StringViewhowar6hill
Now it's possible to use range-based for loops with String and StringView.
2020-03-08AK: Remove all the AK .host.o files on "make clean" in AK/TestsAndreas Kling
This is a bit hackish, but sometimes these files stick around and mess up rebuilds.
2020-03-08AK: Reduce code duplication in StringBuilderhowar6hill
2020-03-08AK: Improve the API of StringBuilderhowar6hill
2020-03-08AK: Use default constructor of Optional if an unset bit is not foundLiav A
2020-03-08AK: Remove unused InlineLRUCache templateAndreas Kling
This was not used by anyone. If we ever need it, we can bring it back.
2020-03-08AK: Move memory stuff (fast memcpy, etc) to a separate headerAndreas Kling
Move the "fast memcpy" stuff out of StdLibExtras.h and into Memory.h. This will break a ton of things that were relying on StdLibExtras.h to include a bunch of other headers. Fix will follow immediately after. This makes it possible to include StdLibExtras.h from Types.h, which is the main point of this exercise.
2020-03-08AK: Use __builtin_memset() and such to reduce header dependenciesAndreas Kling
We can use __builtin_memset() without including <string.h>. This is pretty neat, as it will allow us to reduce the header deps of AK templates a bit, if applied consistently. Note that this is an enabling change for an upcoming #include removal.
2020-03-08AK: Add global FlatPtr typedef. It's u32 or u64, based on sizeof(void*)Andreas Kling
Use this instead of uintptr_t throughout the codebase. This makes it possible to pass a FlatPtr to something that has u32 and u64 overloads.
2020-03-08AK: Add a Conditional<condition, TrueType, FalseType> templateAndreas Kling
This allows you to select a type based on a compile-time condition.
2020-03-06AK: Fix all the warnings in the AK testsAndreas Kling
2020-03-06AK: Remove Optional::operator bool()Andreas Kling
This was causing some obvious-in-hindsight but hard to spot bugs where we'd implicitly convert the bool to an integer type and carry on with the number 1 instead of the actual value().
2020-03-06AK: Simplify JsonObject and JsonArray API a little bitAndreas Kling
Instead of set(const JsonValue&) and set(JsonValue&&), just do set(JsonValue) and let callers move() if they want. This removes some ambiguity and the compiler is smart enough to optimize it anyway.
2020-03-04AK: LogStream should handle being passed a null const char*Andreas Kling
2020-03-03AK: Make quick_sort() a little more ergonomicAndreas Kling
Now it actually defaults to "a < b" comparison, instead of forcing you to provide a trivial less-than comparator. Also you can pass in any collection type that has .begin() and .end() and we'll sort it for you.
2020-03-02AK: Add support for Kernel Log StreamLiav A
2020-03-02Meta: Adjust some copyright dates by Fei WuAndreas Kling
2020-03-02AK: Add missing copyright headers to StringUtils.{cpp,h}Andreas Kling
2020-03-02AK: Move to_int(), to_uint() implementations to StringUtils (#1338)howar6hill
Provide wrappers in String and StringView. Add some tests for the implementations.
2020-03-02AK: Move the wildcard-matching implementation to StringUtilshowar6hill
Provide wrappers in the String and StringView classes, and add some tests.
2020-03-02AK: Add enqueue_begin() for the CircularDeque class (#1320)howar6hill
Also add tests for CircularDeque.
2020-03-02AK: Remove superfluous explicit in Bitmap (#1337)howar6hill
2020-03-01AK: Remove unnecessary casts to size_t, after Vector changesAndreas Kling
Now that Vector uses size_t, we can remove a whole bunch of redundant casts to size_t.
2020-02-28Kernel: Merge the shbuf_get_size() syscall into shbuf_get()Andreas Kling
Add an extra out-parameter to shbuf_get() that receives the size of the shared buffer. That way we don't need to make a separate syscall to get the size, which we always did immediately after.
2020-02-28LibC: Move shbuf_* API's to <serenity.h>Andreas Kling
2020-02-28Kernel+LibC: Rename shared buffer syscalls to use a prefixAndreas Kling
This feels a lot more consistent and Unixy: create_shared_buffer() => shbuf_create() share_buffer_with() => shbuf_allow_pid() share_buffer_globally() => shbuf_allow_all() get_shared_buffer() => shbuf_get() release_shared_buffer() => shbuf_release() seal_shared_buffer() => shbuf_seal() get_shared_buffer_size() => shbuf_get_size() Also, "shared_buffer_id" is shortened to "shbuf_id" all around.
2020-02-27Tests: Fix a typo inTestRefPtrhowar6hill
2020-02-27AK: Expose SinglyLinkedListIterator constructorWilliam McPherson
This commit replaces SinglyLinkedListIterator::universal_end() with an empty SinglyLinkedListIterator(). Piano needs this in order to initialize a member array of iterators without 84 lines of universal_end().
2020-02-26CircularQueue: Move construct a T object instead of copy constructing ithowar6hill
2020-02-25AK: Have AK/kmalloc.h #include <new> on other platformsAndreas Kling
This should make stuff like placement new work correctly when building outside of Serenity. This stuff is a bit delicate due to the weirdly staged toolchain build at the moment. Hopefully we can unify this stuff in the future.
2020-02-25AK: Provide a ptr_hash(const void*) overloadAndreas Kling
2020-02-25AK: Add ptr_hash to use int_hash or u64_hash depending on pointer sizejoshua stein
2020-02-25AK: Some more int => size_t in BitmapAndreas Kling
2020-02-25AK: Make Queue use size_t for its sizeAndreas Kling
2020-02-25AK: Make Vector use size_t for its size and capacityAndreas Kling
2020-02-25AK, LibGfx, LibGUI: Initialize various variables to zero.Emanuel Sprung
The not initialized variables can lead to compiler warnings that become errors with the -Werror flag.
2020-02-24AK: Zero-initialize the internal storage of OptionalAndreas Kling
2020-02-24AK: Make Bitmap use size_t for its sizeAndreas Kling
Also rework its API's to return Optional<size_t> instead of int with -1 as the error value.
2020-02-24AK: Make HashTable and HashMap use size_t for size and capacityAndreas Kling