mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:57:35 +00:00
Everywhere: Rename {Deprecated => Byte}String
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')
This commit is contained in:
parent
38d62563b3
commit
5e1499d104
1615 changed files with 10257 additions and 10257 deletions
|
@ -6,22 +6,22 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
|
||||
struct MountInfo {
|
||||
DeprecatedString mount_point;
|
||||
DeprecatedString source;
|
||||
ByteString mount_point;
|
||||
ByteString source;
|
||||
};
|
||||
|
||||
class TreeNode final {
|
||||
public:
|
||||
TreeNode(DeprecatedString name)
|
||||
TreeNode(ByteString name)
|
||||
: m_name(move(name)) {};
|
||||
|
||||
DeprecatedString name() const { return m_name; }
|
||||
ByteString name() const { return m_name; }
|
||||
i64 area() const { return m_area; }
|
||||
size_t num_children() const
|
||||
{
|
||||
|
@ -31,21 +31,21 @@ public:
|
|||
return 0;
|
||||
}
|
||||
TreeNode const& child_at(size_t i) const { return m_children->at(i); }
|
||||
Optional<TreeNode const&> child_with_name(DeprecatedString name) const;
|
||||
Optional<TreeNode const&> child_with_name(ByteString name) const;
|
||||
void sort_children_by_area() const;
|
||||
HashMap<int, int> populate_filesize_tree(Vector<MountInfo>& mounts, Function<void(size_t)> on_progress);
|
||||
|
||||
private:
|
||||
long long int update_totals();
|
||||
|
||||
DeprecatedString m_name;
|
||||
ByteString m_name;
|
||||
i64 m_area { 0 };
|
||||
OwnPtr<Vector<TreeNode>> m_children;
|
||||
};
|
||||
|
||||
class Tree {
|
||||
public:
|
||||
static ErrorOr<NonnullOwnPtr<Tree>> create(DeprecatedString root_name)
|
||||
static ErrorOr<NonnullOwnPtr<Tree>> create(ByteString root_name)
|
||||
{
|
||||
return adopt_nonnull_own_or_enomem(new (nothrow) Tree(move(root_name)));
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
Tree(DeprecatedString root_name)
|
||||
Tree(ByteString root_name)
|
||||
: m_root(move(root_name)) {};
|
||||
TreeNode m_root;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue