diff options
author | Marc Laukien <marc@zeroc.com> | 2001-10-11 20:19:57 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-10-11 20:19:57 +0000 |
commit | e4bb48bcdd8659f7fe0131edf62a05783085997f (patch) | |
tree | 17a1ae8b5e3ff2c03d6e481ab84944f0a063f2b8 /cpp/src | |
parent | fixes (diff) | |
download | ice-e4bb48bcdd8659f7fe0131edf62a05783085997f.tar.bz2 ice-e4bb48bcdd8659f7fe0131edf62a05783085997f.tar.xz ice-e4bb48bcdd8659f7fe0131edf62a05783085997f.zip |
more fixes
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 49 | ||||
-rw-r--r-- | cpp/src/slice2docbook/Gen.cpp | 32 |
2 files changed, 55 insertions, 26 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 1f8742db243..5711b83dc65 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -135,32 +135,13 @@ Slice::Contained::Contained(const ContainerPtr& container, const string& name) : bool Slice::operator<(Contained& l, Contained& r) { - if (l.containedType() != r.containedType()) - { - return static_cast<int>(l.containedType()) < static_cast<int>(r.containedType()); - } - - if(l.scoped() < r.scoped()) - { - return true; - } - else if(l.scoped() != r.scoped()) - { - return false; - } - - return false; + return l.scoped() < r.scoped(); } bool Slice::operator==(Contained& l, Contained& r) { - if(l.scoped() != r.scoped()) - { - return false; - } - - return true; + return l.scoped() == r.scoped(); } // ---------------------------------------------------------------------- @@ -2290,7 +2271,7 @@ Slice::Unit::findContents(const string& scoped) } ClassList -Slice::Unit::findDerived(const ClassDefPtr& cl) +Slice::Unit::findDerivedClasses(const ClassDefPtr& cl) { ClassList derived; for(map<string, ContainedList>::const_iterator p = _contentMap.begin(); p != _contentMap.end(); ++p) @@ -2313,6 +2294,30 @@ Slice::Unit::findDerived(const ClassDefPtr& cl) return derived; } +ExceptionList +Slice::Unit::findDerivedExceptions(const ExceptionPtr& ex) +{ + ExceptionList derived; + for(map<string, ContainedList>::const_iterator p = _contentMap.begin(); p != _contentMap.end(); ++p) + { + for(ContainedList::const_iterator q = p->second.begin(); q != p->second.end(); ++q) + { + ExceptionPtr r = ExceptionPtr::dynamicCast(*q); + if (r) + { + ExceptionPtr base = r->base(); + if (base && base == ex) + { + derived.push_back(r); + } + } + } + } + derived.sort(); + derived.unique(); + return derived; +} + ContainedList Slice::Unit::findUsedBy(const ConstructedPtr& constructed) { diff --git a/cpp/src/slice2docbook/Gen.cpp b/cpp/src/slice2docbook/Gen.cpp index fdada815356..aa6ee2ae241 100644 --- a/cpp/src/slice2docbook/Gen.cpp +++ b/cpp/src/slice2docbook/Gen.cpp @@ -928,19 +928,43 @@ Slice::Gen::printComment(const ContainedPtr& p) end(); } - ClassList derived; + ClassList derivedClasses; ClassDefPtr def = ClassDefPtr::dynamicCast(p); if (def) { - derived = p->unit()->findDerived(def); + derivedClasses = p->unit()->findDerivedClasses(def); } - if (!derived.empty()) + if (!derivedClasses.empty()) { start("section", "Derived Classes and Interfaces"); start("para"); start("simplelist type=\"inline\""); - for (ClassList::const_iterator q = derived.begin(); q != derived.end(); ++q) + for (ClassList::const_iterator q = derivedClasses.begin(); q != derivedClasses.end(); ++q) + { + start("member"); + O << nl << toString(*q, container); + end(); + } + + end(); + end(); + end(); + } + + ExceptionList derivedExceptions; + ExceptionPtr ex = ExceptionPtr::dynamicCast(p); + if (ex) + { + derivedExceptions = p->unit()->findDerivedExceptions(ex); + } + if (!derivedExceptions.empty()) + { + start("section", "Derived Exceptions"); + start("para"); + start("simplelist type=\"inline\""); + + for (ExceptionList::const_iterator q = derivedExceptions.begin(); q != derivedExceptions.end(); ++q) { start("member"); O << nl << toString(*q, container); |