This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).
This commit is auto-generated:
$ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
Meta Ports Ladybird Tests Kernel)
$ perl -pie 's/\bDeprecatedString\b/ByteString/g;
s/deprecated_string/byte_string/g' $xs
$ clang-format --style=file -i \
$(git diff --name-only | grep \.cpp\|\.h)
$ gn format $(git ls-files '*.gn' '*.gni')
`FileSystem::absolute_path()` does `stat` the file, this commit runs
all `absolute_path` calls before touching the veil to make sure this
works as intended.
The initial version of sed implements only the `s` command (given on the
command line) applied to all lines of the input file. While this is
probably the most common scenario that people use sed with in the wild,
it's limited in several ways:
* `s` is only one of the many commands that sed is meant to implement.
* Commands may take one or two addresses that limits its applicability
to input lines.
* Commands in general operate over the "pattern" and "hold" spaces
rather than blindly over input lines.
* Command line parameters include specifying a script file, and
optionally input file(s) and/or a script to execute.
This commit implements a big portion of these missing features:
* It adds support for parsing *almost* all commands and their
arguments.
* It also implements the execution of a big portion of the commands.
* It adds support for parsing the optional addresses that prefix a
command, and enables/disables commands based on these address ranges.
* It implements the pattern and hold spaces, which are the source of
input/output for most of the commands.
* It improves the command line argument handling to receive a script
file, potentially multiple execution scripts, and optional input
files.
Some know missing functionality:
* The `{` and `}` commands are not supported yet.
* Pattern-based addresses are not supported yet.
* Labels and branches are parsed, but not supported at runtime.
Similar to POSIX read, the basic read and write functions of AK::Stream
do not have a lower limit of how much data they read or write (apart
from "none at all").
Rename the functions to "read some [data]" and "write some [data]" (with
"data" being omitted, since everything here is reading and writing data)
to make them sufficiently distinct from the functions that ensure to
use the entire buffer (which should be the go-to function for most
usages).
No functional changes, just a lot of new FIXMEs.
A substitution command like "s/x/y/wabc" will now write all substituted
lines to a file called "abc". Note that this is in addition to writing
to stdout.