1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +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,8 +6,8 @@
#pragma once
#include <AK/ByteString.h>
#include <AK/Debug.h>
#include <AK/DeprecatedString.h>
#include <AK/Function.h>
#include <AK/GenericLexer.h>
#include <AK/HashMap.h>
@ -23,16 +23,16 @@ namespace XML {
struct ParseError {
size_t offset;
DeprecatedString error;
ByteString error;
};
struct Listener {
virtual ~Listener() { }
virtual void set_source(DeprecatedString) { }
virtual void set_source(ByteString) { }
virtual void document_start() { }
virtual void document_end() { }
virtual void element_start(Name const&, HashMap<Name, DeprecatedString> const&) { }
virtual void element_start(Name const&, HashMap<Name, ByteString> const&) { }
virtual void element_end(Name const&) { }
virtual void text(StringView) { }
virtual void comment(StringView) { }
@ -57,7 +57,7 @@ public:
bool preserve_cdata { true };
bool preserve_comments { false };
bool treat_errors_as_fatal { true };
Function<ErrorOr<DeprecatedString>(SystemID const&, Optional<PublicID> const&)> resolve_external_resource {};
Function<ErrorOr<ByteString>(SystemID const&, Optional<PublicID> const&)> resolve_external_resource {};
};
Parser(StringView source, Options options)
@ -94,7 +94,7 @@ private:
AttributeValue,
Content,
};
ErrorOr<DeprecatedString, ParseError> resolve_reference(EntityReference const&, ReferencePlacement);
ErrorOr<ByteString, ParseError> resolve_reference(EntityReference const&, ReferencePlacement);
enum class Required {
No,
@ -120,12 +120,12 @@ private:
ErrorOr<Name, ParseError> parse_end_tag();
ErrorOr<void, ParseError> parse_content();
ErrorOr<Attribute, ParseError> parse_attribute();
ErrorOr<DeprecatedString, ParseError> parse_attribute_value();
ErrorOr<Variant<EntityReference, DeprecatedString>, ParseError> parse_reference();
ErrorOr<ByteString, ParseError> parse_attribute_value();
ErrorOr<Variant<EntityReference, ByteString>, ParseError> parse_reference();
ErrorOr<StringView, ParseError> parse_char_data();
ErrorOr<Vector<MarkupDeclaration>, ParseError> parse_internal_subset();
ErrorOr<Optional<MarkupDeclaration>, ParseError> parse_markup_declaration();
ErrorOr<Optional<DeprecatedString>, ParseError> parse_declaration_separator();
ErrorOr<Optional<ByteString>, ParseError> parse_declaration_separator();
ErrorOr<Vector<MarkupDeclaration>, ParseError> parse_external_subset_declaration();
ErrorOr<ElementDeclaration, ParseError> parse_element_declaration();
ErrorOr<AttributeListDeclaration, ParseError> parse_attribute_list_declaration();
@ -140,12 +140,12 @@ private:
ErrorOr<PublicID, ParseError> parse_public_id();
ErrorOr<SystemID, ParseError> parse_system_id();
ErrorOr<ExternalID, ParseError> parse_external_id();
ErrorOr<DeprecatedString, ParseError> parse_entity_value();
ErrorOr<ByteString, ParseError> parse_entity_value();
ErrorOr<Name, ParseError> parse_notation_data_declaration();
ErrorOr<StringView, ParseError> parse_public_id_literal();
ErrorOr<StringView, ParseError> parse_system_id_literal();
ErrorOr<StringView, ParseError> parse_cdata_section();
ErrorOr<DeprecatedString, ParseError> parse_attribute_value_inner(StringView disallow);
ErrorOr<ByteString, ParseError> parse_attribute_value_inner(StringView disallow);
ErrorOr<Vector<MarkupDeclaration>, ParseError> parse_external_subset();
ErrorOr<void, ParseError> parse_text_declaration();
@ -198,7 +198,7 @@ private:
rule_name = rule_name.substring_view(6);
m_parse_errors.append({
error.offset,
DeprecatedString::formatted("{}: {}", rule_name, error.error),
ByteString::formatted("{}: {}", rule_name, error.error),
});
}
return error;
@ -213,11 +213,11 @@ private:
Node* m_entered_node { nullptr };
Version m_version { Version::Version11 };
bool m_in_compatibility_mode { false };
DeprecatedString m_encoding;
ByteString m_encoding;
bool m_standalone { false };
HashMap<Name, DeprecatedString> m_processing_instructions;
HashMap<Name, ByteString> m_processing_instructions;
struct AcceptedRule {
Optional<DeprecatedString> rule {};
Optional<ByteString> rule {};
bool accept { false };
} m_current_rule {};