summaryrefslogtreecommitdiffstats
blob: e2c599cdebf5ce332a4749d9578c23d8e1824596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright (c) 2016-2017 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#pragma once

#include <string>
#include <unordered_map>
#include <vector>

namespace Swift {
    class EmojiMapper {
        public:
            static std::string shortnameToUnicode(const std::string& shortname);
            static std::string unicodeToShortname(const std::string& unicode);
            static std::vector<std::string> categoryNameToEmojis(const std::string& category);
            static std::string categoryToFlagshipUnicodeEmoji(const std::string& category);
            static std::vector<std::string> getCategories();

        public:
            // \ref shortnameUnicode maps ASCII shortnames (e.g. joy, grin, smiley, …) to a emoji UTF-8 encoded unicode sequence.
            static const std::unordered_map<std::string, std::string> shortnameUnicode;
            // \ref unicodeShortname is the reverse mapping of \ref shortnameUnicode.
            static const std::unordered_map<std::string, std::string> unicodeShortname;
            // \ref emojisInCategory maps an emoji category name to a \ref std::vector of UTF-8 encoded unicode sequence strings.
            static const std::unordered_map<std::string, std::vector<std::string>> emojisInCategory;
    };
}