mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
Debugging output from doc-framework now only in debug mode.
Also a minor format fix for documenting empty string lists.
This commit is contained in:
parent
27996cf9e0
commit
0d7ffe998f
2 changed files with 10 additions and 2 deletions
|
@ -8,8 +8,9 @@
|
|||
|
||||
BroDoc::BroDoc(const std::string& sourcename)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
fprintf(stdout, "Documenting source: %s\n", sourcename.c_str());
|
||||
|
||||
#endif
|
||||
source_filename = sourcename.substr(sourcename.find_last_of('/') + 1);
|
||||
|
||||
size_t ext_pos = source_filename.find_last_of('.');
|
||||
|
@ -35,8 +36,10 @@ BroDoc::BroDoc(const std::string& sourcename)
|
|||
|
||||
if ( ! reST_file )
|
||||
fprintf(stderr, "Failed to open %s", reST_filename.c_str());
|
||||
#ifdef DEBUG
|
||||
else
|
||||
fprintf(stdout, "Created reST document: %s\n", reST_filename.c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
BroDoc::~BroDoc()
|
||||
|
@ -104,7 +107,11 @@ void BroDoc::WriteStringList(const char* format,
|
|||
const char* last_format,
|
||||
const std::list<std::string>& l) const
|
||||
{
|
||||
if ( l.empty() ) return;
|
||||
if ( l.empty() )
|
||||
{
|
||||
WriteToDoc("\n");
|
||||
return;
|
||||
}
|
||||
std::list<std::string>::const_iterator it;
|
||||
std::list<std::string>::const_iterator last = l.end();
|
||||
last--;
|
||||
|
|
|
@ -124,6 +124,7 @@ protected:
|
|||
|
||||
/**
|
||||
* Writes out a list of strings to the reST document.
|
||||
* If the list is empty, prints a newline character.
|
||||
* @param format A printf style format string for elements of the list
|
||||
* except for the last one in the list
|
||||
* @param last_format A printf style format string to use for the last
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue