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

Namespaces

namespace  cache
 
namespace  container
 
namespace  digester
 
namespace  http
 
namespace  interface
 
namespace  json
 
namespace  string
 

Classes

class  AuthorizeHandlerCallbakcs
 
struct  Column
 
struct  ColumnType
 
class  DateTime
 
class  DummyType
 
class  Error
 
struct  Generator8bitsValues
 
struct  GeneratorAlpha
 
struct  GeneratorAlphaNumeric
 
struct  GeneratorBase
 Base class for generators. More...
 
struct  GeneratorSmallAlpha
 
class  Jwt
 
class  JwtHolder
 
class  MakeSharedPtr
 
class  MediaDetector
 
class  MySQLRow
 
class  Optional
 Lightweight implementation of optional. More...
 
class  PluginMonitor
 
class  TaskControl
 
class  VariantPointer
 

Typedefs

using UUID = std::array< uint8_t, 16 >
 
using Base64NoPadd = Base64Base< Base64Alphabet::Base64Url, Base64Endianess::BIG, false, '='>
 

Enumerations

enum  MediaType {
  typeUnknownBinary , typeUnknownText , typePlain , typeHtml ,
  typeJs , typeCss , typePng , typeJpg ,
  typeIco , typeGif , typeBmp , typeAvi ,
  typeWav , typeJson , typeXieee754ClientJson , typeSvg
}
 
enum  JsonType {
  kNull , kBool , kString , kNumeric ,
  kJson , kBlob , kObject
}
 
enum  DataTypeInText { kDataInteger , kDataFloat , kDataString }
 
enum  State { k_stateInitialize , k_stateRunning , k_stateSuspended , k_stateStopped }
 

Functions

std::string to_string (const DummyType &)
 
UUID generate_uuid_v4 ()
 
std::string to_uuid_string (const UUID &uuid)
 
const char * get_mime_name_from_ext (const std::string &ext)
 
MediaType get_media_type_from_extension (const std::string &extenstion)
 
bool is_text_type (const MediaType mt)
 
const char * get_mime_name (MediaType mt)
 
std::string to_string (MediaType mt)
 
std::string txt_from_mysql_column_type (const MYSQL_FIELD *field)
 
JsonType from_mysql_column_string_type (const char *type)
 
ColumnType from_mysql_txt_column_type (const char *type)
 
uint64_t from_mysql_column_type_length (const char *type)
 
JsonType from_mysql_column_type (const MYSQL_FIELD *type)
 
std::string to_string (JsonType type)
 
DataTypeInText get_type_inside_text (const std::string &value)
 
bool operator<= (const DateTime &l, const DateTime &r)
 
template<class T >
bool operator== (const Optional< T > &lhs, const Optional< T > &rhs)
 
template<class T >
bool operator== (const T &lhs, const Optional< T > &rhs)
 
template<class T >
bool operator== (const Optional< T > &lhs, const T rhs)
 
template<typename String1 , typename String2 >
bool contains (const String1 &value, const String2 &sst)
 
template<typename String1 , typename String2 >
bool icontains (const String1 &value, const String2 &sst)
 
bool ends_with (const std::string &value, const std::string &sst)
 
template<typename String >
bool index (const std::string &value, const String &search_for, uint32_t *idx)
 
bool index (const char *value, const char *search_for, uint32_t *idx)
 
template<typename String1 , typename String2 >
bool starts_with (const String1 &value, const String2 &search_for)
 
template<typename String >
uint64_t to_uint64 (const String &str)
 
template<typename Container >
std::string as_string (const Container &c)
 
template<typename Generator = GeneratorSmallAlpha>
std::string generate_string (uint32_t length)
 
template<uint32_t length, typename Generator = GeneratorSmallAlpha>
std::string generate_string ()
 
template<typename Function >
void replace_if (std::string &value, Function &&to_replace, char replace_with)
 
void left (std::string *to_trim)
 
void right (std::string *to_trim)
 
void trim (std::string *to_trim)
 
