 |
Ardour
8.12
|
Go to the documentation of this file.
20 #ifndef PBD_ENUM_CONVERT_H
21 #define PBD_ENUM_CONVERT_H
28 #define TO_STRING_FULL(Type) \
30 inline bool to_string (Type val, std::string& str) \
32 str = enum_2_string (val); \
36 #define STRING_TO_FULL(Type) \
38 inline bool string_to (const std::string& str, Type& val) \
40 val = (Type)string_2_enum (str, val); \
44 #define TO_STRING(Type) \
45 template<> inline std::string to_string (Type val) \
46 { return enum_2_string (val); }
48 #define STRING_TO(Type) \
49 template<> inline Type string_to (const std::string& str) \
50 { Type val; return (Type) string_2_enum (str, val); }
52 #define DEFINE_ENUM_CONVERT(Type) \
53 TO_STRING_FULL (Type) \
54 STRING_TO_FULL (Type) \