Add additional PBD::string_to/to_string specializations for PBD::ID
authorTim Mayberry <mojofunk@gmail.com>
Sat, 15 Apr 2017 12:02:40 +0000 (22:02 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Tue, 18 Apr 2017 23:37:02 +0000 (09:37 +1000)
libs/pbd/pbd/types_convert.h

index 9a1e3c8461796b69a94f5bbee209c3c4f23bc295..b0cf7c0884a4368fa6b910929e8bc3dc602bc8b9 100644 (file)
@@ -43,6 +43,18 @@ inline bool string_to (const std::string& str, ID& val)
        return true;
 }
 
+template <>
+inline std::string to_string (ID val)
+{
+       return val.to_s();
+}
+
+template <>
+inline ID string_to (const std::string& str)
+{
+       return ID(str);
+}
+
 } // namespace PBD
 
 #endif // PBD_TYPES_CONVERT_H