Evo C++ Library v0.5.1
Static Public Member Functions | List of all members
Convert< T, C > Struct Template Reference

#include <evo/type.h>

Detailed Description

template<class T, class C>
struct evo::Convert< T, C >

Generic value conversion template.

Template Parameters
TConversion source value type
CConversion target type

Static Public Member Functions

static void add (C &dest, T value)=delete
 Add/Append value to target (reversed conversion). More...
 
static bool addq (C &dest, T value, typename C::Value delim)=delete
 Add/Append value to target with quoting when needed (reversed conversion). More...
 
static void set (C &dest, T value)=delete
 Set target to value (reversed conversion). More...
 
static const T & value (const T &src)=delete
 Convert value to target. More...
 

Member Function Documentation

◆ add()

static void add ( C &  dest,
value 
)
staticdelete

Add/Append value to target (reversed conversion).

Parameters
destDestination to add to
valueValue to add

◆ addq()

static bool addq ( C &  dest,
value,
typename C::Value  delim 
)
staticdelete

Add/Append value to target with quoting when needed (reversed conversion).

  • When applicable, strings are scanned to determine how to quote:
    • no quoting if delim not preset and doesn't start with any quotes (containing quotes is ok)
    • single-quoting ( ' ), double-quoting ( " ), backtick-quoting ( \` ): 'foo bar' - triple-quoting ( ''' or """ or ``` ): '''foo bar'''
    • backtick-DEL (backtick then code 7F) quoting as a rare last resort ( `␡ ): `␡foo bar`␡
Parameters
destDestination to add to
valueValue to add
delimDelimiter to consider for quoting
Returns
Whether successful, false if input is a string and is not quotable (invalid text)

◆ set()

static void set ( C &  dest,
value 
)
staticdelete

Set target to value (reversed conversion).

Parameters
destDestination to set
valueValue to set

◆ value()

static const T& value ( const T &  src)
staticdelete

Convert value to target.

Parameters
srcSource value to convert
Returns
Converted value

The documentation for this struct was generated from the following file: