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

@ -6,44 +6,44 @@
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/Optional.h>
#include <AK/RefPtr.h>
#include <AK/String.h>
#include <AK/StringView.h>
#include <AK/Vector.h>
// Extended M3U fields (de facto standard)
struct M3UExtendedInfo {
Optional<u32> track_length_in_seconds;
Optional<String> track_display_title;
Optional<String> group_name;
Optional<String> album_title;
Optional<String> album_artist;
Optional<String> album_genre;
Optional<DeprecatedString> track_display_title;
Optional<DeprecatedString> group_name;
Optional<DeprecatedString> album_title;
Optional<DeprecatedString> album_artist;
Optional<DeprecatedString> album_genre;
Optional<u64> file_size_in_bytes;
Optional<ReadonlyBytes> embedded_mp3;
Optional<String> cover_path;
Optional<DeprecatedString> cover_path;
};
struct M3UEntry {
String path;
DeprecatedString path;
Optional<M3UExtendedInfo> extended_info;
};
class M3UParser {
public:
static NonnullOwnPtr<M3UParser> from_file(StringView path);
static NonnullOwnPtr<M3UParser> from_memory(String const& m3u_contents, bool utf8);
static NonnullOwnPtr<M3UParser> from_memory(DeprecatedString const& m3u_contents, bool utf8);
NonnullOwnPtr<Vector<M3UEntry>> parse(bool include_extended_info);
Optional<String>& get_playlist_title_metadata() { return m_parsed_playlist_title; }
Optional<DeprecatedString>& get_playlist_title_metadata() { return m_parsed_playlist_title; }
M3UParser();
private:
String m_m3u_raw_data;
String m_playlist_path;
DeprecatedString m_m3u_raw_data;
DeprecatedString m_playlist_path;
bool m_use_utf8;
Optional<String> m_parsed_playlist_title;
Optional<DeprecatedString> m_parsed_playlist_title;
};