MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / calc_var_content_string

Function calc_var_content_string

gui/qt/utils.cpp:62–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62std::string calc_var_content_string(const calc_var_t &var) {
63 decltype(&tivars::TypeHandlers::TH_TempEqu::makeStringFromData) func;
64 // We need to special case some specific temp-equ variables...
65 if (var.type == CALC_VAR_TYPE_EQU && var.name[0] == '$') {
66 func = &tivars::TypeHandlers::TH_TempEqu::makeStringFromData;
67 } else {
68 func = std::get<1>(tivars::TIVarType::createFromID(static_cast<uint>(var.type)).getHandlers());
69 }
70 const options_t opts = (calc_var_is_prog(&var) || var.type == CALC_VAR_TYPE_STRING)
71 ? options_t({ {"prettify", true} }) : options_t();
72 return func(data_t(var.data, var.data + var.size), opts, nullptr);
73}
74
75int utf8_strlen(const std::string &str) {
76 if (str.compare("𝑖") == 0 ||

Callers 2

updatePreviewMethod · 0.85
varPressedMethod · 0.85

Calls 1

calc_var_is_progFunction · 0.85

Tested by

no test coverage detected