GetPropertyName() api returns string_view instead of string. 98/248898/1
authorSubhransu Mohanty <sub.mohanty@samsung.com>
Thu, 3 Dec 2020 05:16:38 +0000 (14:16 +0900)
committerSubhransu Mohanty <sub.mohanty@samsung.com>
Thu, 3 Dec 2020 05:50:16 +0000 (14:50 +0900)
Change-Id: I4f681180b40d82f46a4b64b16aa28b87d0ad4c10

dali-csharp-binder/src/dali_wrap.cpp

index b4f1ed4..0498357 100755 (executable)
@@ -164,6 +164,7 @@ template <typename T> T SwigValueInit() {
 
 #include <stdlib.h>
 #include <string.h>
+#include <string_view>
 #include <stdio.h>
 
 /* Support for throwing C# exceptions from C/C++. There are two types:
@@ -13692,17 +13693,17 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Dali_TypeInfo_GetPropertyName(void * jarg1,
   char * jresult ;
   Dali::TypeInfo *arg1 = (Dali::TypeInfo *) 0 ;
   Dali::Property::Index arg2 ;
-  std::string *result = 0 ;
+  std::string_view result;
 
   arg1 = (Dali::TypeInfo *)jarg1;
   arg2 = (Dali::Property::Index)jarg2;
   {
     try {
-      result = (std::string *) &((Dali::TypeInfo const *)arg1)->GetPropertyName(arg2);
+      result = ((Dali::TypeInfo const *)arg1)->GetPropertyName(arg2);
     } CALL_CATCH_EXCEPTION(0);
   }
 
-  jresult = SWIG_csharp_string_callback(result->c_str());
+  jresult = SWIG_csharp_string_callback(result.data());
   return jresult;
 }