Text_utils.hpp

Helper functions for building Text objects with different encodings.

This file is part of Empirical, https://github.com/devosoft/Empirical Copyright (C) 2024 Michigan State University MIT Software license; see doc/LICENSE.md

Note

Status: ALPHA

Defines

INCLUDE_EMP_TEXT_TEXT_UTILS_HPP_GUARD

Functions

static const auto &GetTextSymbolNames()

A mapping of allowed symbol names to placeholder characters.

static const auto &GetTextStyleMap_FromHTML()

A mapping of html tags to the emphatic style that they represent. Since the mapping between HTML and Emphatic text encodings are useful in multiple contexts, include easy access to them here.

static const auto &GetTextStyleMap_ToHTML()

Request a map of html tags to the emphatic style that they represent. Since the mapping between HTML and Emphatic text encodings are useful in multiple contexts, include easy access to them here.

struct TextSymbolInfo
#include <Text_utils.hpp>

Public Functions

TextSymbolInfo() = default
TextSymbolInfo(const TextSymbolInfo&) = default
TextSymbolInfo(TextSymbolInfo&&) = default
inline TextSymbolInfo(String name, size_t id, String unicode, char placeholder, String desc)
auto operator<=>(const TextSymbolInfo&) const = default

Public Members

String name = ""

General symbol name (usually based on HTML name)

size_t id = 0

Unicode ID number of symbol.

String unicode = ""

Unicode sequence for symbol (usually two characters)

char placeholder = '\0'

A single character that can be used as a placeholder.

String desc = ""

English description of what symbol looks like.

String html_tag = ""

Tag to use to represent this symbol in HTML.