/* * Copyright (c) 2021, Cesar Torres * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include // Extended M3U fields (de facto standard) struct M3UExtendedInfo { Optional track_length_in_seconds; Optional track_display_title; Optional group_name; Optional album_title; Optional album_artist; Optional album_genre; Optional file_size_in_bytes; Optional embedded_mp3; Optional cover_path; }; struct M3UEntry { DeprecatedString path; Optional extended_info; }; class M3UParser { public: static NonnullOwnPtr from_file(StringView path); static NonnullOwnPtr from_memory(DeprecatedString const& m3u_contents, bool utf8); NonnullOwnPtr> parse(bool include_extended_info); Optional& get_playlist_title_metadata() { return m_parsed_playlist_title; } M3UParser(); private: DeprecatedString m_m3u_raw_data; DeprecatedString m_playlist_path; bool m_use_utf8; Optional m_parsed_playlist_title; };