diff options
author | Michi Henning <michi@zeroc.com> | 2007-12-20 13:10:13 +1000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2007-12-20 13:10:13 +1000 |
commit | 4af75dd83279303101a04c4332b9bb0ffc48ab30 (patch) | |
tree | e4dc480b5c12d037c42a45a0cf50a5337dc168c2 /cpp/src/slice2html/Gen.cpp | |
parent | Bug 2619 -- Removed VbUtil.cpp. (diff) | |
download | ice-4af75dd83279303101a04c4332b9bb0ffc48ab30.tar.bz2 ice-4af75dd83279303101a04c4332b9bb0ffc48ab30.tar.xz ice-4af75dd83279303101a04c4332b9bb0ffc48ab30.zip |
Bug 2477.
Diffstat (limited to 'cpp/src/slice2html/Gen.cpp')
-rw-r--r-- | cpp/src/slice2html/Gen.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/cpp/src/slice2html/Gen.cpp b/cpp/src/slice2html/Gen.cpp index e88d3d7e2ea..8a946ca2dfc 100644 --- a/cpp/src/slice2html/Gen.cpp +++ b/cpp/src/slice2html/Gen.cpp @@ -2127,6 +2127,27 @@ Slice::ModuleGenerator::visitContainer(const ContainerPtr& p) end(); } + ConstList consts = p->consts(); + + if(!consts.empty()) + { + start("h2"); + _out << "Constant Index"; + end(); + start("dl"); + for(ConstList::const_iterator q = consts.begin(); q != consts.end(); ++q) + { + start("dt", "Symbol"); + _out << toString(*q, p, false, true); + end(); + start("dd"); + string metadata; + printSummary(*q, p, (*q)->findMetaData("deprecate", metadata)); + end(); + } + end(); + } + assert(_out.currIndent() == indent); if(!sequences.empty()) @@ -2204,6 +2225,46 @@ Slice::ModuleGenerator::visitContainer(const ContainerPtr& p) end(); } } + + if(!consts.empty()) + { + start("h2"); + _out << "Constants"; + end(); + for(ConstList::const_iterator q = consts.begin(); q != consts.end(); ++q) + { + start("dl"); + start("dt"); + start("span", "Synopsis"); + _out << "const " << toString((*q)->type(), p, false, true) << " " << toString(*q, p) << " = "; + if(EnumPtr::dynamicCast((*q)->type())) + { + _out << toString((*q)->value(), p, false, true); + } + else + { + _out << (*q)->literal(); + } + _out << ";"; + end(); + end(); + + start("dd"); + string metadata, deprecateReason; + if((*q)->findMetaData("deprecate", metadata)) + { + deprecateReason = "This type is deprecated."; + if(metadata.find("deprecate:") == 0 && metadata.size() > 10) + { + deprecateReason = metadata.substr(10); + } + } + + printComment(*q, p, deprecateReason, true); + end(); + end(); + } + } } Slice::ExceptionGenerator::ExceptionGenerator(XMLOutput& o, const Files& files) |