libosmscout  0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
String.cpp File Reference
#include <osmscout/util/String.h>
#include <algorithm>
#include <cctype>
#include <cstring>
#include <cwchar>
#include <iomanip>
#include <locale>
#include <sstream>
#include <array>
#include <ctime>
#include <thread>
#include <osmscout/system/Math.h>
#include <osmscout/log/Logger.h>
#include <osmscout/util/Locale.h>
#include <osmscout/util/ObjectPool.h>
#include <osmscout/util/utf8helper.h>
#include <osmscout/private/Config.h>

Namespaces

 osmscout
 Original source: https://github.com/philipperemy/easy-encryption/blob/master/b64.h licensed under terms of MIT license.
 

Functions

const char * osmscout::BoolToString (bool value)
 Returns a string representation of the given boolean value (either 'true' or 'false') More...
 
std::string osmscout::ByteSizeToString (double size, const Locale &locale=Locale::ByEnvironmentSafe())
 
std::string osmscout::ByteSizeToString (FileOffset size, const Locale &locale=Locale::ByEnvironmentSafe())
 
size_t osmscout::CountWords (const std::string &text)
 
std::string osmscout::DurationString (const Duration &duration)
 
std::string osmscout::FloatToString (double value, const Locale &locale, uint32_t precision=3)
 Returns locale-aware string representation of number. More...
 
bool osmscout::GetDigitValue (char digit, size_t &result)
 
std::string osmscout::GetFirstInStringList (const std::string &stringList, const std::string &divider)
 
std::string osmscout::GetTokensFromEnd (const std::list< std::string > &tokens, size_t count)
 
std::string osmscout::GetTokensFromStart (const std::list< std::string > &tokens, size_t count)
 
int osmscout::GetUtcOffset ()
 returns the utc timezone offset (e.g. More...
 
void osmscout::GroupStringListToStrings (std::list< std::string >::const_iterator token, size_t listSize, size_t parts, std::list< std::list< std::string > > &lists)
 
std::string osmscout::LocaleStringToUTF8String (const std::string &text)
 
std::wstring osmscout::LocaleStringToWString (const std::string &text)
 
time_t osmscout::MkTimeUTC (struct tm *timeptr)
 https://stackoverflow.com/a/9088549/1632737 More...
 
std::string osmscout::NumberToString (long value, const Locale &locale)
 Returns locale-aware string representation of number. More...
 
bool osmscout::ParseISO8601TimeString (const std::string &timeStr, Timestamp &timestamp)
 Parse time string in ISO 8601 format "2017-11-26T13:46:12.124Z" (UTC timezone) to Timestamp (std::chrono::time_point with millisecond accuracy). More...
 
std::string osmscout::ReplaceString (const std::string &in, const std::string &search, const std::string &replacement)
 
void osmscout::SimplifyTokenList (std::list< std::string > &tokens)
 
std::list< std::string > osmscout::SplitString (const std::string &stringList, const std::string &separator, int maxSize=-1)
 
std::list< std::string > osmscout::SplitStringAtSpace (const std::string &input)
 
std::optional< std::pair< std::string, std::string > > osmscout::SplitStringToPair (const std::string &str, const std::string &separator)
 Split string by separator to two parts. More...
 
bool osmscout::StringToBool (const char *string, bool &value)
 
bool osmscout::StringToNumber (const char *string, double &value)
 
bool osmscout::StringToNumber (const std::string &string, double &value)
 
std::string osmscout::TimestampToISO8601TimeString (const Timestamp &timestamp)
 Format Timestamp to string in ISO8601 format "2017-11-26T13:46:12.124Z" for UTC timezone. More...
 
void osmscout::TokenizeString (const std::string &input, std::list< std::string > &tokens)
 
std::string osmscout::Trim (const std::string &str, char trimmedChar=' ')
 Trim trimmedChar from begin and end of str. More...
 
std::string osmscout::UTF8NormForLookup (const std::string &text)
 Normalise the given std::string containing a UTF8 character sequence for tolerant comparison. More...
 
std::string osmscout::UTF8StringToLocaleString (const std::string &text)
 
std::string osmscout::UTF8StringToLower (const std::string &text)
 Convert the given std::string containing a UTF8 character sequence to lower case using the translation table implementation. More...
 
std::u32string osmscout::UTF8StringToU32String (const std::string &text)
 
std::string osmscout::UTF8StringToUpper (const std::string &text)
 Convert the given std::string containing a UTF8 character sequence to upper case using translation table implementation. More...
 
std::wstring osmscout::UTF8StringToWString (const std::string &text)
 
std::string osmscout::UTF8Transliterate (const std::string &text)
 Transliterate non-ascii characters to one or more characters that are similar to the original character. More...
 
std::string osmscout::WStringToLocaleString (const std::wstring &text)
 
std::string osmscout::WStringToUTF8String (const std::wstring &text)