Ardour  8.7-15-gadf511264b
enum_convert.h File Reference
#include <typeinfo>
#include "pbd/enumwriter.h"
#include "pbd/string_convert.h"
Include dependency graph for enum_convert.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TO_STRING_FULL(Type)
 
#define STRING_TO_FULL(Type)
 
#define TO_STRING(Type)
 
#define STRING_TO(Type)
 
#define DEFINE_ENUM_CONVERT(Type)
 

Macro Definition Documentation

◆ DEFINE_ENUM_CONVERT

#define DEFINE_ENUM_CONVERT (   Type)
Value:
TO_STRING_FULL (Type) \
STRING_TO_FULL (Type) \
TO_STRING (Type) \
STRING_TO (Type)
#define TO_STRING_FULL(Type)
Definition: enum_convert.h:28

Definition at line 52 of file enum_convert.h.

◆ STRING_TO

#define STRING_TO (   Type)
Value:
template<> inline Type string_to (const std::string& str) \
{ Type val; return (Type) string_2_enum (str, val); }
#define string_2_enum(str, e)
Definition: enumwriter.h:98
ARDOUR::timepos_t string_to(std::string const &str)

Definition at line 48 of file enum_convert.h.

◆ STRING_TO_FULL

#define STRING_TO_FULL (   Type)
Value:
template <> \
inline bool string_to (const std::string& str, Type& val) \
{ \
val = (Type)string_2_enum (str, val); \
return true; \
}

Definition at line 36 of file enum_convert.h.

◆ TO_STRING

#define TO_STRING (   Type)
Value:
template<> inline std::string to_string (Type val) \
{ return enum_2_string (val); }
#define enum_2_string(e)
Definition: enumwriter.h:97
std::string to_string(ARDOUR::timepos_t val)

Definition at line 44 of file enum_convert.h.

◆ TO_STRING_FULL

#define TO_STRING_FULL (   Type)
Value:
template <> \
inline bool to_string (Type val, std::string& str) \
{ \
str = enum_2_string (val); \
return true; \
}

Definition at line 28 of file enum_convert.h.