#pragma once #include "types.hpp" #include "Range.hpp" #include #include #include 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; void parseOutgoingMessage(const char *text, usize size, const EmojiBindMap &emojiBindMap, std::function callbackFunc); }