From 4af75dd83279303101a04c4332b9bb0ffc48ab30 Mon Sep 17 00:00:00 2001 From: Michi Henning Date: Thu, 20 Dec 2007 13:10:13 +1000 Subject: Bug 2477. --- cpp/src/slice2html/Gen.cpp | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'cpp/src/slice2html/Gen.cpp') 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) -- cgit v1.2.3 From 4285cce5116a52af08f0d883d65440d08ecee1eb Mon Sep 17 00:00:00 2001 From: Michi Henning Date: Thu, 20 Dec 2007 13:20:29 +1000 Subject: Fix to changes for bug 2477. --- cpp/src/slice2html/Gen.cpp | 18 ++++++++++-------- slice/Ice/Identity.ice | 7 ------- 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'cpp/src/slice2html/Gen.cpp') diff --git a/cpp/src/slice2html/Gen.cpp b/cpp/src/slice2html/Gen.cpp index 8a946ca2dfc..649e46a0ef4 100644 --- a/cpp/src/slice2html/Gen.cpp +++ b/cpp/src/slice2html/Gen.cpp @@ -2106,15 +2106,15 @@ Slice::ModuleGenerator::visitContainer(const ContainerPtr& p) assert(_out.currIndent() == indent); - EnumList enums = p->enums(); + ConstList consts = p->consts(); - if(!enums.empty()) + if(!consts.empty()) { start("h2"); - _out << "Enumeration Index"; + _out << "Constant Index"; end(); start("dl"); - for(EnumList::const_iterator q = enums.begin(); q != enums.end(); ++q) + for(ConstList::const_iterator q = consts.begin(); q != consts.end(); ++q) { start("dt", "Symbol"); _out << toString(*q, p, false, true); @@ -2127,15 +2127,17 @@ Slice::ModuleGenerator::visitContainer(const ContainerPtr& p) end(); } - ConstList consts = p->consts(); + assert(_out.currIndent() == indent); - if(!consts.empty()) + EnumList enums = p->enums(); + + if(!enums.empty()) { start("h2"); - _out << "Constant Index"; + _out << "Enumeration Index"; end(); start("dl"); - for(ConstList::const_iterator q = consts.begin(); q != consts.end(); ++q) + for(EnumList::const_iterator q = enums.begin(); q != enums.end(); ++q) { start("dt", "Symbol"); _out << toString(*q, p, false, true); diff --git a/slice/Ice/Identity.ice b/slice/Ice/Identity.ice index c5d47f085e8..3f5062e1919 100644 --- a/slice/Ice/Identity.ice +++ b/slice/Ice/Identity.ice @@ -13,13 +13,6 @@ module Ice { -/** - * A constant. - * - * More blah about the constant... - **/ - const int i = 000; - /** * * The identity of an Ice object. An empty [name] denotes a null -- cgit v1.2.3