Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
StringUtils.h File Reference
#include <stdarg.h>
#include <stdint.h>
#include <string>
#include <vector>
#include <sstream>
#include <locale>
#include "utils/TimeFormat.h"
#include "utils/params_check_macros.h"
#include <fmt/format.h>

Classes

class  StringUtils
 
struct  sortstringbyname
 

Macros

#define DEF_TO_STR_NAME(x)   #x
 C-processor Token stringification.
 
#define DEF_TO_STR_VALUE(x)   DEF_TO_STR_NAME(x)
 

Functions

template<typename T , std::enable_if_t<!std::is_enum< T >::value, int > = 0>
constexpr auto && EnumToInt (T &&arg) noexcept
 
template<typename T , std::enable_if_t< std::is_enum< T >::value, int > = 0>
constexpr auto EnumToInt (T &&arg) noexcept
 

Macro Definition Documentation

◆ DEF_TO_STR_NAME

#define DEF_TO_STR_NAME ( x)    #x

C-processor Token stringification.

The following macros can be used to stringify definitions to C style strings.

Example:

#define foo 4 DEF_TO_STR_NAME(foo) // outputs "foo" DEF_TO_STR_VALUE(foo) // outputs "4"

◆ DEF_TO_STR_VALUE

#define DEF_TO_STR_VALUE ( x)    DEF_TO_STR_NAME(x)

Function Documentation

◆ EnumToInt() [1/2]

template<typename T , std::enable_if_t<!std::is_enum< T >::value, int > = 0>
auto && EnumToInt ( T && arg)
constexprnoexcept

◆ EnumToInt() [2/2]

template<typename T , std::enable_if_t< std::is_enum< T >::value, int > = 0>
auto EnumToInt ( T && arg)
constexprnoexcept