Project Alice
Loading...
Searching...
No Matches
text.cpp File Reference
#include <string_view>
#include "nations.hpp"
#include "text.hpp"
#include "system_state.hpp"
#include "parsers.hpp"
#include "simple_fs.hpp"
#include <type_traits>
#include <unicode/ubrk.h>
#include <unicode/utypes.h>
#include <unicode/ubidi.h>
Include dependency graph for text.cpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  text
 
namespace  text::impl
 

Macros

#define CT_STRING_ENUM(X)   else if(is_fixed_token_ci(v, #X)) return variable_type::X;
 

Functions

text_color text::char_to_color (char in)
 
bool text::is_qmark_color (char in)
 
std::string text::lowercase_str (std::string_view sv)
 
uint32_t text::codepoint_from_utf8 (char const *start, char const *end)
 
size_t text::size_from_utf8 (char const *start, char const *)
 
bool text::codepoint_is_space (uint32_t c) noexcept
 
bool text::codepoint_is_line_break (uint32_t c) noexcept
 
void text::consume_csv_file (sys::state &state, char const *file_content, uint32_t file_size, int32_t target_column, bool as_unicode)
 
template<size_t N>
bool text::is_fixed_token_ci (std::string_view v, char const (&t)[N])
 
variable_type text::variable_type_from_name (std::string_view v)
 
char16_t text::win1250toUTF16 (char in)
 
std::string text::produce_simple_string (sys::state const &state, dcon::text_key id)
 
std::string text::produce_simple_string (sys::state const &state, std::string_view txt)
 
dcon::text_key text::find_or_add_key (sys::state &state, std::string_view key, bool as_unicode)
 
std::string text::prettify_currency (float num)
 
std::string text::prettify (int64_t num)
 
std::string text::get_short_state_name (sys::state &state, dcon::state_instance_id state_id)
 
std::string text::get_dynamic_state_name (sys::state &state, dcon::state_instance_id state_id)
 
std::string text::get_province_state_name (sys::state &state, dcon::province_id prov_id)
 
dcon::text_key text::get_name (sys::state &state, dcon::nation_id id)
 
dcon::text_key text::get_adjective (sys::state &state, dcon::nation_id id)
 
dcon::text_key text::get_ruler_title (sys::state &state, dcon::nation_id n)
 
std::string text::get_focus_category_name (sys::state const &state, nations::focus_type category)
 
std::string text::get_influence_level_name (sys::state const &state, uint8_t v)
 
std::string text::format_percentage (float num, size_t digits)
 
std::string text::format_float (float num, size_t digits)
 
std::string text::format_money (float num)
 
std::string text::format_wholenum (int32_t num)
 
std::string text::format_ratio (int32_t left, int32_t right)
 
void text::add_to_substitution_map (substitution_map &mp, variable_type key, substitution value)
 
dcon::text_key text::localize_month (sys::state const &state, uint16_t month)
 
std::string text::date_to_string (sys::state &state, sys::date date)
 
endless_layout text::create_endless_layout (sys::state &state, layout &dest, layout_parameters const &params)
 
void text::impl::lb_finish_line (layout_base &dest, layout_box &box, int32_t line_height)
 
void text::add_line_break_to_layout_box (sys::state &state, layout_base &dest, layout_box &box)
 
void text::add_line_break_to_layout (sys::state &state, columnar_layout &dest)
 
void text::add_line_break_to_layout (sys::state &state, endless_layout &dest)
 
void text::add_to_layout_box (sys::state &state, layout_base &dest, layout_box &box, embedded_flag ico)
 
void text::add_to_layout_box (sys::state &state, layout_base &dest, layout_box &box, embedded_icon ico)
 
void text::add_to_layout_box (sys::state &state, layout_base &dest, layout_box &box, embedded_unit_icon ico)
 
text::alignment text::localized_alignment (sys::state &state, text::alignment in)
 
ui::alignment text::localized_alignment (sys::state &state, ui::alignment in)
 
text::alignment text::to_text_alignment (ui::alignment in)
 
void text::add_to_layout_box (sys::state &state, layout_base &dest, layout_box &box, std::string_view text, text_color color, substitution source)
 
std::string text::impl::lb_resolve_substitution (sys::state &state, substitution sub, substitution_map const &mp)
 
void text::add_unparsed_text_to_layout_box (sys::state &state, layout_base &dest, layout_box &box, std::string_view sv, substitution_map const &mp)
 
