29 lines
403 B
C++
29 lines
403 B
C++
#pragma once
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
enum class UrlType {
|
|
SpotifyTrack,
|
|
SpotifyPlaylist,
|
|
SpotifyAlbum,
|
|
SpotifyArtist,
|
|
|
|
YoutubeVideo,
|
|
YoutubePlaylist,
|
|
|
|
Unknown
|
|
};
|
|
|
|
struct ParsedUrl {
|
|
UrlType type;
|
|
std::string id;
|
|
};
|
|
|
|
std::ostream &operator<<(std::ostream &os, UrlType type);
|
|
|
|
class UrlParser {
|
|
public:
|
|
static std::optional<ParsedUrl> parse(const std::string &url);
|
|
};
|