diff options
author | Bernard Normier <bernard@zeroc.com> | 2018-10-18 14:26:42 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2018-10-18 14:26:42 -0400 |
commit | d8df1157c9dc0b3ce6d0fe31c06ff0b112b5886d (patch) | |
tree | 5b105c05b4f8842dcc5014fc59eb0a23a4f0a2fb /cpp/src/Slice/Parser.cpp | |
parent | Fix JS warnings regarding build dependencies (diff) | |
download | ice-d8df1157c9dc0b3ce6d0fe31c06ff0b112b5886d.tar.bz2 ice-d8df1157c9dc0b3ce6d0fe31c06ff0b112b5886d.tar.xz ice-d8df1157c9dc0b3ce6d0fe31c06ff0b112b5886d.zip |
slice2cs no longer generates empty namespaces
Fixes #246
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index ada7e2070f1..21faf648c1e 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -2443,18 +2443,39 @@ Slice::Container::hasOnlyClassDecls() const } bool -Slice::Container::hasAbstractClassDefs() const +Slice::Container::hasOperations() const { for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) { ClassDefPtr cl = ClassDefPtr::dynamicCast(*p); - if(cl && cl->isAbstract()) + if(cl && cl->hasOperations()) { return true; } ContainerPtr container = ContainerPtr::dynamicCast(*p); - if(container && container->hasAbstractClassDefs()) + if(container && container->hasOperations()) + { + return true; + } + } + + return false; +} + +bool +Slice::Container::hasNonLocalAbstractClassDefs() const +{ + for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) + { + ClassDefPtr cl = ClassDefPtr::dynamicCast(*p); + if(cl && cl->isAbstract() && !cl->isLocal()) + { + return true; + } + + ContainerPtr container = ContainerPtr::dynamicCast(*p); + if(container && container->hasNonLocalAbstractClassDefs()) { return true; } |