1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 08:27:46 +00:00

AK+Everywhere: Rename String to DeprecatedString

We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
This commit is contained in:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -87,12 +87,12 @@ PDFErrorOr<NonnullRefPtr<PDFFont>> PDFFont::create(Document* document, NonnullRe
TODO();
}
Tuple<String, String> PDFFont::replacement_for_standard_latin_font(StringView name)
Tuple<DeprecatedString, DeprecatedString> PDFFont::replacement_for_standard_latin_font(StringView name)
{
bool is_bold = name.contains("bold"sv);
bool is_italic = name.contains("italic"sv);
String font_variant;
DeprecatedString font_variant;
if (is_bold && is_italic) {
font_variant = "BoldItalic";

View file

@ -47,7 +47,7 @@ public:
virtual Type type() const = 0;
protected:
static Tuple<String, String> replacement_for_standard_latin_font(StringView);
static Tuple<DeprecatedString, DeprecatedString> replacement_for_standard_latin_font(StringView);
bool m_is_standard_font { false };
};

View file

@ -361,7 +361,7 @@ PDFErrorOr<PS1FontProgram::Glyph> PS1FontProgram::parse_glyph(ReadonlyBytes cons
}
default:
return error(String::formatted("Unhandled command: 12 {}", data[i]));
return error(DeprecatedString::formatted("Unhandled command: 12 {}", data[i]));
}
break;
}
@ -447,7 +447,7 @@ PDFErrorOr<PS1FontProgram::Glyph> PS1FontProgram::parse_glyph(ReadonlyBytes cons
}
default:
return error(String::formatted("Unhandled command: {}", v));
return error(DeprecatedString::formatted("Unhandled command: {}", v));
}
}
}
@ -560,7 +560,7 @@ PDFErrorOr<Vector<float>> PS1FontProgram::parse_number_array(Reader& reader, siz
return array;
}
PDFErrorOr<String> PS1FontProgram::parse_word(Reader& reader)
PDFErrorOr<DeprecatedString> PS1FontProgram::parse_word(Reader& reader)
{
reader.consume_whitespace();
@ -579,7 +579,7 @@ PDFErrorOr<String> PS1FontProgram::parse_word(Reader& reader)
PDFErrorOr<float> PS1FontProgram::parse_float(Reader& reader)
{
auto word = TRY(parse_word(reader));
return strtof(String(word).characters(), nullptr);
return strtof(DeprecatedString(word).characters(), nullptr);
}
PDFErrorOr<int> PS1FontProgram::parse_int(Reader& reader)
@ -609,7 +609,7 @@ PDFErrorOr<ByteBuffer> PS1FontProgram::decrypt(ReadonlyBytes const& encrypted, u
return decrypted;
}
bool PS1FontProgram::seek_name(Reader& reader, String const& name)
bool PS1FontProgram::seek_name(Reader& reader, DeprecatedString const& name)
{
auto start = reader.offset();
@ -631,7 +631,7 @@ bool PS1FontProgram::seek_name(Reader& reader, String const& name)
}
Error PS1FontProgram::error(
String const& message
DeprecatedString const& message
#ifdef PDF_DEBUG
,
SourceLocation loc

View file

@ -54,15 +54,15 @@ private:
PDFErrorOr<void> parse_encrypted_portion(ByteBuffer const&);
PDFErrorOr<Vector<ByteBuffer>> parse_subroutines(Reader&);
PDFErrorOr<Vector<float>> parse_number_array(Reader&, size_t length);
PDFErrorOr<String> parse_word(Reader&);
PDFErrorOr<DeprecatedString> parse_word(Reader&);
PDFErrorOr<float> parse_float(Reader&);
PDFErrorOr<int> parse_int(Reader&);
PDFErrorOr<ByteBuffer> decrypt(ReadonlyBytes const&, u16 key, size_t skip);
bool seek_name(Reader&, String const&);
bool seek_name(Reader&, DeprecatedString const&);
static Error error(
String const& message
DeprecatedString const& message
#ifdef PDF_DEBUG
,
SourceLocation loc = SourceLocation::current()

View file

@ -11,8 +11,8 @@
namespace PDF {
struct CIDSystemInfo {
String registry;
String ordering;
DeprecatedString registry;
DeprecatedString ordering;
u8 supplement;
};