#include <evo/type.h>
template<class T, class C>
struct evo::Convert< T, C >
Generic value conversion template.
- This is specialized to define supported automatic value conversions between types
- This is used internally, though additional conversions may be added by adding more specializations
- See Custom String Conversion/Formatting
- Template Parameters
-
T | Conversion source value type |
C | Conversion target type |
|
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...
|
|
◆ add()
static void add |
( |
C & |
dest, |
|
|
T |
value |
|
) |
| |
|
staticdelete |
Add/Append value to target (reversed conversion).
- Parameters
-
dest | Destination to add to |
value | Value to add |
◆ addq()
static bool addq |
( |
C & |
dest, |
|
|
T |
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
-
dest | Destination to add to |
value | Value to add |
delim | Delimiter 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, |
|
|
T |
value |
|
) |
| |
|
staticdelete |
Set target to value (reversed conversion).
- Parameters
-
dest | Destination to set |
value | Value to set |
◆ value()
static const T& value |
( |
const T & |
src | ) |
|
|
staticdelete |
Convert value to target.
- Parameters
-
src | Source value to convert |
- Returns
- Converted value
The documentation for this struct was generated from the following file: