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

@ -7,11 +7,11 @@
#pragma once
#include <AK/ByteBuffer.h>
#include <AK/DeprecatedString.h>
#include <AK/FlyString.h>
#include <AK/HashMap.h>
#include <AK/NonnullOwnPtrVector.h>
#include <AK/OwnPtr.h>
#include <AK/String.h>
#include <AK/Time.h>
#include <AK/Utf8View.h>
#include <LibVideo/Color/CodingIndependentCodePoints.h>
@ -19,7 +19,7 @@
namespace Video::Matroska {
struct EBMLHeader {
String doc_type;
DeprecatedString doc_type;
u32 doc_type_version;
};
@ -28,9 +28,9 @@ public:
u64 timestamp_scale() const { return m_timestamp_scale; }
void set_timestamp_scale(u64 timestamp_scale) { m_timestamp_scale = timestamp_scale; }
Utf8View muxing_app() const { return Utf8View(m_muxing_app); }
void set_muxing_app(String muxing_app) { m_muxing_app = move(muxing_app); }
void set_muxing_app(DeprecatedString muxing_app) { m_muxing_app = move(muxing_app); }
Utf8View writing_app() const { return Utf8View(m_writing_app); }
void set_writing_app(String writing_app) { m_writing_app = move(writing_app); }
void set_writing_app(DeprecatedString writing_app) { m_writing_app = move(writing_app); }
Optional<double> duration_unscaled() const { return m_duration_unscaled; }
void set_duration_unscaled(double duration) { m_duration_unscaled.emplace(duration); }
Optional<Time> duration() const
@ -42,8 +42,8 @@ public:
private:
u64 m_timestamp_scale { 1'000'000 };
String m_muxing_app;
String m_writing_app;
DeprecatedString m_muxing_app;
DeprecatedString m_writing_app;
Optional<double> m_duration_unscaled;
};

View file

@ -949,12 +949,12 @@ DecoderErrorOr<void> SampleIterator::seek_to_cue_point(CuePoint const& cue_point
return {};
}
ErrorOr<String> Streamer::read_string()
ErrorOr<DeprecatedString> Streamer::read_string()
{
auto string_length = TRY(read_variable_size_integer());
if (remaining() < string_length)
return Error::from_string_literal("String length extends past the end of the stream");
auto string_value = String(data_as_chars(), string_length);
auto string_value = DeprecatedString(data_as_chars(), string_length);
TRY(read_raw_octets(string_length));
return string_value;
}

View file

@ -147,7 +147,7 @@ public:
ErrorOr<u64> read_u64();
ErrorOr<double> read_float();
ErrorOr<String> read_string();
ErrorOr<DeprecatedString> read_string();
ErrorOr<void> read_unknown_element();