summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/struct_definition.hh
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-11-13 10:05:19 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-11-13 10:05:19 -0300
commitbdf4396dfefb0462605b741df674de764c9afaac (patch)
tree972e6d09a23ef8cfc3c2aaefdeae6acac2ecc7b5 /src/bin/eolian_mono/eolian/mono/struct_definition.hh
parent790fa0e04b9760ee99ce33839191936159430df5 (diff)
csharp: Add conversion methods for generated types
Summary: This also adds a helper method to convert from a value type name to the reference type name. (e.g. int to Int32). Ref T8430 Reviewers: felipealmeida, brunobelo, YOhoho Reviewed By: brunobelo Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8430 Differential Revision: https://phab.enlightenment.org/D10653
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/struct_definition.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index c733432465..b3b8d717f6 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -493,6 +493,26 @@ struct struct_definition_generator
493 ).generate(sink, attributes::unused, context)) 493 ).generate(sink, attributes::unused, context))
494 return false; 494 return false;
495 495
496 if(!as_generator(
497 indent << scope_tab << "/// <summary>Conversion to the managed representation from a native pointer.\n"
498 ).generate(sink, attributes::unused, context))
499 return false;
500
501 if (!struct_.documentation.since.empty())
502 if (!as_generator(indent << scope_tab << "/// <para>Since EFL " + struct_.documentation.since + ".</para>\n"
503 ).generate(sink, attributes::unused, context))
504 return false;
505
506 if (!as_generator(
507 indent << scope_tab << "/// </summary>\n"
508 << indent << scope_tab << "/// <param name=\"ptr\">Native pointer to be converted.</param>\n"
509 << indent << scope_tab << "public static " << struct_name << " FromIntPtr(IntPtr ptr)\n"
510 << indent << scope_tab << "{\n"
511 << indent << scope_tab << scope_tab << "return ptr;\n"
512 << indent << scope_tab << "}\n\n"
513 ).generate(sink, attributes::unused, context))
514 return false;
515
496 if (!struct_internal_definition.generate(sink, struct_, change_indentation(indent.inc(), context))) 516 if (!struct_internal_definition.generate(sink, struct_, change_indentation(indent.inc(), context)))
497 return false; 517 return false;
498 518