#include "irrlichttypes_bloated.h"
#include "irrString.h"
#include <cstdlib>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <sstream>
#include <iomanip>
#include <cctype>
#include <unordered_map>
Go to the source code of this file.
Classes | |
struct | FlagDesc |
Macros | |
#define | STRINGIFY(x) #x |
#define | TOSTRING(x) STRINGIFY(x) |
#define | IS_ASCII_PRINTABLE_CHAR(x) |
#define | IS_UTF8_MULTB_INNER(x) |
#define | IS_UTF8_MULTB_START(x) |
#define | UTF8_MULTB_START_LEN(x) |
#define | stoi mystoi |
#define | stof mystof |
#define | DEFINE_STD_TOSTRING_FLOATINGPOINT(T) |
Typedefs | |
typedef std::unordered_map< std::string, std::string > | StringMap |
Functions | |
std::wstring | utf8_to_wide (const std::string &input) |
std::string | wide_to_utf8 (const std::wstring &input) |
wchar_t * | utf8_to_wide_c (const char *str) |
std::string | urlencode (const std::string &str) |
std::string | urldecode (const std::string &str) |
u32 | readFlagString (std::string str, const FlagDesc *flagdesc, u32 *flagmask) |
std::string | writeFlagString (u32 flags, const FlagDesc *flagdesc, u32 flagmask) |
size_t | mystrlcpy (char *dst, const char *src, size_t size) |
char * | mystrtok_r (char *s, const char *sep, char **lasts) |
u64 | read_seed (const char *str) |
bool | parseColorString (const std::string &value, video::SColor &color, bool quiet, unsigned char default_alpha=0xff) |
std::string | padStringRight (std::string str, size_t len) |
Returns a copy of str with spaces inserted at the right hand side to ensure that the string is len characters in length. More... | |
std::string | removeStringEnd (const std::string &str, const char *ends[]) |
Returns a version of str with the first occurrence of a string contained within ends[] removed from the end of the string. More... | |
template<typename T > | |
bool | str_equal (const std::basic_string< T > &s1, const std::basic_string< T > &s2, bool case_insensitive=false) |
Check two strings for equivalence. More... | |
template<typename T > | |
bool | str_starts_with (const std::basic_string< T > &str, const std::basic_string< T > &prefix, bool case_insensitive=false) |
Check whether str begins with the string prefix. More... | |
template<typename T > | |
bool | str_starts_with (const std::basic_string< T > &str, const T *prefix, bool case_insensitive=false) |
Check whether str begins with the string prefix. More... | |
template<typename T > | |
bool | str_ends_with (const std::basic_string< T > &str, const std::basic_string< T > &suffix, bool case_insensitive=false) |
Check whether str ends with the string suffix. More... | |
template<typename T > | |
bool | str_ends_with (const std::basic_string< T > &str, const T *suffix, bool case_insensitive=false) |
Check whether str ends with the string suffix. More... | |
template<typename T > | |
std::vector< std::basic_string< T > > | str_split (const std::basic_string< T > &str, T delimiter) |
Splits a string into its component parts separated by the character delimiter . More... | |
std::string | lowercase (const std::string &str) |
std::string | trim (const std::string &str) |
bool | is_yes (const std::string &str) |
Returns whether str should be regarded as (bool) true. More... | |
s32 | mystoi (const std::string &str, s32 min, s32 max) |
Converts the string str to a signed 32-bit integer. More... | |
s32 | mystoi (const std::string &str) |
Returns a 32-bit value reprensented by the string str (decimal). More... | |
float | mystof (const std::string &str) |
Returns a float reprensented by the string str (decimal). More... | |
template<typename T > | |
T | from_string (const std::string &str) |
Returns a value represented by the string val . More... | |
s64 | stoi64 (const std::string &str) |
Returns a 64-bit signed value represented by the string str (decimal). More... | |
template<typename T > | |
string | std::to_string (T val) |
Returns a string representing the value val . More... | |
template<typename T > | |
wstring | std::to_wstring (T val) |
Returns a wide string representing the value val . More... | |
std::string | itos (s32 i) |
Returns a string representing the decimal value of the 32-bit value i . More... | |
std::string | i64tos (s64 i) |
Returns a string representing the decimal value of the 64-bit value i . More... | |
std::string | ftos (float f) |
Returns a string representing the decimal value of the float value f . More... | |
void | str_replace (std::string &str, const std::string &pattern, const std::string &replacement) |
Replace all occurrences of pattern in str with replacement . More... | |
void | str_formspec_escape (std::string &str) |
Escapes characters [ ] \ , ; that can not be used in formspecs. More... | |
void | str_replace (std::string &str, char from, char to) |
Replace all occurrences of the character from in str with to . More... | |
bool | string_allowed (const std::string &str, const std::string &allowed_chars) |
Check that a string only contains whitelisted characters. More... | |
bool | string_allowed_blacklist (const std::string &str, const std::string &blacklisted_chars) |
Check that a string contains no blacklisted characters. More... | |
std::string | wrap_rows (const std::string &from, unsigned row_len) |
Create a string based on from where a newline is forcefully inserted every row_len characters. More... | |
template<typename T > | |
std::basic_string< T > | unescape_string (const std::basic_string< T > &s) |
Removes backslashes from an escaped string (FormSpec strings) More... | |
template<typename T > | |
std::basic_string< T > | unescape_enriched (const std::basic_string< T > &s) |
Remove all escape sequences in s . More... | |
template<typename T > | |
std::vector< std::basic_string< T > > | split (const std::basic_string< T > &s, T delim) |
std::wstring | translate_string (const std::wstring &s, Translations *translations) |
std::wstring | translate_string (const std::wstring &s) |
std::wstring | unescape_translate (const std::wstring &s) |
bool | is_number (const std::string &to_check) |
Checks that all characters in to_check are a decimal digits. More... | |
const char * | bool_to_cstr (bool val) |
Returns a C-string, either "true" or "false", corresponding to val . More... | |
const std::string | duration_to_string (int sec) |
std::string | str_join (const std::vector< std::string > &list, const std::string &delimiter) |
Joins a vector of strings by the string delimiter . More... | |
std::string | stringw_to_utf8 (const irr::core::stringw &input) |
Create a UTF8 std::string from a irr::core::stringw. More... | |
irr::core::stringw | utf8_to_stringw (const std::string &input) |
Create a irr::core:stringw from a UTF8 std::string. More... | |
std::string | sanitizeDirName (const std::string &str, const std::string &optional_prefix) |
Sanitize the name of a new directory. More... | |
#define DEFINE_STD_TOSTRING_FLOATINGPOINT | ( | T | ) |
#define IS_ASCII_PRINTABLE_CHAR | ( | x | ) |
#define IS_UTF8_MULTB_INNER | ( | x | ) |
#define IS_UTF8_MULTB_START | ( | x | ) |
#define stof mystof |
#define stoi mystoi |
#define STRINGIFY | ( | x | ) | #x |
#define TOSTRING | ( | x | ) | STRINGIFY(x) |
#define UTF8_MULTB_START_LEN | ( | x | ) |
typedef std::unordered_map<std::string, std::string> StringMap |
|
inline |
Returns a C-string, either "true" or "false", corresponding to val
.
val
is true, then "true" is returned, otherwise "false". Referenced by Game::toggleAutoforward(), Game::toggleCinematic(), Game::toggleFast(), Game::toggleFreeMove(), Game::toggleNoClip(), and Game::togglePitchMove().
|
inline |
Referenced by Server::ShutdownState::getShutdownTimerMessage(), and Server::requestShutdown().
|
inline |
Returns a value represented by the string val
.
|
inline |
Returns a string representing the decimal value of the float value f
.
Referenced by content_nodemeta_deserialize_legacy_body(), QuicktuneValue::getString(), MetaDataRef::l_set_float(), and Settings::setFloat().
|
inline |
Returns a string representing the decimal value of the 64-bit value i
.
Referenced by Database_LevelDB::deleteBlock(), Database_Redis::deleteBlock(), Database_LevelDB::loadBlock(), Database_Redis::loadBlock(), Database_LevelDB::saveBlock(), and Database_Redis::saveBlock().
|
inline |
Checks that all characters in to_check
are a decimal digits.
to_check |
Referenced by TextureSource::generateImagePart(), GUIFormSpecMenu::parseVersionDirect(), and TestUtilities::testIsNumber().
|
inline |
Returns whether str
should be regarded as (bool) true.
Case and leading and trailing whitespace are ignored. Values that will return true are "y", "yes", "true" and any number that is not 0.
str |
References lowercase(), and trim().
Referenced by Settings::getBool(), StyleSpec::getBool(), ModApiUtil::Initialize(), ModApiUtil::InitializeAsync(), ModApiUtil::InitializeClient(), ModApiUtil::l_is_yes(), GUIFormSpecMenu::parseBackground(), GUIFormSpecMenu::parseBackgroundColor(), GUIFormSpecMenu::parseDropDown(), GUIFormSpecMenu::parseElement(), GUIFormSpecMenu::parseFieldCloseOnEnter(), ParsedText::parseGenericStyleAttr(), GUIFormSpecMenu::parseModel(), GUIFormSpecMenu::parseSetFocus(), ParsedText::parseTag(), GUIFormSpecMenu::parseTextList(), FontEngine::readSettings(), GUIFormSpecMenu::regenerateGui(), ParsedText::Element::setStyle(), GUITable::setTable(), and TestUtilities::testIsYes().
|
inline |
Returns a string representing the decimal value of the 32-bit value i
.
Referenced by EmergeThread::EmergeThread(), RollbackManager::actionRowsFromSelect(), analyze_block(), Game::decreaseViewRange(), NodeMetadataList::deSerialize(), deSerializeString32(), drawItemStack(), MenuMusicFetcher::fetchSounds(), Address::getAddress(), con::Connection::getDesc(), GenerateNotifier::getEvents(), Server::getPlayerName(), Game::increaseViewRange(), UDPSocket::init(), AsyncEngine::initialize(), ModApiItemMod::l_register_item_raw(), MetaDataRef::l_set_int(), ClientLauncher::launch_game(), PlayerDatabaseFiles::loadPlayer(), Client::makeScreenshot(), Database_SQLite3::openDatabase(), Settings::parseCommandLine(), con::ConnectionReceiveThread::processPacket(), PlayerDatabaseFiles::removePlayer(), PlayerDatabaseFiles::savePlayer(), script_error(), Settings::setS16(), Settings::setS32(), Settings::setU16(), RollbackAction::toString(), and GameUI::update().
|
inline |
str |
str
converted to all lowercase characters. Referenced by gen_srp_v(), init_gettext(), FontEngine::initSimpleFont(), is_yes(), parseImageTransform(), parseNamedColorString(), JoystickController::setLayoutFromControllerName(), porting::setSystemPaths(), Client::startAuth(), and TestUtilities::testLowercase().
|
inline |
Returns a float reprensented by the string str
(decimal).
|
inline |
Returns a 32-bit value reprensented by the string str
(decimal).
|
inline |
Converts the string str
to a signed 32-bit integer.
The converted value is constrained so that min <= value <= max.
str | |
min | Range minimum |
max | Range maximum |
Referenced by TextureSource::generateImagePart(), CItemDefManager::getItemstackColor(), Game::nodePlacement(), GUIFormSpecMenu::parseVersionDirect(), and TestUtilities::testStrToIntConversion().
size_t mystrlcpy | ( | char * | dst, |
const char * | src, | ||
size_t | size | ||
) |
References MYMIN.
char* mystrtok_r | ( | char * | s, |
const char * | sep, | ||
char ** | lasts | ||
) |
|
inline |
Returns a copy of str
with spaces inserted at the right hand side to ensure that the string is len
characters in length.
If str
is <= len
then the returned string will be identical to str.
Referenced by print_allowed_options(), and TestUtilities::testPadString().
bool parseColorString | ( | const std::string & | value, |
video::SColor & | color, | ||
bool | quiet, | ||
unsigned char | default_alpha = 0xff |
||
) |
References errorstream, parseHexColorString(), and parseNamedColorString().
Referenced by EnrichedString::addAtEnd(), check_color(), TextureSource::generateImagePart(), StyleSpec::getColor(), StyleSpec::getColorArray(), CItemDefManager::getItemstackColor(), ParsedText::globalTag(), GUIFormSpecMenu::parseBackgroundColor(), GUIFormSpecMenu::parseBox(), GUIFormSpecMenu::parseListColors(), GUIFormSpecMenu::parseTooltip(), read_color(), ParsedText::Element::setStyle(), GUITable::setTable(), and GUITable::setTextList().
u64 read_seed | ( | const char * | str | ) |
References murmur_hash_64_ua().
Referenced by MapgenParams::readParams().
u32 readFlagString | ( | std::string | str, |
const FlagDesc * | flagdesc, | ||
u32 * | flagmask | ||
) |
References FlagDesc::flag, and FlagDesc::name.
Referenced by Settings::getFlagStr(), read_flags(), and TestSettings::testFlagDesc().
|
inline |
Returns a version of str
with the first occurrence of a string contained within ends[] removed from the end of the string.
str | |
ends | A NULL- or ""- terminated array of strings to remove from s in the copy produced. Note that once one of these strings is removed that no further postfixes contained within this array are removed. |
References p().
Referenced by Server::addMediaFile(), porting::detectMSVCBuildDir(), getAvailableGameIds(), getImagePath(), Client::loadMedia(), and TestUtilities::testRemoveStringEnd().
std::string sanitizeDirName | ( | const std::string & | str, |
const std::string & | optional_prefix | ||
) |
Sanitize the name of a new directory.
This consists of two stages:
Remove 'unsafe' characters from the name by replacing them with '_'
This consists of two stages:
References disallowed_dir_names, disallowed_path_chars, str_equal(), utf8_to_wide(), and wide_to_utf8().
Referenced by ModApiMainMenu::l_create_world().
std::vector<std::basic_string<T> > split | ( | const std::basic_string< T > & | s, |
T | delim | ||
) |
Referenced by EnrichedString::addAtEnd(), StyleSpec::getFont(), GUIFormSpecMenu::parseAnchor(), GUIFormSpecMenu::parseAnchorDirect(), GUIFormSpecMenu::parseAnimatedImage(), StyleSpec::parseArray(), GUIFormSpecMenu::parseBackground(), GUIFormSpecMenu::parseBackgroundColor(), GUIFormSpecMenu::parseBox(), GUIFormSpecMenu::parseButton(), GUIFormSpecMenu::parseCheckbox(), GUIFormSpecMenu::parseContainer(), GUIFormSpecMenu::parseDropDown(), GUIFormSpecMenu::parseField(), GUIFormSpecMenu::parseFieldCloseOnEnter(), GUIFormSpecMenu::parseHyperText(), GUIFormSpecMenu::parseImage(), GUIFormSpecMenu::parseImageButton(), GUIFormSpecMenu::parseItemImage(), GUIFormSpecMenu::parseItemImageButton(), GUIFormSpecMenu::parseLabel(), GUIFormSpecMenu::parseList(), GUIFormSpecMenu::parseListColors(), GUIFormSpecMenu::parseListRing(), GUIFormSpecMenu::parseModel(), GUIFormSpecMenu::parsePosition(), GUIFormSpecMenu::parsePositionDirect(), GUIFormSpecMenu::parsePwdField(), StyleSpec::parseRect(), GUIFormSpecMenu::parseScrollBar(), GUIFormSpecMenu::parseScrollBarOptions(), GUIFormSpecMenu::parseScrollContainer(), GUIFormSpecMenu::parseSetFocus(), GUIFormSpecMenu::parseSize(), GUIFormSpecMenu::parseSizeDirect(), GUIFormSpecMenu::parseStyle(), GUIFormSpecMenu::parseTabHeader(), GUIFormSpecMenu::parseTable(), GUIFormSpecMenu::parseTableColumns(), GUIFormSpecMenu::parseTableOptions(), ParsedText::parseTag(), GUIFormSpecMenu::parseTextArea(), GUIFormSpecMenu::parseTextList(), GUIFormSpecMenu::parseTooltip(), StyleSpec::parseVector2f(), GUIFormSpecMenu::parseVersionDirect(), GUIFormSpecMenu::parseVertLabel(), GUIFormSpecMenu::regenerateGui(), translate_all(), and translate_string().
|
inline |
Returns a 64-bit signed value represented by the string str
(decimal).
Referenced by Database_LevelDB::listAllLoadableBlocks(), and Database_Redis::listAllLoadableBlocks().
|
inline |
Check whether str
ends with the string suffix.
If case_insensitive
is true then the check is case insensitve (default is false; i.e. case is significant).
str | |
suffix | |
case_insensitive |
Referenced by Server::getTranslationLanguage(), Server::sendMediaAnnouncement(), and str_ends_with().
|
inline |
Check whether str
ends with the string suffix.
If case_insensitive
is true then the check is case insensitve (default is false; i.e. case is significant).
str | |
suffix | |
case_insensitive |
References str_ends_with().
|
inline |
Check two strings for equivalence.
If case_insensitive
is true then the case of the strings is ignored (default is false).
s1 | |
s2 | |
case_insensitive |
Referenced by ChatPrompt::nickCompletion(), sanitizeDirName(), and TestUtilities::testStrEqual().
|
inline |
Escapes characters [ ] \ , ; that can not be used in formspecs.
References str_replace().
Referenced by Game::showPauseMenu().
|
inline |
Joins a vector of strings by the string delimiter
.
Referenced by TestAuthDatabase::testListNames(), TestAuthDatabase::testRecall(), TestAuthDatabase::testRecallChanged(), TestAuthDatabase::testRecallChangedPrivileges(), TestUtilities::testStringJoin(), and AuthDatabaseFiles::writeAuthFile().
void str_replace | ( | std::string & | str, |
char | from, | ||
char | to | ||
) |
Replace all occurrences of the character from
in str
with to
.
str | The string to (potentially) modify. |
from | The character in str to replace. |
to | The replacement character. |
Referenced by TextureSource::generateImagePart(), Client::initLocalMapSaving(), and TestUtilities::testStringReplace().
|
inline |
Replace all occurrences of pattern
in str
with replacement
.
str | String to replace pattern with replacement within. |
pattern | The pattern to replace. |
replacement | What to replace the pattern with. |
Referenced by str_formspec_escape().
|
inline |
Splits a string into its component parts separated by the character delimiter
.
Referenced by TextureOverrideSource::TextureOverrideSource(), decode_srp_verifier_and_salt(), Server::handleCommand_Init(), ModApiHttp::l_request_http_api(), ModApiUtil::l_request_insecure_environment(), LBMManager::loadIntroductionTimes(), Translations::loadTranslation(), parseModContents(), and AuthDatabaseFiles::readAuthFile().
|
inline |
Check whether str
begins with the string prefix.
If case_insensitive
is true then the check is case insensitve (default is false; i.e. case is significant).
str | |
prefix | |
case_insensitive |
Referenced by TextureSource::generateImagePart(), isGroupRecipeStr(), Translations::loadTranslation(), ChatPrompt::nickCompletion(), str_starts_with(), and TestUtilities::testStartsWith().
|
inline |
Check whether str
begins with the string prefix.
If case_insensitive
is true then the check is case insensitve (default is false; i.e. case is significant).
str | |
prefix | |
case_insensitive |
References str_starts_with().
|
inline |
Check that a string only contains whitelisted characters.
This is the opposite of string_allowed_blacklist().
str | The string to be checked. |
allowed_chars | A string containing permitted characters. |
Referenced by ClientMediaDownloader::addFile(), LBMManager::addLBMDef(), Server::addMediaFile(), Server::handleCommand_Init(), Client::handleCommand_MediaPush(), Client::loadMods(), ServerModManager::loadMods(), parseDependsString(), run_dedicated_server(), GUITable::setTable(), and TestUtilities::testStringAllowed().
|
inline |
Check that a string contains no blacklisted characters.
This is the opposite of string_allowed().
str | The string to be checked. |
blacklisted_chars | A string containing prohibited characters. |
Referenced by TestUtilities::testStringAllowed().
|
inline |
Create a UTF8 std::string from a irr::core::stringw.
References wide_to_utf8().
Referenced by TextDrawer::TextDrawer(), TextDrawer::draw(), and ParsedText::parseTag().
|
inline |
Returns a string representing the value val
.
References std::to_string().
Referenced by std::to_string(), and std::to_wstring().
|
inline |
Returns a wide string representing the value val
.
References std::to_string(), std::to_wstring(), and utf8_to_wide().
Referenced by std::to_wstring().
std::wstring translate_string | ( | const std::wstring & | s | ) |
std::wstring translate_string | ( | const std::wstring & | s, |
Translations * | translations | ||
) |
References translate_all().
Referenced by unescape_translate().
|
inline |
str |
str
with leading and trailing whitespace removed. Referenced by TextureOverrideSource::TextureOverrideSource(), ItemStack::deSerialize(), Server::handleChat(), Client::handleCommand_AnnounceMedia(), is_yes(), BanManager::load(), Translations::loadTranslation(), RollbackManager::migrate(), GUIFormSpecMenu::parseAnchorDirect(), Settings::parseConfigObject(), parseDependsString(), GUIFormSpecMenu::parseElement(), GUIFormSpecMenu::parsePositionDirect(), GUIFormSpecMenu::parseScrollBarOptions(), GUIFormSpecMenu::parseSizeDirect(), GUIFormSpecMenu::parseStyle(), GUIFormSpecMenu::parseVersionDirect(), fs::RecursiveDeleteContent(), GUIFormSpecMenu::regenerateGui(), TestUtilities::testStringTrim(), and TestUtilities::testTrim().
std::basic_string<T> unescape_enriched | ( | const std::basic_string< T > & | s | ) |
Remove all escape sequences in s
.
s | The string in which to remove escape sequences. |
s
, with escape sequences removed. Referenced by Server::handleChat(), GUIFormSpecMenu::parseLabel(), and unescape_translate().
|
inline |
Removes backslashes from an escaped string (FormSpec strings)
Referenced by GUIFormSpecMenu::parseAnimatedImage(), GUIFormSpecMenu::parseBackground(), GUIFormSpecMenu::parseButton(), GUIFormSpecMenu::parseCheckbox(), GUIFormSpecMenu::parseDropDown(), GUIFormSpecMenu::parseHyperText(), GUIFormSpecMenu::parseImage(), GUIFormSpecMenu::parseImageButton(), GUIFormSpecMenu::parseItemImageButton(), GUIFormSpecMenu::parseLabel(), GUIFormSpecMenu::parseModel(), GUIFormSpecMenu::parsePwdField(), GUIFormSpecMenu::parseSimpleField(), GUIFormSpecMenu::parseStyle(), GUIFormSpecMenu::parseTabHeader(), GUIFormSpecMenu::parseTable(), GUIFormSpecMenu::parseTableColumns(), GUIFormSpecMenu::parseTableOptions(), GUIFormSpecMenu::parseTextArea(), GUIFormSpecMenu::parseTextList(), GUIFormSpecMenu::parseTooltip(), and GUIFormSpecMenu::parseVertLabel().
|
inline |
References translate_string(), and unescape_enriched().
Referenced by Hud::drawLuaElements(), Camera::drawNametags(), Game::handlePointingAtNode(), Game::handlePointingAtObject(), GUIFormSpecMenu::parseDropDown(), GUIFormSpecMenu::parseTabHeader(), GUIFormSpecMenu::parseTable(), GUIFormSpecMenu::parseTextList(), and GUIFormSpecMenu::parseVertLabel().
std::string urldecode | ( | const std::string & | str | ) |
References hex_digit_decode().
Referenced by TestUtilities::testUrlDecode().
std::string urlencode | ( | const std::string & | str | ) |
Referenced by HTTPFetchOngoing::HTTPFetchOngoing(), and TestUtilities::testUrlEncode().
|
inline |
Create a irr::core:stringw from a UTF8 std::string.
References utf8_to_wide().
Referenced by GUIHyperText::OnEvent(), and ParsedText::parseTag().
std::wstring utf8_to_wide | ( | const std::string & | input | ) |
References convert(), DEFAULT_ENCODING, hex_encode(), infostream, and SANITY_CHECK.
Referenced by GUITable::allocString(), Game::createClient(), ProfilerGraph::draw(), drawItemStack(), Hud::drawLuaElements(), GUIFormSpecMenu::drawMenu(), Camera::drawNametags(), Game::getServerContent(), FontEngine::getTextWidth(), Server::handleChat(), Game::handlePointingAtNode(), Game::handlePointingAtObject(), GameUI::init(), ModApiServer::l_chat_send_all(), ModApiServer::l_chat_send_player(), ModApiClient::l_display_chat_message(), ModApiEnvMod::l_get_translated_string(), ModApiServer::l_kick_player(), ModApiClient::l_send_chat_message(), Translations::loadTranslation(), Client::makeScreenshot(), ChatPrompt::nickCompletion(), GUIFormSpecMenu::parseButton(), GUIFormSpecMenu::parseCheckbox(), GUIFormSpecMenu::parseDropDown(), GUIFormSpecMenu::parseHyperText(), GUIFormSpecMenu::parseImageButton(), GUIFormSpecMenu::parseItemImageButton(), GUIFormSpecMenu::parseLabel(), GUIFormSpecMenu::parsePwdField(), GUIFormSpecMenu::parseSimpleField(), GUIFormSpecMenu::parseTabHeader(), GUIFormSpecMenu::parseTable(), GUIFormSpecMenu::parseTextArea(), GUIFormSpecMenu::parseTextList(), GUIFormSpecMenu::parseTooltip(), GUIFormSpecMenu::parseVertLabel(), Server::printToConsoleOnly(), Server::ProcessData(), GUIConfirmRegistration::processInput(), Game::processKeyInput(), ClientLauncher::run(), sanitizeDirName(), GUIEngine::setTopleftText(), TestUtilities::testStrEqual(), TestUtilities::testUTF8(), TestUtilities::testWrapRows(), std::to_wstring(), Game::toggleMinimap(), GameUI::update(), Game::updateChat(), GameUI::updateProfiler(), utf8_to_stringw(), and utf8_to_wide_c().
wchar_t* utf8_to_wide_c | ( | const char * | str | ) |
std::string wide_to_utf8 | ( | const std::wstring & | input | ) |
References convert(), DEFAULT_ENCODING, hex_encode(), and infostream.
Referenced by GUIFileSelectMenu::acceptInput(), GUIFormSpecMenu::acceptInput(), EnrichedString::addAtEnd(), Translations::getTranslation(), TextDestNodeMetadata::gotText(), TextDestGuiEngine::gotText(), Server::handleChat(), Client::handleCommand_AccessDenied(), Client::handleCommand_ChatMessage(), ModApiEnvMod::l_get_translated_string(), Translations::loadTranslation(), GUIChatConsole::OnEvent(), GUIFormSpecMenu::parseTable(), GUIFormSpecMenu::parseTextList(), GUIModalMenu::preprocessEvent(), GUIPasswordChange::processInput(), Server::requestShutdown(), sanitizeDirName(), stringw_to_utf8(), TestUtilities::testUTF8(), Server::ShutdownState::tick(), translate_string(), and Client::typeChatMessage().
|
inline |
Create a string based on from
where a newline is forcefully inserted every row_len
characters.
row_len
characters whether it breaks a word or not. It is intended to be used for, for example, showing paths in the GUI.from | The (utf-8) string to be wrapped into rows. |
row_len | The row length (in characters). |
References IS_UTF8_MULTB_INNER.
Referenced by TestUtilities::testWrapRows().
std::string writeFlagString | ( | u32 | flags, |
const FlagDesc * | flagdesc, | ||
u32 | flagmask | ||
) |
References FlagDesc::name.
Referenced by push_flags_string(), Settings::setDefault(), and Settings::setFlagStr().