std::string make_left (const std::string &to_trim)
 
std::string make_right (const std::string &to_trim)
 
std::string make_trim (const std::string &to_trim)
 
const std::string & to_string (const bool b)
 
const std::string & to_string (const std::string &value)
 
const char * to_cstr (const bool b)
 
template<typename Type >
std::string to_string (const std::optional< Type > &v)
 
template<typename Type >
std::string type_name ()
 
static const auto & get_txt_type_mapping ()
 
static std::string appedn_unsigned (const MYSQL_FIELD *field)
 
static std::string append_length (const MYSQL_FIELD *field)
 
static std::string append_length_dec (const MYSQL_FIELD *field)
 
void remove_suffix_after (std::string_view &v, char c)
 
std::string as_string (const std::vector< unsigned char > &c)
 
std::vector< uint8_t > as_array (const std::string &s)
 
template<typename Document >
void doc_set_member (Document &doc, std::string_view name, std::string_view value)
 
std::string encode_HS256 (const std::string &secret, const std::string &message)
 

Variables

const std::string k_none {"none"}
 
const std::string k_true {"true"}
 
const std::string k_false {"false"}
 
const std::string kHeaderClaimAlgorithm {"alg"}
 
const std::string kHeaderClaimType {"typ"}
 

Typedef Documentation

◆ Base64NoPadd

◆ UUID

using helper::UUID = typedef std::array<uint8_t, 16>

Enumeration Type Documentation

◆ DataTypeInText

Enumerator
kDataInteger 
kDataFloat 
kDataString 

◆ JsonType

Enumerator
kNull 
kBool 
kString 
kNumeric 
kJson 
kBlob 
kObject 

◆ MediaType

Enumerator
typeUnknownBinary 
typeUnknownText 
typePlain 
typeHtml 
typeJs 
typeCss 
typePng 
typeJpg 
typeIco 
typeGif 
typeBmp 
typeAvi 
typeWav 
typeJson 
typeXieee754ClientJson 
typeSvg 

◆ State

Enumerator
k_stateInitialize 
k_stateRunning 
k_stateSuspended 
k_stateStopped 

Function Documentation

◆ appedn_unsigned()

static std::string helper::appedn_unsigned ( const MYSQL_FIELD field)
static

◆ append_length()

static std::string helper::append_length ( const MYSQL_FIELD field)
static

◆ append_length_dec()

static std::string helper::append_length_dec ( const MYSQL_FIELD field)
static

◆ as_array()

std::vector< uint8_t > helper::as_array ( const std::string &  s)

◆ as_string() [1/2]

template<typename Container >
std::string helper::as_string ( const Container &  c)
inline

◆ as_string() [2/2]

std::string helper::as_string ( const std::vector< unsigned char > &  c)

◆ contains()

template<typename String1 , typename String2 >
bool helper::contains ( const String1 &  value,
const String2 &  sst 
)

◆ doc_set_member()

template<typename Document >
void helper::doc_set_member ( Document &  doc,
std::string_view  name,
std::string_view  value 
)

◆ encode_HS256()

std::string helper::encode_HS256 ( const std::string &  secret,
const std::string &  message 
)

◆ ends_with()

bool helper::ends_with ( const std::string &  value,
const std::string &  sst 
)
inline

◆ from_mysql_column_string_type()

JsonType helper::from_mysql_column_string_type ( const char *  type)

◆ from_mysql_column_type()

JsonType helper::from_mysql_column_type ( const MYSQL_FIELD type)

◆ from_mysql_column_type_length()

uint64_t helper::from_mysql_column_type_length ( const char *  type)

◆ from_mysql_txt_column_type()

ColumnType helper::from_mysql_txt_column_type ( const char *  type)

◆ generate_string() [1/2]

template<uint32_t length, typename Generator = GeneratorSmallAlpha>
std::string helper::generate_string ( )
inline

◆ generate_string() [2/2]

template<typename Generator = GeneratorSmallAlpha>
std::string helper::generate_string ( uint32_t  length)
inline

◆ generate_uuid_v4()

UUID helper::generate_uuid_v4 ( )
inline

◆ get_media_type_from_extension()

MediaType helper::get_media_type_from_extension ( const std::string &  extenstion)

◆ get_mime_name()

const char * helper::get_mime_name ( MediaType  mt)

◆ get_mime_name_from_ext()

const char * helper::get_mime_name_from_ext ( const std::string &  ext)

◆ get_txt_type_mapping()

static const auto & helper::get_txt_type_mapping ( )
static

◆ get_type_inside_text()

DataTypeInText helper::get_type_inside_text ( const std::string &  value)

◆ icontains()

template<typename String1 , typename String2 >
bool helper::icontains ( const String1 &  value,
const String2 &  sst 
)

◆ index() [1/2]

bool helper::index ( const char *  value,
const char *  search_for,
uint32_t *  idx 
)
inline

◆ index() [2/2]

template<typename String >
bool helper::index ( const std::string &  value,
const String search_for,
uint32_t *  idx 
)

◆ is_text_type()

bool helper::is_text_type ( const MediaType  mt)

◆ left()

void helper::left ( std::string *  to_trim)
inline

◆ make_left()

std::string helper::make_left ( const std::string &  to_trim)
inline

◆ make_right()

std::string helper::make_right ( const std::string &  to_trim)
inline

◆ make_trim()

std::string helper::make_trim ( const std::string &  to_trim)
inline

◆ operator<=()

bool helper::operator<= ( const DateTime l,
const DateTime r 
)
inline

◆ operator==() [1/3]

template<class T >
bool helper::operator== ( const Optional< T > &  lhs,
const Optional< T > &  rhs 
)

◆ operator==() [2/3]

template<class T >
bool helper::operator== ( const Optional< T > &  lhs,
const T  rhs 
)

◆ operator==() [3/3]

template<class T >
bool helper::operator== ( const T lhs,
const Optional< T > &  rhs 
)

◆ remove_suffix_after()

void helper::remove_suffix_after ( std::string_view &  v,
char  c 
)

◆ replace_if()

template<typename Function >
void helper::replace_if ( std::string &  value,
Function &&  to_replace,
char  replace_with 
)

◆ right()

void helper::right ( std::string *  to_trim)
inline

◆ starts_with()

template<typename String1 , typename String2 >
bool helper::starts_with ( const String1 &  value,
const String2 &  search_for 
)

◆ to_cstr()

const char * helper::to_cstr ( const bool  b)
inline

◆ to_string() [1/6]

const std::string & helper::to_string ( const bool  b)
inline

◆ to_string() [2/6]

std::string helper::to_string ( const DummyType )
inline

◆ to_string() [3/6]

template<typename Type >
std::string helper::to_string ( const std::optional< Type > &  v)

◆ to_string() [4/6]

const std::string & helper::to_string ( const std::string &  value)
inline

◆ to_string() [5/6]

std::string helper::to_string ( JsonType  type)

◆ to_string() [6/6]

std::string helper::to_string ( MediaType  mt)

◆ to_uint64()

template<typename String >
uint64_t helper::to_uint64 ( const String str)

◆ to_uuid_string()

std::string helper::to_uuid_string ( const UUID uuid)
inline

◆ trim()

void helper::trim ( std::string *  to_trim)
inline

◆ txt_from_mysql_column_type()

std::string helper::txt_from_mysql_column_type ( const MYSQL_FIELD field)

◆ type_name()

template<typename Type >
std::string helper::type_name ( )

Variable Documentation

◆ k_false

const std::string helper::k_false {"false"}

◆ k_none

const std::string helper::k_none {"none"}

◆ k_true

const std::string helper::k_true {"true"}

◆ kHeaderClaimAlgorithm

const std::string helper::kHeaderClaimAlgorithm {"alg"}

◆ kHeaderClaimType

const std::string helper::kHeaderClaimType {"typ"}