struct in_traits<eina::string_view> { typedef eina::string_view type; };
template <>
struct in_traits<eina::string_view const> { typedef eina::string_view const type; };
+template <>
+struct in_traits<eina::stringshare> { typedef eina::stringshare type; };
+template <>
+struct in_traits<eina::stringshare const> { typedef eina::stringshare const type; };
template <typename T>
struct in_traits<T&> { typedef T& type; };
template <typename T>
if(view)
*view = {string};
}
+template <typename Tag>
+void assign_out_impl(efl::eina::stringshare& to, const char* from, Tag)
+{
+ to = {from};
+}
template <typename T>
void assign_out_impl(T*& lhs, T& rhs, tag<T*, T>) // optional
{
{
return x.c_str();
}
+inline const char* convert_to_c_impl(efl::eina::stringshare x, tag<const char*, efl::eina::stringshare, true>)
+{
+ return eina_stringshare_ref(x.c_str());
+}
template <typename T>
Eina_Promise* convert_to_c_impl(efl::eina::future<T> const&, tag<Eina_Promise*, efl::eina::future<T>const&>)
{
// const should be to the type if value is const
return T{const_cast<typename std::remove_const<U>::type*>(value)};
}
+inline eina::stringshare convert_to_return(const Eina_Stringshare* value, tag<const char*, efl::eina::stringshare>)
+{
+ return efl::eina::stringshare(value);
+}
template <typename T>
T convert_to_return(const char** /*value*/, tag<const char**, T>, typename std::enable_if<std::is_same<T, efl::eina::string_view*>::value>::type* = 0)
{
r.base_qualifier.qualifier ^= qualifier_info::is_ref;
return replace_base_type(r, " ::efl::eina::string_view");
}}
+ , {"stringshare", nullptr, [&]
+ {
+ regular_type_def r = regular;
+ r.base_qualifier.qualifier ^= qualifier_info::is_ref;
+ return replace_base_type(r, " ::efl::eina::stringshare");
+ }}
, {"generic_value", nullptr, [&]
{ return regular_type_def{" ::efl::eina::value", regular.base_qualifier, {}};
}}
{
ck_assert_str_eq(*v, "foobar");
}
+
+void _name1_name2_type_generation_instringshare(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, const char *v EINA_UNUSED)
+{
+ ck_assert_str_eq(v, "foobar");
+ ck_assert(eina_stringshare_add(v) == v);
+ eina_stringshare_del(v);
+}
+
+void _name1_name2_type_generation_instringshareown(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, const char * v EINA_UNUSED)
+{
+ ck_assert_str_eq(v, "foobar");
+ eina_stringshare_del(v);
+}
+
void _name1_name2_type_generation_instringptrown(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, const char * *v)
{
ck_assert_str_eq(*v, "foobar");
return &foobar;
}
+Eina_Stringshare* _name1_name2_type_generation_returnstringshare(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED)
+{
+ return eina_stringshare_add("foobar");
+}
+
+Eina_Stringshare* _name1_name2_type_generation_returnstringshareown(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED)
+{
+ return eina_stringshare_add("foobar");
+}
+
const char * _name1_name2_type_generation_returnstringown(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED)
{
const char foobar[] = "foobar";
{
}
+void _name1_name2_type_generation_outstringshare(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, Eina_Stringshare** v)
+{
+ *v = eina_stringshare_add("foobar");
+}
+
+void _name1_name2_type_generation_outstringshareown(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, Eina_Stringshare** v)
+{
+ *v = eina_stringshare_add("foobar");
+}
+
void _name1_name2_type_generation_inclassname(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, Name1_Name2_Type_Generation *v EINA_UNUSED)
{
}
@in v: own(ref(string));
}
}
+ instringshare {
+ params {
+ @in v: stringshare;
+ }
+ }
+ instringshareown {
+ params {
+ @in v: own(stringshare);
+ }
+ }
// return
returnrefint {
return: ref(int);
returnstringownptr {
return: own(ref(string));
}
+ returnstringshare {
+ return: stringshare;
+ }
+ returnstringshareown {
+ return: own(stringshare);
+ }
// out
outvoidptr {
params {
@out v: free(own(ref(int)), free);
}
}
+ outstringshare {
+ params {
+ @out v: stringshare;
+ }
+ }
+ outstringshareown {
+ params {
+ @out v: own(stringshare);
+ }
+ }
+ // classname
inclassname {
params {
@in v: Name1.Name2.Type_Generation;