1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:27: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:
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

@ -9,7 +9,7 @@
#include "Cell.h"
#include "Forward.h"
#include "Readers/XSV.h"
#include <AK/DeprecatedString.h>
#include <AK/ByteString.h>
#include <AK/HashMap.h>
#include <AK/HashTable.h>
#include <AK/StringBuilder.h>
@ -23,7 +23,7 @@ namespace Spreadsheet {
class CellChange {
public:
CellChange(Cell&, DeprecatedString const&);
CellChange(Cell&, ByteString const&);
CellChange(Cell&, CellTypeMetadata const&);
auto& cell() { return m_cell; }
@ -34,8 +34,8 @@ public:
private:
Cell& m_cell;
DeprecatedString m_previous_data;
DeprecatedString m_new_data;
ByteString m_previous_data;
ByteString m_new_data;
CellTypeMetadata m_previous_type_metadata;
CellTypeMetadata m_new_type_metadata;
};
@ -51,7 +51,7 @@ public:
Optional<Position> parse_cell_name(StringView) const;
Optional<size_t> column_index(StringView column_name) const;
Optional<DeprecatedString> column_arithmetic(StringView column_name, int offset);
Optional<ByteString> column_arithmetic(StringView column_name, int offset);
Cell* from_url(const URL&);
Cell const* from_url(const URL& url) const { return const_cast<Sheet*>(this)->from_url(url); }
@ -64,10 +64,10 @@ public:
JsonObject to_json() const;
static RefPtr<Sheet> from_json(JsonObject const&, Workbook&);
Vector<Vector<DeprecatedString>> to_xsv() const;
Vector<Vector<ByteString>> to_xsv() const;
static RefPtr<Sheet> from_xsv(Reader::XSV const&, Workbook&);
DeprecatedString const& name() const { return m_name; }
ByteString const& name() const { return m_name; }
void set_name(StringView name) { m_name = name; }
JsonObject gather_documentation() const;
@ -89,17 +89,17 @@ public:
if (auto cell = at(position))
return *cell;
m_cells.set(position, make<Cell>(DeprecatedString::empty(), position, *this));
m_cells.set(position, make<Cell>(ByteString::empty(), position, *this));
return *at(position);
}
size_t add_row();
DeprecatedString add_column();
ByteString add_column();
size_t row_count() const { return m_rows; }
size_t column_count() const { return m_columns.size(); }
Vector<DeprecatedString> const& columns() const { return m_columns; }
DeprecatedString const& column(size_t index)
Vector<ByteString> const& columns() const { return m_columns; }
ByteString const& column(size_t index)
{
for (size_t i = column_count(); i < index; ++i)
add_column();
@ -107,7 +107,7 @@ public:
VERIFY(column_count() > index);
return m_columns[index];
}
DeprecatedString const& column(size_t index) const
ByteString const& column(size_t index) const
{
VERIFY(column_count() > index);
return m_columns[index];
@ -145,7 +145,7 @@ public:
bool columns_are_standard() const;
DeprecatedString generate_inline_documentation_for(StringView function, size_t argument_index);
ByteString generate_inline_documentation_for(StringView function, size_t argument_index);
JS::Realm& realm() const { return *m_root_execution_context->realm; }
JS::VM& vm() const { return realm().vm(); }
@ -154,8 +154,8 @@ private:
explicit Sheet(Workbook&);
explicit Sheet(StringView name, Workbook&);
DeprecatedString m_name;
Vector<DeprecatedString> m_columns;
ByteString m_name;
Vector<ByteString> m_columns;
size_t m_rows { 0 };
HashMap<Position, NonnullOwnPtr<Cell>> m_cells;
HashTable<Position> m_selected_cells;