All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Radiant::StringUtils Namespace Reference

StringUtils is a collection of string manipulation functions. More...

Functions

QByteArray demangle (const char *name)
 Demangle names used by the compiler for example "N12MultiWidgets11ImageWidgetE" -> "MultiWidgets::ImageWidget" If the name can't be parsed, the original string is returned. More...
 
void eraseNonVisibles (QString &s)
 Remove non-visible characters from QString. More...
 
template<typename T >
std::enable_if<!std::is_enum
< T >::value, T >::type 
fromString (const QByteArray &str)
 Convert string to type T. More...
 
template<typename T >
std::enable_if< std::is_enum
< T >::value, T >::type 
fromString (const QByteArray &str)
 Convert string to type T. More...
 
template<class T >
std::enable_if<!std::is_enum
< T >::value, QString >::type 
toString (const T &x)
 Converts to string. More...
 
template<typename T >
std::enable_if< std::is_enum
< T >::value, QString >::type 
toString (const T &x)
 
template<>
QString toString< bool > (const bool &b)
 Convert boolean to string. More...
 
template<typename T >
QByteArray type (const T &t)
 

Detailed Description

StringUtils is a collection of string manipulation functions.

Function Documentation

QByteArray Radiant::StringUtils::demangle ( const char *  name)

Demangle names used by the compiler for example "N12MultiWidgets11ImageWidgetE" -> "MultiWidgets::ImageWidget" If the name can't be parsed, the original string is returned.

Parameters
nameMangled symbol name
Returns
Demangled symbol name
void Radiant::StringUtils::eraseNonVisibles ( QString &  s)

Remove non-visible characters from QString.

Parameters
sString to process
template<typename T >
std::enable_if<!std::is_enum<T>::value, T>::type Radiant::StringUtils::fromString ( const QByteArray &  str)
inline

Convert string to type T.

Parameters
strString to convert
Returns
Value converted from string
Template Parameters
TType of value returned
template<typename T >
std::enable_if<std::is_enum<T>::value, T>::type Radiant::StringUtils::fromString ( const QByteArray &  str)
inline

Convert string to type T.

Parameters
strString to convert
Returns
Value converted from string
Template Parameters
TType of value returned
template<class T >
std::enable_if<!std::is_enum<T>::value, QString>::type Radiant::StringUtils::toString ( const T &  x)
inline

Converts to string.

Parameters
xValue to convert
Returns
Value as a string
Template Parameters
TType of the value to convert
template<>
QString Radiant::StringUtils::toString< bool > ( const bool &  b)
inline

Convert boolean to string.

Parameters
bboolean to convert
Returns
"1" or "0"