mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
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:
parent
e491caeeb7
commit
5fbcde7344
5 changed files with 19 additions and 7 deletions
10
src/Desc.cc
10
src/Desc.cc
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue