diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-04 18:02:33 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-06 08:54:33 +0100 |
commit | 6e19ab2bbce0b113b628e6f8e9b5c0640053933e (patch) | |
tree | 372d21b2f5dcff112f5d0089559c6af5798680d4 /Userland/Libraries/LibVideo | |
parent | f74251606d74b504a1379ebb893fdb5529054ea5 (diff) | |
download | serenity-6e19ab2bbce0b113b628e6f8e9b5c0640053933e.zip |
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 :^)
Diffstat (limited to 'Userland/Libraries/LibVideo')
6 files changed, 16 insertions, 16 deletions
diff --git a/Userland/Libraries/LibVideo/Containers/Matroska/Document.h b/Userland/Libraries/LibVideo/Containers/Matroska/Document.h index eab1174431..d827be8d02 100644 --- a/Userland/Libraries/LibVideo/Containers/Matroska/Document.h +++ b/Userland/Libraries/LibVideo/Containers/Matroska/Document.h @@ -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; }; diff --git a/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp b/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp index 1529a9f464..a8b3f107e7 100644 --- a/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp +++ b/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp @@ -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; } diff --git a/Userland/Libraries/LibVideo/Containers/Matroska/Reader.h b/Userland/Libraries/LibVideo/Containers/Matroska/Reader.h index b1c6b955bd..927adb82b6 100644 --- a/Userland/Libraries/LibVideo/Containers/Matroska/Reader.h +++ b/Userland/Libraries/LibVideo/Containers/Matroska/Reader.h @@ -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(); diff --git a/Userland/Libraries/LibVideo/DecoderError.h b/Userland/Libraries/LibVideo/DecoderError.h index 022de9de15..ed7731c909 100644 --- a/Userland/Libraries/LibVideo/DecoderError.h +++ b/Userland/Libraries/LibVideo/DecoderError.h @@ -6,10 +6,10 @@ #pragma once +#include <AK/DeprecatedString.h> #include <AK/Error.h> #include <AK/Format.h> #include <AK/SourceLocation.h> -#include <AK/String.h> #include <errno.h> namespace Video { @@ -44,7 +44,7 @@ public: static DecoderError format(DecoderErrorCategory category, CheckedFormatString<Parameters...>&& format_string, Parameters const&... parameters) { AK::VariadicFormatParams variadic_format_params { parameters... }; - return DecoderError::with_description(category, String::vformatted(format_string.view(), variadic_format_params)); + return DecoderError::with_description(category, DeprecatedString::vformatted(format_string.view(), variadic_format_params)); } static DecoderError from_source_location(DecoderErrorCategory category, StringView description, SourceLocation location = SourceLocation::current()) @@ -67,14 +67,14 @@ public: StringView string_literal() const { return m_description; } private: - DecoderError(DecoderErrorCategory category, String description) + DecoderError(DecoderErrorCategory category, DeprecatedString description) : m_category(category) , m_description(move(description)) { } DecoderErrorCategory m_category { DecoderErrorCategory::Unknown }; - String m_description; + DeprecatedString m_description; }; #define DECODER_TRY(category, expression) \ diff --git a/Userland/Libraries/LibVideo/PlaybackManager.h b/Userland/Libraries/LibVideo/PlaybackManager.h index d4b3abf59a..9fd77674b4 100644 --- a/Userland/Libraries/LibVideo/PlaybackManager.h +++ b/Userland/Libraries/LibVideo/PlaybackManager.h @@ -63,11 +63,11 @@ struct FrameQueueItem { return error; } - String debug_string() const + DeprecatedString debug_string() const { if (is_error()) return error().string_literal(); - return String::formatted("frame at {}ms", timestamp().to_milliseconds()); + return DeprecatedString::formatted("frame at {}ms", timestamp().to_milliseconds()); } private: diff --git a/Userland/Libraries/LibVideo/VP9/Parser.cpp b/Userland/Libraries/LibVideo/VP9/Parser.cpp index 7e073a0e53..b7a584a38f 100644 --- a/Userland/Libraries/LibVideo/VP9/Parser.cpp +++ b/Userland/Libraries/LibVideo/VP9/Parser.cpp @@ -5,7 +5,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <AK/String.h> +#include <AK/DeprecatedString.h> #include <LibGfx/Point.h> #include <LibGfx/Size.h> |