mirror-chatterino2/src/providers/twitch/TwitchBadges.hpp

33 lines
646 B
C++
Raw Normal View History

2018-08-02 14:23:27 +02:00
#pragma once
#include <QString>
2018-08-14 17:45:17 +02:00
#include <boost/optional.hpp>
2018-08-02 14:23:27 +02:00
#include <unordered_map>
2018-08-14 17:45:17 +02:00
#include "common/UniqueAccess.hpp"
2018-08-02 14:23:27 +02:00
#include "util/QStringHash.hpp"
namespace chatterino {
struct Emote;
using EmotePtr = std::shared_ptr<const Emote>;
2018-08-02 14:23:27 +02:00
class Settings;
class Paths;
class TwitchBadges
{
public:
2018-08-14 17:45:17 +02:00
void loadTwitchBadges();
2018-08-02 14:23:27 +02:00
2018-08-14 17:45:17 +02:00
boost::optional<EmotePtr> badge(const QString &set,
const QString &version) const;
2018-08-02 14:23:27 +02:00
private:
2018-08-14 17:45:17 +02:00
UniqueAccess<
std::unordered_map<QString, std::unordered_map<QString, EmotePtr>>>
badgeSets_; // "bits": { "100": ... "500": ...
2018-08-02 14:23:27 +02:00
};
} // namespace chatterino