MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
shcore Namespace Reference

Namespaces

namespace  anonymous_namespace{jit_executor_value.cc}
 
namespace  anonymous_namespace{utils_encoding.cc}
 
namespace  anonymous_namespace{utils_json.cc}
 
namespace  anonymous_namespace{utils_string.cc}
 
namespace  internal
 Checks whether a string has another as a prefix.
 
namespace  json
 
namespace  path
 
namespace  polyglot
 
namespace  profiling
 This namespace provides the functions required to perform profiling of specific sections of code.
 
namespace  utils
 

Classes

struct  Case_comparator
 
struct  Case_insensitive_comparator
 
struct  Case_sensitive_comparator
 
class  JSON_dumper
 
struct  Lexicographical_comparator
 
class  Parser_error
 
struct  string_hash
 Transparent hashing function, enables heterogeneous lookup in unordered containers. More...
 
class  Type_error
 
struct  Value
 Pointer to a function that may be implemented in any language. More...
 

Typedefs

using Argument_list = std::vector< Value >
 
typedef Value::Map_type_ref Dictionary_t
 
typedef Value::Array_type_ref Array_t
 
template<typename Key , typename T >
using heterogeneous_map = std::unordered_map< Key, T, string_hash, std::equal_to<> >
 
template<typename Key >
using heterogeneous_set = std::unordered_set< Key, string_hash, std::equal_to<> >
 

Enumerations

enum  Value_type {
  Undefined , Null , Bool , String ,
  Integer , UInteger , Float , Object ,
  ObjectBridge , Array , Map , Binary
}
 Basic types that can be passed around code in different languages. More...
 

Functions

bool is_compatible_type (Value_type source_type, Value_type target_type)
 
Dictionary_t JIT_EXECUTOR_PLUGIN_EXPORT make_dict ()
 
Array_t make_array ()
 
template<typename... Arg>
Array_t make_array (Arg &&...args)
 
template<template< typename... > class C, typename T >
Array_t make_array (const C< T > &container)
 
template<template< typename... > class C, typename T >
Array_t make_array (C< T > &&container)
 
std::string type_name (Value_type type)
 
std::string type_description (Value_type type)
 
Type_error type_conversion_error (Value_type from, Value_type expected)
 
Type_error type_range_error (Value_type from, Value_type expected)
 
bool decode_base64 (std::string_view source, std::string *target)
 Decodes a base64 encoded string. More...
 
bool encode_base64 (const unsigned char *source, std::size_t source_length, std::string *encoded)
 
bool encode_base64 (std::string_view source, std::string *encoded)
 
bool decode_base64url (std::string_view source, std::string *target)
 
bool encode_base64url (const unsigned char *source, std::size_t source_length, std::string *encoded)
 Replaces '+' with '-' and '/' with '_', trims any '=' (RFC 7515, Section 2 and RFC 4648, Section 5). More...
 
bool encode_base64url (std::string_view source, std::string *encoded)
 
void clear_buffer (char *buffer, size_t size)
 
void clear_buffer (std::string &buffer)
 
std::string_view str_strip_view (std::string_view s, std::string_view chars=" \r\n\t")
 Strip a string out of blank chars. More...
 
std::string_view str_lstrip_view (std::string_view s, std::string_view chars)
 
std::string_view str_rstrip_view (std::string_view s, std::string_view chars)
 
std::string str_strip (std::string_view s, std::string_view chars)
 
std::string str_lstrip (std::string_view s, std::string_view chars)
 
std::string str_rstrip (std::string_view s, std::string_view chars)
 
std::string str_format (const char *formats,...)
 Return a formatted a string. More...
 
std::string str_replace (std::string_view s, std::string_view from, std::string_view to)
 
std::string bits_to_string (uint64_t bits, int nbits)
 
std::pair< uint64_t, int > string_to_bits (std::string_view s)
 
std::string bits_to_string_hex (uint64_t bits, int nbits)
 
