Age | Commit message (Collapse) | Author |
|
Since the task of splitting a string via another is pretty common, we
might as well have this overload of split_view() as well.
|
|
This can be used in code that builds on non-Serenity platforms.
|
|
I don't wanna see String::length() in a profile, jeez. :^)
|
|
And move canonicalized_path() to a static method on LexicalPath.
This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
|
|
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.
|
|
It appears this got broken in a3e4dfdf9859a9b955bf4728328f740a47de5851.
I filed a tracking bug https://github.com/SerenityOS/serenity/issues/2388
|
|
|
|
StringUtils::ends_with
This creates a unified implementation of ends_with with case sensitivity
across String/StringView/FlyString.
|
|
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.
|
|
Centralizing so it can be used by other string implementations
|
|
This allows you to compare a string against an arbitrary number of
other strings with a single call.
|
|
Now that ssize_t is derived from size_t, we have to
|
|
|
|
|
|
|
|
We explicitly disallow floating point numbers during kernel compilation
so we have to #ifdef out those parts here.
|
|
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".
|
|
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.
|
|
While width-oriented integer types are nicer from the programmer's
perspective, we have to accept that C++ thinks in int/long/long long.
|
|
New method to convert hex string unsigned integer.
|
|
This reverts commit 0a2cab09282edf357647d2f6e61f9b0680492dca.
|
|
This reverts commit 2c823473930121aecbacf0422c8372a0912e581b.
|
|
This reverts commit aff594f1e790feff0cd7dda3e9f0ecd5573c51bf.
|
|
This reverts commit 4361a502255e409f04c9325ef73f3cd10f9cafdb.
|
|
Otherwise Lagom doesn't build on my host machine.
|
|
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.
|
|
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.
|
|
This is distintly different from Atomic<T*>, because we want to
atomically access a variable that the atomic object itself does not own.
|
|
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).
|
|
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.
|
|
The two-argument version doesn't need an extra template parameter.
|
|
Just make it hand out a zero-length Utf32View :^)
|
|
|
|
This encodes the incoming UTF-32 sequence as UTF-8.
|
|
This allows you to wrap a { const u32* codepoints, size_t length } in a
simple object.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
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. :/
|
|
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.
|
|
|
|
Closes https://github.com/SerenityOS/serenity/issues/2080
|
|
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).
|
|
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.
|
|
It's complaining about "size_t >= 0" checks.
Fixes #2196.
|
|
|