void text::add_to_layout_box (sys::state &state, layout_base &dest, layout_box &box, dcon::text_key source_text, substitution_map const &mp)
 
void text::add_to_layout_box (sys::state &state, layout_base &dest, layout_box &box, substitution val, text_color color)
 
void text::add_to_layout_box (sys::state &state, layout_base &dest, layout_box &box, std::string const &val, text_color color)
 
void text::add_space_to_layout_box (sys::state &state, layout_base &dest, layout_box &box)
 
layout_box text::open_layout_box (layout_base &dest, int32_t indent)
 
void text::close_layout_box (columnar_layout &dest, layout_box &box)
 
void text::close_layout_box (endless_layout &dest, layout_box &box)
 
void text::close_layout_box (single_line_layout &dest, layout_box &box)
 
void text::close_layout_box (layout_base &dest, layout_box &box)
 
columnar_layout text::create_columnar_layout (sys::state &state, layout &dest, layout_parameters const &params, int32_t column_width)
 
void text::localised_format_box (sys::state &state, layout_base &dest, layout_box &box, std::string_view key, text::substitution_map const &sub)
 
void text::localised_single_sub_box (sys::state &state, layout_base &dest, layout_box &box, std::string_view key, variable_type subkey, substitution value)
 
void text::add_line (sys::state &state, layout_base &dest, dcon::text_key txt, int32_t indent)
 
void text::add_line (sys::state &state, layout_base &dest, dcon::text_key txt, variable_type subkey, substitution value, int32_t indent)
 
void text::add_line (sys::state &state, layout_base &dest, dcon::text_key txt, variable_type subkey, substitution value, variable_type subkey_b, substitution value_b, int32_t indent)
 
void text::add_line (sys::state &state, layout_base &dest, dcon::text_key txt, variable_type subkey, substitution value, variable_type subkey_b, substitution value_b, variable_type subkey_c, substitution value_c, int32_t indent)
 
void text::add_line (sys::state &state, layout_base &dest, dcon::text_key txt, variable_type subkey, substitution value, variable_type subkey_b, substitution value_b, variable_type subkey_c, substitution value_c, variable_type subkey_d, substitution value_d, int32_t indent)
 
void text::add_line (sys::state &state, layout_base &dest, std::string_view key, int32_t indent)
 
void text::add_line_with_condition (sys::state &state, layout_base &dest, std::string_view key, bool condition_met, int32_t indent)
 
void text::add_line_with_condition (sys::state &state, layout_base &dest, std::string_view key, bool condition_met, variable_type subkey, substitution value, int32_t indent)
 
void text::add_line_with_condition (sys::state &state, layout_base &dest, std::string_view key, bool condition_met, variable_type subkey, substitution value, variable_type subkeyb, substitution valueb, int32_t indent)
 
void text::add_line_with_condition (sys::state &state, layout_base &dest, std::string_view key, bool condition_met, variable_type subkey, substitution value, variable_type subkeyb, substitution valueb, variable_type subkeyc, substitution valuec, int32_t indent)
 
void text::add_line (sys::state &state, layout_base &dest, std::string_view key, variable_type subkey, substitution value, int32_t indent)
 
void text::add_line (sys::state &state, layout_base &dest, std::string_view key, variable_type subkey, substitution value, variable_type subkey_b, substitution value_b, int32_t indent)
 
void text::add_line (sys::state &state, layout_base &dest, std::string_view key, variable_type subkey, substitution value, variable_type subkey_b, substitution value_b, variable_type subkey_c, substitution value_c, int32_t indent)
 
void text::add_line (sys::state &state, layout_base &dest, std::string_view key, variable_type subkey, substitution value, variable_type subkey_b, substitution value_b, variable_type subkey_c, substitution value_c, variable_type subkey_d, substitution value_d, int32_t indent)
 
void text::add_divider_to_layout_box (sys::state &state, layout_base &dest, layout_box &box)
 
void text::nation_name_and_flag (sys::state &state, dcon::nation_id n, layout_base &dest, int32_t indent)
 
std::string text::resolve_string_substitution (sys::state &state, dcon::text_key source_text, substitution_map const &mp)
 
std::string text::resolve_string_substitution (sys::state &state, std::string_view key, substitution_map const &mp)
 

Macro Definition Documentation

◆ CT_STRING_ENUM

#define CT_STRING_ENUM (   X)    else if(is_fixed_token_ci(v, #X)) return variable_type::X;

Definition at line 135 of file text.cpp.