summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2003-06-13 00:47:51 +0000
committerMichi Henning <michi@zeroc.com>2003-06-13 00:47:51 +0000
commit36c6eaaa326256475be7808c54a360aa54039adf (patch)
tree3b8fc5324c9e7e8ba7a13b27872874700d4c99fc /cpp
parentFixed VC6 build failure (diff)
downloadice-36c6eaaa326256475be7808c54a360aa54039adf.tar.bz2
ice-36c6eaaa326256475be7808c54a360aa54039adf.tar.xz
ice-36c6eaaa326256475be7808c54a360aa54039adf.zip
Added --noindex option to slice2docbook to suppress generation of index
pages in the generated sgml documentation.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/CHANGES3
-rw-r--r--cpp/doc/Makefile2
-rw-r--r--cpp/src/slice2docbook/Gen.cpp33
-rw-r--r--cpp/src/slice2docbook/Gen.h3
-rw-r--r--cpp/src/slice2docbook/Main.cpp13
5 files changed, 35 insertions, 19 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES
index a28129ed888..7dc3319b03e 100644
--- a/cpp/CHANGES
+++ b/cpp/CHANGES
@@ -1,6 +1,9 @@
Changes since version 1.1.0
---------------------------
+- Added --noindex option to slice2docbook to suppress generation of index
+ pages for pdf version of documentation.
+
- Changed the behavior of Freeze::Map::insert to match the insert behavior
on associative containers in the C++ standard: if the element is already
there, it is not updated.
diff --git a/cpp/doc/Makefile b/cpp/doc/Makefile
index c1b122a39ca..a6f8dab58c9 100644
--- a/cpp/doc/Makefile
+++ b/cpp/doc/Makefile
@@ -52,7 +52,7 @@ clean::
SliceDoc.sgml: $(SLICEFILES) $(SLICE2DOCBOOK)
rm -f $@
- $(SLICE2DOCBOOK) --ice -I$(top_srcdir)/slice $@ $(SLICEFILES)
+ $(SLICE2DOCBOOK) --noindex --ice -I$(top_srcdir)/slice $@ $(SLICEFILES)
clean::
rm -f SliceDoc.sgml
diff --git a/cpp/src/slice2docbook/Gen.cpp b/cpp/src/slice2docbook/Gen.cpp
index 6e3b6a45f16..01645da2ea1 100644
--- a/cpp/src/slice2docbook/Gen.cpp
+++ b/cpp/src/slice2docbook/Gen.cpp
@@ -19,9 +19,10 @@ using namespace std;
using namespace Slice;
using namespace IceUtil;
-Slice::Gen::Gen(const string& name, const string& file, bool standAlone, bool noGlobals, bool chapter) :
+Slice::Gen::Gen(const string& name, const string& file, bool standAlone, bool noGlobals, bool chapter, bool noIndex) :
_standAlone(standAlone),
- _noGlobals(noGlobals)
+ _noGlobals(noGlobals),
+ _noIndex(noIndex)
{
if(chapter)
{
@@ -79,7 +80,7 @@ Slice::Gen::visitUnitStart(const UnitPtr& p)
printHeader();
}
- if(!_noGlobals)
+ if(!_noGlobals && !_noIndex)
{
start(_chapter, "Global Module", false);
// start("section", "Overview", false);
@@ -124,7 +125,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p)
modules.erase(remove_if(modules.begin(), modules.end(), ::IceUtil::constMemFun(&Contained::includeLevel)),
modules.end());
- if(!modules.empty())
+ if(!modules.empty() && !_noIndex)
{
start("section", "Module Index", false);
start("variablelist");
@@ -154,7 +155,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p)
remove_copy_if(classesAndInterfaces.begin(), classesAndInterfaces.end(), back_inserter(interfaces),
not1(::IceUtil::constMemFun(&ClassDef::isInterface)));
- if(!classes.empty())
+ if(!classes.empty() && !_noIndex)
{
start("section", "Class Index", false);
start("variablelist");
@@ -173,7 +174,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p)
end();
}
- if(!interfaces.empty())
+ if(!interfaces.empty() && !_noIndex)
{
start("section", "Interface Index", false);
start("variablelist");
@@ -196,7 +197,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p)
exceptions.erase(remove_if(exceptions.begin(), exceptions.end(), ::IceUtil::constMemFun(&Contained::includeLevel)),
exceptions.end());
- if(!exceptions.empty())
+ if(!exceptions.empty() && !_noIndex)
{
start("section", "Exception Index", false);
start("variablelist");
@@ -219,7 +220,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p)
structs.erase(remove_if(structs.begin(), structs.end(), ::IceUtil::constMemFun(&Contained::includeLevel)),
structs.end());
- if(!structs.empty())
+ if(!structs.empty() && !_noIndex)
{
start("section", "Struct Index", false);
start("variablelist");
@@ -242,7 +243,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p)
sequences.erase(remove_if(sequences.begin(), sequences.end(), ::IceUtil::constMemFun(&Contained::includeLevel)),
sequences.end());
- if(!sequences.empty())
+ if(!sequences.empty() && !_noIndex)
{
start("section", "Sequence Index", false);
start("variablelist");
@@ -266,7 +267,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p)
::IceUtil::constMemFun(&Contained::includeLevel)),
dictionaries.end());
- if(!dictionaries.empty())
+ if(!dictionaries.empty() && !_noIndex)
{
start("section", "Dictionary Index", false);
start("variablelist");
@@ -289,7 +290,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p)
enums.erase(remove_if(enums.begin(), enums.end(), ::IceUtil::constMemFun(&Contained::includeLevel)),
enums.end());
- if(!enums.empty())
+ if(!enums.empty() && !_noIndex)
{
start("section", "Enum Index", false);
start("variablelist");
@@ -414,7 +415,7 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p)
printComment(p);
OperationList operations = p->operations();
- if(!operations.empty())
+ if(!operations.empty() && !_noIndex)
{
start("section", "Operation Index", false);
start("variablelist");
@@ -434,7 +435,7 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p)
}
DataMemberList dataMembers = p->dataMembers();
- if(!dataMembers.empty())
+ if(!dataMembers.empty() && !_noIndex)
{
start("section", "Data Member Index", false);
start("variablelist");
@@ -559,7 +560,7 @@ Slice::Gen::visitExceptionStart(const ExceptionPtr& p)
printComment(p);
DataMemberList dataMembers = p->dataMembers();
- if(!dataMembers.empty())
+ if(!dataMembers.empty() && !_noIndex)
{
start("section", "Data Member Index", false);
start("variablelist");
@@ -620,7 +621,7 @@ Slice::Gen::visitStructStart(const StructPtr& p)
printComment(p);
DataMemberList dataMembers = p->dataMembers();
- if(!dataMembers.empty())
+ if(!dataMembers.empty() && !_noIndex)
{
start("section", "Data Member Index", false);
start("variablelist");
@@ -680,7 +681,7 @@ Slice::Gen::visitEnum(const EnumPtr& p)
printComment(p);
EnumeratorList enumerators = p->getEnumerators();
- if(!enumerators.empty())
+ if(!enumerators.empty() && !_noIndex)
{
start("section", "Enumerator Index", false);
start("variablelist");
diff --git a/cpp/src/slice2docbook/Gen.h b/cpp/src/slice2docbook/Gen.h
index 019f2eb3e5a..ae68c9fb495 100644
--- a/cpp/src/slice2docbook/Gen.h
+++ b/cpp/src/slice2docbook/Gen.h
@@ -26,7 +26,7 @@ class Gen : public ::IceUtil::noncopyable, public ParserVisitor
{
public:
- Gen(const std::string&, const std::string&, bool, bool, bool);
+ Gen(const std::string&, const std::string&, bool, bool, bool, bool);
virtual ~Gen();
bool operator!() const; // Returns true if there was a constructor error
@@ -65,6 +65,7 @@ private:
bool _standAlone;
bool _noGlobals;
std::string _chapter;
+ bool _noIndex;
};
}
diff --git a/cpp/src/slice2docbook/Main.cpp b/cpp/src/slice2docbook/Main.cpp
index d94c31b40a0..f04f01acedf 100644
--- a/cpp/src/slice2docbook/Main.cpp
+++ b/cpp/src/slice2docbook/Main.cpp
@@ -35,6 +35,7 @@ usage(const char* n)
"--no-globals Don't document the global module.\n"
"--chapter Use \"chapter\" instead of \"section\" as\n"
" top-level element.\n"
+ "--noindex Suppress generation of index pages.\n"
"-d, --debug Print debug messages.\n"
"--ice Permit `Ice' prefix (for building Ice source code only)\n"
;
@@ -51,6 +52,7 @@ main(int argc, char* argv[])
bool standAlone = false;
bool noGlobals = false;
bool chapter = false;
+ bool noIndex = false;
int idx = 1;
while(idx < argc)
@@ -104,6 +106,15 @@ main(int argc, char* argv[])
}
--argc;
}
+ else if(strcmp(argv[idx], "--noindex") == 0)
+ {
+ noIndex = true;
+ for(int i = idx ; i + 1 < argc ; ++i)
+ {
+ argv[i] = argv[i + 1];
+ }
+ --argc;
+ }
else if(strcmp(argv[idx], "-h") == 0 || strcmp(argv[idx], "--help") == 0)
{
usage(argv[0]);
@@ -207,7 +218,7 @@ main(int argc, char* argv[])
if(status == EXIT_SUCCESS)
{
- Gen gen(argv[0], docbook, standAlone, noGlobals, chapter);
+ Gen gen(argv[0], docbook, standAlone, noGlobals, chapter, noIndex);
if(!gen)
{
p->destroy();