size_t bits_to_string_hex_size (int nbits)
 
std::string string_to_hex (std::string_view s, bool prefix)
 
std::string quote_string (const std::string &s, char quote)
 Escape quote and \ chars. More...
 
std::string unquote_string (std::string_view s, char quote)
 Inverse of quote_string(). More...
 
std::vector< std::string > str_break_into_lines (const std::string &line, std::size_t line_width)
 Breaks string into lines of specified width without breaking words. More...
 
std::pair< std::string::size_type, std::string::size_type > get_quote_span (const char quote_char, const std::string &str)
 Auxiliary function to get the quotes span (i.e., start and end positions) for the given string. More...
 
std::string str_subvars (std::string_view s, const std::function< std::string(std::string_view)> &subvar, std::string_view var_begin, std::string_view var_end)
 
std::wstring utf8_to_wide (const std::string &utf8)
 Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string. More...
 
std::wstring utf8_to_wide (const char *utf8)
 Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string. More...
 
std::string wide_to_utf8 (const std::wstring &wide)
 Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string. More...
 
std::string wide_to_utf8 (const wchar_t *wide)
 Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string. More...
 
std::wstring utf8_to_wide (const char *utf8, const size_t utf8_length)
 Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string. More...
 
std::string wide_to_utf8 (const wchar_t *wide, const size_t wide_length)
 Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string. More...
 
std::string truncate (const std::string &str, const size_t max_length)
 Truncates the given string to max_length code points. More...
 
std::string truncate (const char *str, const size_t length, const size_t max_length)
 Truncates the given string to max_length code points. More...
 
std::wstring truncate (const std::wstring &str, const size_t max_length)
 Truncates the given string to max_length code points. More...
 
std::wstring truncate (const wchar_t *str, const size_t length, const size_t max_length)
 Truncates the given string to max_length code points. More...
 
bool is_valid_utf8 (std::string_view s)
 Checks if the given string contains only valid UTF-8 code points. More...
 
std::string pctencode (std::string_view s)
 Generates a percent encoded string based on RFC-3986, only unreserved characters are not encoded. More...
 
std::string pctdecode (std::string_view s)
 Decodes a string that is percent encoded based on RFC-3986. More...
 
std::string get_random_string (size_t size, const char *source)
 Returns a string of the given size created with random characters from the provided source. More...
 
const char * str_casestr (const char *haystack, const char *needle)
 
std::string str_upper (std::string_view s)
 Convert a copy of an ASCII string to uppercase and return. More...
 
std::wstring str_upper (std::wstring_view s)
 
std::string str_lower (std::string_view s)
 Convert a copy of an ASCII string to lowercase and return. More...
 
std::wstring str_lower (std::wstring_view s)
 
int str_casecmp (const char *a, const char *b)
 Compares 2 strings case insensitive (for ascii) More...
 
int str_casecmp (const wchar_t *a, const wchar_t *b)
 
int str_casecmp (const char *a, const char *b, size_t n)
 
int str_casecmp (const wchar_t *a, const wchar_t *b, size_t n)
 
template<typename... T>
bool str_caseeq (std::string_view a, std::string_view token, T &&...tokens)
 
template<typename... T>
bool str_caseeq (std::wstring_view a, std::wstring_view token, T &&...tokens)
 
template<typename... T>
bool str_beginswith (std::string_view s, std::string_view prefix, T &&...prefixes)
 
template<typename... T>
bool str_beginswith (std::wstring_view s, std::wstring_view prefix, T &&...prefixes)
 
template<typename... T>
bool str_ibeginswith (std::string_view s, std::string_view prefix, T &&...prefixes)
 
template<typename... T>
bool str_ibeginswith (std::wstring_view s, std::wstring_view prefix, T &&...prefixes)
 
template<typename... T>
bool str_endswith (std::string_view s, std::string_view suffix, T &&...suffixes)
 
template<typename... T>
bool str_endswith (std::wstring_view s, std::wstring_view suffix, T &&...suffixes)
 
