mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +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
|
@ -5,7 +5,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/ByteString.h>
|
||||
#include <LibSQL/BTree.h>
|
||||
#include <LibSQL/Database.h>
|
||||
#include <LibSQL/Heap.h>
|
||||
|
@ -15,7 +15,7 @@
|
|||
|
||||
namespace SQL {
|
||||
|
||||
ErrorOr<NonnullRefPtr<Database>> Database::create(DeprecatedString name)
|
||||
ErrorOr<NonnullRefPtr<Database>> Database::create(ByteString name)
|
||||
{
|
||||
auto heap = TRY(Heap::create(move(name)));
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) Database(move(heap)));
|
||||
|
@ -96,14 +96,14 @@ ResultOr<void> Database::add_schema(SchemaDef const& schema)
|
|||
return {};
|
||||
}
|
||||
|
||||
Key Database::get_schema_key(DeprecatedString const& schema_name)
|
||||
Key Database::get_schema_key(ByteString const& schema_name)
|
||||
{
|
||||
auto key = SchemaDef::make_key();
|
||||
key["schema_name"] = schema_name;
|
||||
return key;
|
||||
}
|
||||
|
||||
ResultOr<NonnullRefPtr<SchemaDef>> Database::get_schema(DeprecatedString const& schema)
|
||||
ResultOr<NonnullRefPtr<SchemaDef>> Database::get_schema(ByteString const& schema)
|
||||
{
|
||||
VERIFY(is_open());
|
||||
|
||||
|
@ -139,14 +139,14 @@ ResultOr<void> Database::add_table(TableDef& table)
|
|||
return {};
|
||||
}
|
||||
|
||||
Key Database::get_table_key(DeprecatedString const& schema_name, DeprecatedString const& table_name)
|
||||
Key Database::get_table_key(ByteString const& schema_name, ByteString const& table_name)
|
||||
{
|
||||
auto key = TableDef::make_key(get_schema_key(schema_name));
|
||||
key["table_name"] = table_name;
|
||||
return key;
|
||||
}
|
||||
|
||||
ResultOr<NonnullRefPtr<TableDef>> Database::get_table(DeprecatedString const& schema, DeprecatedString const& name)
|
||||
ResultOr<NonnullRefPtr<TableDef>> Database::get_table(ByteString const& schema, ByteString const& name)
|
||||
{
|
||||
VERIFY(is_open());
|
||||
|
||||
|
@ -160,7 +160,7 @@ ResultOr<NonnullRefPtr<TableDef>> Database::get_table(DeprecatedString const& sc
|
|||
|
||||
auto table_iterator = m_tables->find(key);
|
||||
if (table_iterator.is_end() || (*table_iterator != key))
|
||||
return Result { SQLCommand::Unknown, SQLErrorCode::TableDoesNotExist, DeprecatedString::formatted("{}.{}", schema_name, name) };
|
||||
return Result { SQLCommand::Unknown, SQLErrorCode::TableDoesNotExist, ByteString::formatted("{}.{}", schema_name, name) };
|
||||
|
||||
auto schema_def = TRY(get_schema(schema));
|
||||
auto table_def = TRY(TableDef::create(schema_def, name));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue