TextEncoding.hpp
Plugs into Text with the specification of a given encoding.
Functions
-
template<typename ENCODING_T, typename ...Ts>
Text MakeEncodedText(Ts&&... args)
-
class TextEncoding : public TextEncoding_Interface
#include <TextEncoding.hpp>
Subclassed by EmphaticEncoding, HTMLEncoding
Public Functions
-
inline TextEncoding()
-
~TextEncoding() = default
-
inline void Reset()
-
inline virtual void Append(Text &text, const String &in) override
-
inline virtual String Encode(const Text &text) const override
-
inline virtual void PrintDebug(std::ostream &os = std::cout) const override
Protected Functions
-
inline size_t GetTagID(const String &tag_name, const String &tag_pattern)
-
inline size_t GetTagID(const String &tag_name)
-
inline Style &GetStyle(const String &style_name)
-
inline void SetupStyleTags(String style_name, String open_name, String close_name)
-
inline void SetupReplaceTag(String tag_name, char replace_char, String style_name = "")
-
inline String GetStyleDesc(const Style &style, const Tag &start_tag, const String &lexeme)
-
inline void Append_RawText(Text &text, const String &in)
-
inline void Append_Tag(Text &text, int token_id, const String &lexeme)
-
inline void SetupLexer()
-
inline void _EncodeChar(const Text &text, String &out_string, const size_t char_pos) const
-
inline void _EncodeTo(const Text &text, String &out_string, size_t &start, const size_t end) const
-
inline void AddOutputTags(const Text &text, std::map<size_t, String> &tag_map, String style, String start_tag, String end_tag) const
-
struct Style
#include <TextEncoding.hpp>
-
struct StyleEntry
#include <TextEncoding.hpp>
Public Members
-
size_t style_id
-
String full_info
-
struct Tag
#include <TextEncoding.hpp>
Public Members
-
String name
-
String pattern
-
size_t id = MAX_SIZE_T
-
int token_id = -1
-
size_t start_style_id = 0
-
std::function<String(String)> get_style_args
-
std::set<size_t> end_style_ids
-
bool multi_end = false
-
char replace_char = '\0'
-
size_t replace_style_id = 0
-
String out_encoding = ""