blob: c3e8e84bd94c40f974bf726325b0ba0037516773 (
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
31
32
33
|
#pragma once
#include "types.hpp"
#include "Range.hpp"
#include <functional>
#include <unordered_map>
#include <string>
namespace dchat
{
struct OutgoingMessagePart
{
enum class Type
{
TEXT,
EMOJI
};
Type type;
union
{
Range textRange;
const std::string *emoji;
};
OutgoingMessagePart(Type _type, Range _textRange) : type(_type), textRange(_textRange) {}
OutgoingMessagePart(Type _type, const std::string *_emoji) : type(_type), emoji(_emoji) {}
};
using EmojiBindMap = std::unordered_map<std::string, std::string>;
void parseOutgoingMessage(const char *text, usize size, const EmojiBindMap &emojiBindMap, std::function<void(OutgoingMessagePart)> callbackFunc);
}
|