summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2020-01-06 19:07:28 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2020-01-06 19:07:28 +0900
commit1507ade7875ad485cedb49c0d32ce510685bd0e1 (patch)
treefab209b5c9ce8b90efc6a3e5d788edb689947aba
parent207da69c97d86ccd6f1e354b60b579a3d81f375c (diff)
eolian_mono: add namespace to extension methods of ItemFactory
Summary: Like other classes and methods, the classes and methods for extension methods of ItemFactory are moved inside the namespace. Consequently, the namespace in the class name for extension methods is removed to avoid duplicate namespace name. Reviewers: lauromoura, felipealmeida, YOhoho, woohyun Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10972
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh10
-rw-r--r--src/tests/efl_mono/Model.cs1
-rw-r--r--src/tests/efl_mono/Parts.cs1
3 files changed, 10 insertions, 2 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index 478c6a9c80..6c6fd906cd 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -397,11 +397,14 @@ struct klass
397 if (extension_method_stream.tellp() <= 0) 397 if (extension_method_stream.tellp() <= 0)
398 return true; 398 return true;
399 399
400 if (!name_helpers::open_namespaces(sink, cls.namespaces, context))
401 return false;
402
400 if(!as_generator 403 if(!as_generator
401 (lit("#if EFL_BETA\n") 404 (lit("#if EFL_BETA\n")
402 << "#pragma warning disable CS1591\n" // Disabling warnings as DocFx will hide these classes 405 << "#pragma warning disable CS1591\n" // Disabling warnings as DocFx will hide these classes
403 <<"public static class " << (string % "_") << name_helpers::klass_inherit_name(cls) 406 << "public static class " << name_helpers::klass_concrete_name(cls)
404 << "_ExtensionMethods {\n" 407 << "ExtensionMethods {\n"
405 << extension_method_stream.str() 408 << extension_method_stream.str()
406 << "}\n" 409 << "}\n"
407 << "#pragma warning restore CS1591\n" 410 << "#pragma warning restore CS1591\n"
@@ -409,6 +412,9 @@ struct klass
409 .generate(sink, cls.namespaces, context)) 412 .generate(sink, cls.namespaces, context))
410 return false; 413 return false;
411 414
415 if (!name_helpers::close_namespaces(sink, cls.namespaces, context))
416 return false;
417
412 return true; 418 return true;
413 } 419 }
414 420
diff --git a/src/tests/efl_mono/Model.cs b/src/tests/efl_mono/Model.cs
index bb6ba3b01c..69596af25d 100644
--- a/src/tests/efl_mono/Model.cs
+++ b/src/tests/efl_mono/Model.cs
@@ -3,6 +3,7 @@
3using System; 3using System;
4using System.Threading.Tasks; 4using System.Threading.Tasks;
5using System.Diagnostics.CodeAnalysis; 5using System.Diagnostics.CodeAnalysis;
6using Efl.Ui;
6 7
7#if EFL_BETA 8#if EFL_BETA
8 9
diff --git a/src/tests/efl_mono/Parts.cs b/src/tests/efl_mono/Parts.cs
index 3e2da24152..e206681e1a 100644
--- a/src/tests/efl_mono/Parts.cs
+++ b/src/tests/efl_mono/Parts.cs
@@ -19,6 +19,7 @@
19 19
20using System; 20using System;
21using System.Diagnostics.CodeAnalysis; 21using System.Diagnostics.CodeAnalysis;
22using Efl.Ui;
22 23
23namespace TestSuite { 24namespace TestSuite {
24 25