template<typename... T>
bool str_iendswith (std::string_view s, std::string_view suffix, T &&...suffixes)
 
template<typename... T>
bool str_iendswith (std::wstring_view s, std::wstring_view suffix, T &&...suffixes)
 
size_t str_span (const std::string &s1, const std::string &s2)
 Return position of the first difference in the strings or npos if they're the same. More...
 
template<class TOutput = std::string>
std::pair< TOutput, TOutput > str_partition (std::string_view s, std::string_view sep, bool *found_sep=nullptr)
 Partition a string in 2 at a separator, if present. More...
 
template<class TOutput = std::string>
std::pair< TOutput, TOutput > str_partition_after (std::string_view s, std::string_view sep)
 Partition a string in 2 after separator, in place, if present. More...
 
std::string str_partition_after_inpl (std::string *s, const std::string &sep)
 Partition a string in 2 after separator, in place, if present. More...
 
std::vector< std::string > str_split (std::string_view input, std::string_view separator_chars=" \r\n\t", int maxsplit=-1, bool compress=false)
 Splits string based on each of the individual characters of the separator string. More...
 
template<class TCallback >
bool str_itersplit (std::string_view input, TCallback &&f, std::string_view separator_chars=" \r\n\t", int maxsplit=-1, bool compress=false)
 Split the given input string and call the functor for each token. More...
 
std::string str_ljust (const std::string &s, size_t width, char pad=' ')
 
std::string str_rjust (const std::string &s, size_t width, char pad=' ')
 
template<typename Iter >
std::string str_join (Iter begin, Iter end, std::string_view sep)
 
template<typename Iter , typename CTransform >
std::string str_join (Iter begin, Iter end, std::string_view sep, CTransform &&f)
 
template<typename C >
std::string str_join (const C &container, std::string_view sep)
 
template<typename C , typename CTransform >
std::string str_join (const C &container, std::string_view sep, CTransform &&f)
 
template<typename... Args>
std::string JIT_EXECUTOR_PLUGIN_EXPORT str_replace (std::string_view s, std::string_view from, std::string_view to, const Args &...rest)
 
std::string utf8_upper (std::string_view s)
 
std::string utf8_lower (std::string_view s)
 
uint64_t getPhysicalMemorySize ()
 Returns the amount of physical memory in megabytes or 0 if fails retrieving the value. More...
 

Typedef Documentation

◆ Argument_list

using shcore::Argument_list = typedef std::vector<Value>

◆ Array_t

◆ Dictionary_t

◆ heterogeneous_map

template<typename Key , typename T >
using shcore::heterogeneous_map = typedef std::unordered_map<Key, T, string_hash, std::equal_to<> >

◆ heterogeneous_set

template<typename Key >
using shcore::heterogeneous_set = typedef std::unordered_set<Key, string_hash, std::equal_to<> >

Enumeration Type Documentation

◆ Value_type

Basic types that can be passed around code in different languages.

With the exception of Native and Function, all types can be serialized to JSON.

Enumerator
Undefined 
Null 

Undefined.

Bool 

Null/None value.

String 

true or false

Integer 

String values, UTF-8 encoding.

UInteger 

64bit integer numbers

Float 

unsigned 64bit integer numbers

Object 

double numbers

ObjectBridge 

Polyglot object of any type.

Array 

C++ Object.

Map 

Array/List container.

Binary 

Dictionary/Map/Object container.

Binary data

Function Documentation

◆ bits_to_string()

std::string shcore::bits_to_string ( uint64_t  bits,
int  nbits 
)

◆ bits_to_string_hex()

std::string shcore::bits_to_string_hex ( uint64_t  bits,
int  nbits 
)

◆ bits_to_string_hex_size()

size_t shcore::bits_to_string_hex_size ( int  nbits)

◆ clear_buffer() [1/2]

void shcore::clear_buffer ( char *  buffer,
size_t  size 
)

◆ clear_buffer() [2/2]

void shcore::clear_buffer ( std::string &  buffer)

◆ decode_base64()

bool shcore::decode_base64 ( std::string_view  source,
std::string *  target 
)

Decodes a base64 encoded string.

Parameters
sourcethe base64 string to be decoded
targeta string pointer where the decoded string will be stored.
Returns
true on success decode

◆ decode_base64url()

bool shcore::decode_base64url ( std::string_view  source,
std::string *  target 
)

◆ encode_base64() [1/2]

bool shcore::encode_base64 ( const unsigned char *  source,
std::size_t  source_length,
std::string *  encoded 
)

◆ encode_base64() [2/2]

bool shcore::encode_base64 ( std::string_view  source,
std::string *  encoded 
)

◆ encode_base64url() [1/2]

bool shcore::encode_base64url ( const unsigned char *  source,
std::size_t  source_length,
std::string *  encoded 
)

Replaces '+' with '-' and '/' with '_', trims any '=' (RFC 7515, Section 2 and RFC 4648, Section 5).

◆ encode_base64url() [2/2]

bool shcore::encode_base64url ( std::string_view  source,
std::string *  encoded 
)

◆ get_quote_span()

std::pair< std::string::size_type, std::string::size_type > shcore::get_quote_span ( const char  quote_char,
const std::string &  str 
)

Auxiliary function to get the quotes span (i.e., start and end positions) for the given string.

If not quote is found then std::string::npos is returned for both elements in the pair. If only one quote is found (no ending quote) then std::string::npos is returned for the second position of the pair.

Parameters
quote_charcharacter with the quote to look for.
strtarget string to get the start and end quote position.
Returns
return a pair with the position of the starting quote and ending quote.

◆ get_random_string()

std::string shcore::get_random_string ( size_t  size,
const char *  source 
)

Returns a string of the given size created with random characters from the provided source.

◆ getPhysicalMemorySize()

uint64_t shcore::getPhysicalMemorySize ( )

Returns the amount of physical memory in megabytes or 0 if fails retrieving the value.

◆ is_compatible_type()

bool shcore::is_compatible_type ( Value_type  source_type,
Value_type  target_type 
)

◆ is_valid_utf8()

bool shcore::is_valid_utf8 ( std::string_view  s)

Checks if the given string contains only valid UTF-8 code points.

Parameters
sString to be checked.
Returns
true if the given string is a valid UTF-8 string

◆ make_array() [1/4]

Array_t shcore::make_array ( )
inline

◆ make_array() [2/4]

template<typename... Arg>
Array_t shcore::make_array ( Arg &&...  args)
inline

◆ make_array() [3/4]

template<template< typename... > class C, typename T >
Array_t shcore::make_array ( C< T > &&  container)
inline

◆ make_array() [4/4]

template<template< typename... > class C, typename T >
Array_t shcore::make_array ( const C< T > &  container)
inline

◆ make_dict()

Dictionary_t shcore::make_dict ( )

◆ pctdecode()

std::string shcore::pctdecode ( std::string_view  s)

Decodes a string that is percent encoded based on RFC-3986.

◆ pctencode()

std::string shcore::pctencode ( std::string_view  s)

Generates a percent encoded string based on RFC-3986, only unreserved characters are not encoded.

◆ quote_string()

std::string shcore::quote_string ( const std::string &  s,
char  quote 
)

Escape quote and \ chars.

Parameters
sString to escape.
quote‘’"`
Returns
Quote escaped string.

◆ str_beginswith() [1/2]

template<typename... T>
bool shcore::str_beginswith ( std::string_view  s,
std::string_view  prefix,
T &&...  prefixes 
)
inline

◆ str_beginswith() [2/2]

template<typename... T>
bool shcore::str_beginswith ( std::wstring_view  s,
std::wstring_view  prefix,
T &&...  prefixes 
)
inline

◆ str_break_into_lines()

