1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:47:44 +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:
Ali Mohammad Pur 2023-12-16 17:49:34 +03:30 committed by Ali Mohammad Pur
parent 38d62563b3
commit 5e1499d104
1615 changed files with 10257 additions and 10257 deletions

View file

@ -6,7 +6,7 @@
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/ByteString.h>
#include <AK/NonnullRefPtr.h>
#include <AK/RefCounted.h>
#include <AK/Result.h>
@ -28,7 +28,7 @@ class Relation : public RefCounted<Relation> {
public:
virtual ~Relation() = default;
DeprecatedString const& name() const { return m_name; }
ByteString const& name() const { return m_name; }
Relation const* parent() const { return m_parent; }
u32 hash() const;
@ -37,27 +37,27 @@ public:
virtual Key key() const = 0;
protected:
Relation(DeprecatedString name, Block::Index block_index, Relation* parent = nullptr)
Relation(ByteString name, Block::Index block_index, Relation* parent = nullptr)
: m_name(move(name))
, m_block_index(block_index)
, m_parent(parent)
{
}
explicit Relation(DeprecatedString name, Relation* parent = nullptr)
explicit Relation(ByteString name, Relation* parent = nullptr)
: Relation(move(name), 0, parent)
{
}
private:
DeprecatedString m_name;
ByteString m_name;
Block::Index m_block_index { 0 };
Relation const* m_parent { nullptr };
};
class SchemaDef : public Relation {
public:
static ErrorOr<NonnullRefPtr<SchemaDef>> create(DeprecatedString name);
static ErrorOr<NonnullRefPtr<SchemaDef>> create(ByteString name);
static ErrorOr<NonnullRefPtr<SchemaDef>> create(Key const&);
Key key() const override;
@ -65,12 +65,12 @@ public:
static Key make_key();
private:
explicit SchemaDef(DeprecatedString);
explicit SchemaDef(ByteString);
};
class ColumnDef : public Relation {
public:
static ErrorOr<NonnullRefPtr<ColumnDef>> create(Relation*, size_t, DeprecatedString, SQLType);
static ErrorOr<NonnullRefPtr<ColumnDef>> create(Relation*, size_t, ByteString, SQLType);
Key key() const override;
SQLType type() const { return m_type; }
@ -84,7 +84,7 @@ public:
static Key make_key(TableDef const&);
protected:
ColumnDef(Relation*, size_t, DeprecatedString, SQLType);
ColumnDef(Relation*, size_t, ByteString, SQLType);
private:
size_t m_index;
@ -95,32 +95,32 @@ private:
class KeyPartDef : public ColumnDef {
public:
static ErrorOr<NonnullRefPtr<KeyPartDef>> create(IndexDef*, DeprecatedString, SQLType, Order = Order::Ascending);
static ErrorOr<NonnullRefPtr<KeyPartDef>> create(IndexDef*, ByteString, SQLType, Order = Order::Ascending);
Order sort_order() const { return m_sort_order; }
private:
KeyPartDef(IndexDef*, DeprecatedString, SQLType, Order);
KeyPartDef(IndexDef*, ByteString, SQLType, Order);
Order m_sort_order { Order::Ascending };
};
class IndexDef : public Relation {
public:
static ErrorOr<NonnullRefPtr<IndexDef>> create(TableDef*, DeprecatedString, bool unique = true, u32 pointer = 0);
static ErrorOr<NonnullRefPtr<IndexDef>> create(DeprecatedString, bool unique = true, u32 pointer = 0);
static ErrorOr<NonnullRefPtr<IndexDef>> create(TableDef*, ByteString, bool unique = true, u32 pointer = 0);
static ErrorOr<NonnullRefPtr<IndexDef>> create(ByteString, bool unique = true, u32 pointer = 0);
Vector<NonnullRefPtr<KeyPartDef>> const& key_definition() const { return m_key_definition; }
bool unique() const { return m_unique; }
[[nodiscard]] size_t size() const { return m_key_definition.size(); }
void append_column(DeprecatedString, SQLType, Order = Order::Ascending);
void append_column(ByteString, SQLType, Order = Order::Ascending);
Key key() const override;
[[nodiscard]] NonnullRefPtr<TupleDescriptor> to_tuple_descriptor() const;
static NonnullRefPtr<IndexDef> index_def();
static Key make_key(TableDef const& table_def);
private:
IndexDef(TableDef*, DeprecatedString, bool unique, u32 pointer);
IndexDef(TableDef*, ByteString, bool unique, u32 pointer);
Vector<NonnullRefPtr<KeyPartDef>> m_key_definition;
bool m_unique { false };
@ -130,10 +130,10 @@ private:
class TableDef : public Relation {
public:
static ErrorOr<NonnullRefPtr<TableDef>> create(SchemaDef*, DeprecatedString);
static ErrorOr<NonnullRefPtr<TableDef>> create(SchemaDef*, ByteString);
Key key() const override;
void append_column(DeprecatedString, SQLType);
void append_column(ByteString, SQLType);
void append_column(Key const&);
size_t num_columns() { return m_columns.size(); }
size_t num_indexes() { return m_indexes.size(); }
@ -146,7 +146,7 @@ public:
static Key make_key(Key const& schema_key);
private:
explicit TableDef(SchemaDef*, DeprecatedString);
explicit TableDef(SchemaDef*, ByteString);
Vector<NonnullRefPtr<ColumnDef>> m_columns;
Vector<NonnullRefPtr<IndexDef>> m_indexes;