Teach Desc class how to (optionally) use spaces for indentation.

And (to be consistent with current conventions for reST documentation)
update places in the auto-documentation-generation framework
where tabs were used in the generated reST.
This commit is contained in:
Jon Siwek 2011-03-21 13:49:53 -05:00
parent e491caeeb7
commit 5fbcde7344
5 changed files with 19 additions and 7 deletions

View file

@ -41,6 +41,7 @@ ODesc::ODesc(desc_type t, BroFile* arg_f)
want_quotes = 0;
do_flush = 1;
include_stats = 0;
indent_with_spaces = 0;
}
ODesc::~ODesc()
@ -179,8 +180,13 @@ void ODesc::AddBytes(const BroString* s)
void ODesc::Indent()
{
for ( int i = 0; i < indent_level; ++i )
Add("\t", 0);
if ( indent_with_spaces > 0 )
for ( int i = 0; i < indent_level; ++i )
for ( int j = 0; j < indent_with_spaces; ++j )
Add(" ", 0);
else
for ( int i = 0; i < indent_level; ++i )
Add("\t", 0);
}