std::vector< std::string > shcore::str_break_into_lines ( const std::string &  line,
std::size_t  line_width 
)

Breaks string into lines of specified width without breaking words.

Parameters
linelong string to break.
line_widthmaximum line width
Returns
vector with split lines.

◆ str_casecmp() [1/4]

int shcore::str_casecmp ( const char *  a,
const char *  b 
)
inline

Compares 2 strings case insensitive (for ascii)

◆ str_casecmp() [2/4]

int shcore::str_casecmp ( const char *  a,
const char *  b,
size_t  n 
)
inline

◆ str_casecmp() [3/4]

int shcore::str_casecmp ( const wchar_t *  a,
const wchar_t *  b 
)
inline

◆ str_casecmp() [4/4]

int shcore::str_casecmp ( const wchar_t *  a,
const wchar_t *  b,
size_t  n 
)
inline

◆ str_caseeq() [1/2]

template<typename... T>
bool shcore::str_caseeq ( std::string_view  a,
std::string_view  token,
T &&...  tokens 
)
inline

◆ str_caseeq() [2/2]

template<typename... T>
bool shcore::str_caseeq ( std::wstring_view  a,
std::wstring_view  token,
T &&...  tokens 
)
inline

◆ str_casestr()

const char * shcore::str_casestr ( const char *  haystack,
const char *  needle 
)

◆ str_endswith() [1/2]

template<typename... T>
bool shcore::str_endswith ( std::string_view  s,
std::string_view  suffix,
T &&...  suffixes 
)
inline

◆ str_endswith() [2/2]

template<typename... T>
bool shcore::str_endswith ( std::wstring_view  s,
std::wstring_view  suffix,
T &&...  suffixes 
)
inline

◆ str_format()

std::string shcore::str_format ( const char *  formats,
  ... 
)

Return a formatted a string.

Throws invalid_argument on encoding error

◆ str_ibeginswith() [1/2]

template<typename... T>
bool shcore::str_ibeginswith ( std::string_view  s,
std::string_view  prefix,
T &&...  prefixes 
)
inline

◆ str_ibeginswith() [2/2]

template<typename... T>
bool shcore::str_ibeginswith ( std::wstring_view  s,
std::wstring_view  prefix,
T &&...  prefixes 
)
inline

◆ str_iendswith() [1/2]

template<typename... T>
bool shcore::str_iendswith ( std::string_view  s,
std::string_view  suffix,
T &&...  suffixes 
)
inline

◆ str_iendswith() [2/2]

template<typename... T>
bool shcore::str_iendswith ( std::wstring_view  s,
std::wstring_view  suffix,
T &&...  suffixes 
)
inline

◆ str_itersplit()

template<class TCallback >
bool shcore::str_itersplit ( std::string_view  input,
TCallback &&  f,
std::string_view  separator_chars = " \r\n\t",
int  maxsplit = -1,
bool  compress = false 
)
inline

Split the given input string and call the functor for each token.

Parameters
inputthe string to be split
fa functor called once for each split string. If its return value is false, the splitting is interrupted.
separator_charsString containing characters wherein the input string is split on any of the characters
maxsplitmax number of times to split or -1 for no limit
compressBoolean value which when true ensures consecutive separators do not generate new elements in the split, but they're still counted towards maxsplit.
Returns
false if f returns false, true otherwise

◆ str_join() [1/4]

template<typename C >
std::string shcore::str_join ( const C &  container,
std::string_view  sep 
)
inline

◆ str_join() [2/4]

template<typename C , typename CTransform >
std::string shcore::str_join ( const C &  container,
std::string_view  sep,
CTransform &&  f 
)
inline

◆ str_join() [3/4]

template<typename Iter >
std::string shcore::str_join ( Iter  begin,
Iter  end,
std::string_view  sep 
)
inline

◆ str_join() [4/4]

template<typename Iter , typename CTransform >
std::string shcore::str_join ( Iter  begin,
Iter  end,
std::string_view  sep,
CTransform &&  f 
)
inline

◆ str_ljust()

std::string shcore::str_ljust ( const std::string &  s,
size_t  width,
char  pad = ' ' 
)
inline

◆ str_lower() [1/2]

std::string shcore::str_lower ( std::string_view  s)
inline

Convert a copy of an ASCII string to lowercase and return.

◆ str_lower() [2/2]

std::wstring shcore::str_lower ( std::wstring_view  s)
inline

◆ str_lstrip()

std::string shcore::str_lstrip ( std::string_view  s,
std::string_view  chars 
)

◆ str_lstrip_view()

std::string_view shcore::str_lstrip_view ( std::string_view  s,
std::string_view  chars 
)

◆ str_partition()

template<class TOutput = std::string>
std::pair< TOutput, TOutput > shcore::str_partition ( std::string_view  s,
std::string_view  sep,
bool *  found_sep = nullptr 
)
inline

Partition a string in 2 at a separator, if present.

◆ str_partition_after()

template<class TOutput = std::string>
std::pair< TOutput, TOutput > shcore::str_partition_after ( std::string_view  s,
std::string_view  sep 
)
inline

Partition a string in 2 after separator, in place, if present.

◆ str_partition_after_inpl()

std::string shcore::str_partition_after_inpl ( std::string *  s,
const std::string &  sep 
)
inline

Partition a string in 2 after separator, in place, if present.

◆ str_replace() [1/2]

std::string JIT_EXECUTOR_PLUGIN_EXPORT shcore::str_replace ( std::string_view  s,
std::string_view  from,
std::string_view  to 
)

◆ str_replace() [2/2]

template<typename... Args>
std::string JIT_EXECUTOR_PLUGIN_EXPORT shcore::str_replace ( std::string_view  s,
std::string_view  from,
std::string_view  to,
const Args &...  rest 
)
inline

◆ str_rjust()

std::string shcore::str_rjust ( const std::string &  s,
size_t  width,
char  pad = ' ' 
)
inline

◆ str_rstrip()

std::string shcore::str_rstrip ( std::string_view  s,
std::string_view  chars 
)

◆ str_rstrip_view()

std::string_view shcore::str_rstrip_view ( std::string_view  s,
std::string_view  chars 
)

◆ str_span()

size_t shcore::str_span ( const std::string &  s1,
const std::string &  s2 
)
inline

Return position of the first difference in the strings or npos if they're the same.

◆ str_split()

std::vector< std::string > shcore::str_split ( std::string_view  input,
std::string_view  separator_chars = " \r\n\t",
int  maxsplit = -1,
bool  compress = false 
)
inline

Splits string based on each of the individual characters of the separator string.

Parameters
inputThe string to be split
separator_charsString containing characters wherein the input string is split on any of the characters
maxsplitmax number of times to split or -1 for no limit
compressBoolean value which when true ensures consecutive separators do not generate new elements in the split, but they're still counted towards maxsplit.
Returns
vector of splitted strings

◆ str_strip()

std::string shcore::str_strip ( std::string_view  s,
std::string_view  chars 
)

◆ str_strip_view()

std::string_view shcore::str_strip_view ( std::string_view  s,
std::string_view  chars 
)

Strip a string out of blank chars.

◆ str_subvars()

std::string shcore::str_subvars ( std::string_view  s,
const std::function< std::string(std::string_view)> &  subvar,
std::string_view  var_begin,
std::string_view  var_end 
)

◆ str_upper() [1/2]

std::string shcore::str_upper ( std::string_view  s)
inline

Convert a copy of an ASCII string to uppercase and return.

◆ str_upper() [2/2]

std::wstring shcore::str_upper ( std::wstring_view  s)
inline

◆ string_to_bits()

std::pair< uint64_t, int > shcore::string_to_bits ( std::string_view  s)

◆ string_to_hex()

std::string shcore::string_to_hex ( std::string_view  s,
bool  prefix 
)

◆ truncate() [1/4]

std::string shcore::truncate ( const char *  str,
const size_t  length,
const size_t  max_length 
)

Truncates the given string to max_length code points.

Parameters
strUTF-8 string to be truncated.
lengthLength of string in bytes.
max_lengthMaximum number of code points.
Returns
Input string truncated to max_length code points.

◆ truncate() [2/4]

std::string shcore::truncate ( const std::string &  str,
const size_t  max_length 
)

Truncates the given string to max_length code points.

Parameters
strUTF-8 string to be truncated.
max_lengthMaximum number of code points.
Returns
Input string truncated to max_length code points.

◆ truncate() [3/4]

std::wstring shcore::truncate ( const std::wstring &  str,
const size_t  max_length 
)

Truncates the given string to max_length code points.

Parameters
strUTF-16/UTF-32 string to be truncated.
max_lengthMaximum number of code points.
Returns
Input string truncated to max_length code points.

◆ truncate() [4/4]

std::wstring shcore::truncate ( const wchar_t *  str,
const size_t  length,
const size_t  max_length 
)

Truncates the given string to max_length code points.

Parameters
strUTF-16/UTF-32 string to be truncated.
lengthLength of string in bytes.
max_lengthMaximum number of code points.
Returns
Input string truncated to max_length code points.

◆ type_conversion_error()

Type_error shcore::type_conversion_error ( Value_type  from,
Value_type  expected 
)
inline

◆ type_description()

std::string shcore::type_description ( Value_type  type)

◆ type_name()

std::string shcore::type_name ( Value_type  type)

◆ type_range_error()

Type_error shcore::type_range_error ( Value_type  from,
Value_type  expected 
)
inline

◆ unquote_string()

std::string shcore::unquote_string ( std::string_view  s,
char  quote 
)

Inverse of quote_string().

If the first and the last characters in the given strings match quote they are removed as well.

Parameters
sString to be processed.
quoteThe quote character (‘’,"`)
Returns
Unquoted string.

◆ utf8_lower()

std::string shcore::utf8_lower ( std::string_view  s)
inline

◆ utf8_to_wide() [1/3]

std::wstring shcore::utf8_to_wide ( const char *  utf8)

Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string.

Parameters
utf8Pointer to UTF-8 encoded string.
Returns
std::wstring UTF-16/UTF-32 (platform dependent) string.

◆ utf8_to_wide() [2/3]

std::wstring shcore::utf8_to_wide ( const char *  utf8,
const size_t  utf8_length 
)

Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string.

Parameters
utf8Pointer to UTF-8 encoded string.
utf8_lengthLength of UTF-8 string in bytes.
Returns
std::wstring UTF-16/UTF-32 (platform dependent) string.

◆ utf8_to_wide() [3/3]

std::wstring shcore::utf8_to_wide ( const std::string &  utf8)

Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string.

Parameters
utf8UTF-8 encoded string.
Returns
std::wstring UTF-16/UTF-32 (platform dependent) string.

◆ utf8_upper()

std::string shcore::utf8_upper ( std::string_view  s)
inline

◆ wide_to_utf8() [1/3]

std::string shcore::wide_to_utf8 ( const std::wstring &  wide)

Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string.

Parameters
wideUTF-16/UTF-32 (platform dependent) encoded string.
Returns
std::string UTF-8 encoded string.

◆ wide_to_utf8() [2/3]

std::string shcore::wide_to_utf8 ( const wchar_t *  wide)

Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string.

Parameters
widePointer to UTF-16/UTF-32 (platform dependent) encoded string.
Returns
std::string UTF-8 encoded string.

◆ wide_to_utf8() [3/3]

std::string shcore::wide_to_utf8 ( const wchar_t *  wide,
const size_t  wide_length 
)

Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string.

Parameters
widePointer to UTF-16/UTF-32 (platform dependent) encoded string.
wide_lengthLength of UTF-16/UTF-32 string in bytes.
Returns
std::string UTF-8 encoded string.