Age | Commit message (Collapse) | Author |
|
Instead of simply outputting the character. This way, we get proper padding
support and other niceties strings enjoy.
|
|
|
|
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.
|
|
This allows to retrieve a default value for items thare are not
available in the json object.
|
|
|
|
String.h no longer pulls in StringView.h. We do this by moving a bunch
of String functions out-of-line.
|
|
|
|
And share the code with String by moving the logic to StringUtils. :^)
|
|
|
|
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
|
|
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"
|
|
Now it's possible to use range-based for loops with String and StringView.
|
|
This is a bit hackish, but sometimes these files stick around and mess
up rebuilds.
|
|
|
|
|
|
|
|
This was not used by anyone. If we ever need it, we can bring it back.
|
|
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.
|
|
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.
|
|
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.
|
|
This allows you to select a type based on a compile-time condition.
|
|
|
|
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().
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
|
|
Provide wrappers in String and StringView. Add some tests for the
implementations.
|
|
Provide wrappers in the String and StringView classes, and add some tests.
|
|
Also add tests for CircularDeque.
|
|
|
|
Now that Vector uses size_t, we can remove a whole bunch of redundant
casts to size_t.
|
|
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.
|
|
|
|
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.
|
|
|
|
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().
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
The not initialized variables can lead to compiler warnings that
become errors with the -Werror flag.
|
|
|
|
Also rework its API's to return Optional<size_t> instead of int with -1
as the error value.
|
|
|