summaryrefslogtreecommitdiff
path: root/src/lib/eolian_cxx/grammar/klass_def.hpp
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-09-10 19:30:46 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-09-10 19:30:47 -0300
commitdfb856158c8ea37d9caa170a6794447ec18ecdd9 (patch)
tree7d9130fac1c8d4a46341192feb965d842279f2fc /src/lib/eolian_cxx/grammar/klass_def.hpp
parentd1890f5eca0b439c902999716ed0a49634e848a1 (diff)
csharp: Skip non-public members from interfaces
Summary: Eolian allows non-public members in interfaces and mixins (usually @protected). As both kinds are converted to C# interfaces, this causes problem as non-public members are forbidden in C# interfaces. This commit changes eolian_mono by removing those members from the C# interfaces. If a generated class implements the interface, the method is generated as if it were a protected member of the class directly. For mixed properties like `Efl.Io.Reader.CanRead { get; set @protected; }`, the interface has only the public getter and the the implementing class has both the public getter and the protected setter. With this, C# devs won't be able to directly implement protected Eo methods from interfaces. (But this really does not make sense from the C# point of view). ref T7494 Reviewers: segfaultxavi, felipealmeida, YOhoho Reviewed By: YOhoho Subscribers: cedric, brunobelo, Jaehyun_Cho, #reviewers, woohyun, #committers Tags: #efl Maniphest Tasks: T7494 Differential Revision: https://phab.enlightenment.org/D9800
Diffstat (limited to '')
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 108be02f79..683bb000a4 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -1277,6 +1277,26 @@ struct klass_def
1277 || lhs.parts < rhs.parts; 1277 || lhs.parts < rhs.parts;
1278 } 1278 }
1279 1279
1280 friend inline bool operator==(klass_def const& lhs, klass_name const& rhs)
1281 {
1282 return lhs.namespaces == rhs.namespaces
1283 && lhs.eolian_name == rhs.eolian_name
1284 && lhs.type == rhs.type;
1285 }
1286 friend inline bool operator==(klass_name const& lhs, klass_def const& rhs)
1287 {
1288 return rhs == lhs;
1289 }
1290 friend inline bool operator!=(klass_def const& lhs, klass_name const& rhs)
1291 {
1292 return !(lhs == rhs);
1293 }
1294 friend inline bool operator!=(klass_name const& lhs, klass_def const& rhs)
1295 {
1296 return !(rhs == lhs);
1297 }
1298
1299
1280 klass_def(std::string eolian_name, std::string cxx_name, std::string filename 1300 klass_def(std::string eolian_name, std::string cxx_name, std::string filename
1281 , documentation_def documentation 1301 , documentation_def documentation
1282 , std::vector<std::string> namespaces 1302 , std::vector<std::string> namespaces