mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Print full container types in record_fields()
This commit is contained in:
parent
b86a8acc2b
commit
26633eb727
3 changed files with 46 additions and 2 deletions
33
src/Type.cc
33
src/Type.cc
|
@ -846,8 +846,37 @@ TableVal* RecordType::GetRecordFieldsVal(const RecordVal* rv) const
|
|||
|
||||
if ( ft->Tag() == TYPE_RECORD )
|
||||
nr->Assign(0, new StringVal("record " + ft->GetName()));
|
||||
else
|
||||
nr->Assign(0, new StringVal(type_name(ft->Tag())));
|
||||
else if ( ft->Tag() == TYPE_VECTOR )
|
||||
{
|
||||
string s = "vector[";
|
||||
s += type_name(ft->YieldType()->Tag());
|
||||
s += "]";
|
||||
nr->Assign(0, new StringVal(s));
|
||||
}
|
||||
else if ( ft->Tag() == TYPE_TABLE )
|
||||
{
|
||||
string s;
|
||||
if ( ft->IsSet() )
|
||||
s = "set[";
|
||||
else
|
||||
s = "table[";
|
||||
const type_list* tl = ((const IndexType*) ft)->IndexTypes();
|
||||
loop_over_list(*tl, i)
|
||||
{
|
||||
if (i > 0)
|
||||
s += ",";
|
||||
s += type_name((*tl)[i]->Tag());
|
||||
}
|
||||
s += "]";
|
||||
if (ft->YieldType())
|
||||
{
|
||||
s += " of ";
|
||||
s += type_name(ft->YieldType()->Tag());
|
||||
}
|
||||
nr->Assign(0, new StringVal(s));
|
||||
}
|
||||
else
|
||||
nr->Assign(0, new StringVal(type_name(ft->Tag())));
|
||||
|
||||
nr->Assign(1, val_mgr->GetBool(logged));
|
||||
nr->Assign(2, fv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue