Commit Graph

11 Commits

Author SHA1 Message Date
Linus Groh
57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Tim Schumacher
5f99934dce Userland: Consolidate most PATH resolving into a single implementation
We previously had at least three different implementations for resolving
executables in the PATH, all of which had slightly different
characteristics.

Merge those into a single implementation to keep the behaviour
consistent, and maybe to make that implementation more configurable in
the future.
2022-08-23 19:00:04 +01:00
Andrew Kaster
170a7e263c Userland: Fail Core::find_executable_in_path on empty inputs
Before this patch, `which ""` or `type ""` would say that the empty
string is `/usr/local/bin/`.

Convert callers to consistently call is_empty() on the returned string
while we're at it, to support eventually removing the is_null() String
state in the future.
2022-01-04 07:38:42 +00:00
Timothy Flynn
7f780e43a6 LibCore: Allow moving, but not copying, DirIterator
An explicit move constructor is required to null-out the moved-from
directory descriptor. Otherwise, we would call closedir() twice when
using ErrorOr<DirIterator>::release_value().
2021-11-23 22:58:05 +01:00
Andreas Kling
e4a55404f1 LibCore: Avoid duplicate '/' in DirIterator::next_full_path()
When the root path of a DirIterator ends with '/', we don't need to
add another '/' before appending the file name.

Fixes an issue where files found by Assistant had 2 leading slashes.
2021-07-03 16:43:08 +02:00
Mart G
758085571f LibCore: Expose DirIterator's underlying file descriptor 2021-05-14 23:32:10 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
510aad6515 LibCore: Make DirIterator take String instead of StringView 2021-04-17 01:27:30 +02:00
Andreas Kling
ef1e5db1d0 Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00