diff --git a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh index 47b11db1d8..0bf92b55aa 100644 --- a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh +++ b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh @@ -749,7 +749,9 @@ inline eina::string_view convert_to_return(const char** value, tag) +template +inline std::string convert_to_return(const char* value, tag + , typename std::enable_if::type, std::string>::value>::type* = 0) { if(value) { @@ -760,7 +762,36 @@ inline std::string convert_to_return(const char* value, tag) +template +inline std::string convert_to_return(const char** value, tag + , typename std::enable_if::type, std::string>::value>::type* = 0) +{ + if(value) + { + std::string r{*value}; + free((void*)*value); + free((void*)value); + return r; + } + else + return {}; +} +template +inline std::string convert_to_return(char* value, tag + , typename std::enable_if::type, std::string>::value>::type* = 0) +{ + if(value) + { + std::string r{value}; + free((void*)value); + return r; + } + else + return {}; +} +template +inline std::string convert_to_return(char** value, tag + , typename std::enable_if::type, std::string>::value>::type* = 0) { if(value) {