Fix generated script docs displaying functions twice.

A function prototype can be declared separately from where it's defined;
the doc framework should now recognize them as the same and combine
reST documentation associated with either case if both are present.
This commit is contained in:
Jon Siwek 2011-03-29 16:54:16 -05:00
parent 94ac3f3c23
commit 090ce2d03c
4 changed files with 104 additions and 19 deletions

View file

@ -16,7 +16,7 @@ BroDocObj::BroDocObj(const ID* id, std::list<std::string>*& reST,
BroDocObj::~BroDocObj()
{
delete reST_doc_strings;
if ( reST_doc_strings ) delete reST_doc_strings;
if ( is_fake_id ) delete broID;
}
@ -50,3 +50,17 @@ bool BroDocObj::IsPublicAPI() const
return (broID->Scope() == SCOPE_GLOBAL) ||
(broID->Scope() == SCOPE_MODULE && broID->IsExport());
}
void BroDocObj::Combine(const BroDocObj* o)
{
if ( o->reST_doc_strings )
{
if ( ! reST_doc_strings )
reST_doc_strings = new std::list<std::string>();
reST_doc_strings->splice(reST_doc_strings->end(),
*(o->reST_doc_strings));
}
delete o;
}