convenience function for accessing object descriptions

This commit is contained in:
Vern Paxson 2021-01-10 13:22:23 -08:00
parent c30f787949
commit 63502e655f
2 changed files with 20 additions and 0 deletions

View file

@ -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