mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote branch 'origin/topic/jsiwek/doc-framework'
This commit is contained in:
commit
e7bde27f2d
54 changed files with 4006 additions and 62 deletions
20
src/Desc.cc
20
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()
|
||||
|
@ -67,6 +68,12 @@ void ODesc::PopIndent()
|
|||
NL();
|
||||
}
|
||||
|
||||
void ODesc::PopIndentNoNL()
|
||||
{
|
||||
if ( --indent_level < 0 )
|
||||
internal_error("ODesc::PopIndent underflow");
|
||||
}
|
||||
|
||||
void ODesc::Add(const char* s, int do_indent)
|
||||
{
|
||||
unsigned int n = strlen(s);
|
||||
|
@ -179,8 +186,17 @@ 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