mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
convenience function for accessing object descriptions
This commit is contained in:
parent
c30f787949
commit
63502e655f
2 changed files with 20 additions and 0 deletions
13
src/Desc.cc
13
src/Desc.cc
|
@ -427,4 +427,17 @@ bool ODesc::FindType(const Type* type)
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
std::string obj_desc(const Obj* o)
|
||||
{
|
||||
static ODesc d;
|
||||
|
||||
d.Clear();
|
||||
o->Describe(&d);
|
||||
d.SP();
|
||||
o->GetLocationInfo()->Describe(&d);
|
||||
|
||||
return std::string(d.Description());
|
||||
}
|
||||
|
||||
} // namespace zeek
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue