From 3ad5f0559d3849482a9f94082c07eaa2ddb4d1aa Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Fri, 8 Apr 2011 10:16:44 -0500 Subject: [PATCH] Remove empty private interface sections from generated script docs. --- src/BroDoc.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/BroDoc.cc b/src/BroDoc.cc index 226e3e80a6..ea5277bea3 100644 --- a/src/BroDoc.cc +++ b/src/BroDoc.cc @@ -127,7 +127,18 @@ void BroDoc::WriteDocFile() const WriteBroDocObjList(notices, "Notices", '~'); WriteInterface("Public Interface", '-', '~', true, false); - WriteInterface("Private Interface", '-', '~', false, false); + + BroDocObjList::const_iterator it; + bool hasPrivateIdentifiers = false; + for ( it = all.begin(); it != all.end(); ++it ) + if ( ! IsPublicAPI(*it) ) + { + hasPrivateIdentifiers = true; + break; + } + + if ( hasPrivateIdentifiers ) + WriteInterface("Private Interface", '-', '~', false, false); if ( ! port_analysis.empty() ) { @@ -220,7 +231,7 @@ void BroDoc::WriteBroDocObjList(const BroDocObjList& l, { if ( l.empty() ) return; - std::list::const_iterator it; + BroDocObjList::const_iterator it; bool (*f_ptr)(const BroDocObj* o) = 0; if ( wantPublic )