mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Deprecate TypeDecl::FindAttr(), replace with GetAttr()
This commit is contained in:
parent
5fc78a548c
commit
e365105872
6 changed files with 26 additions and 23 deletions
|
@ -566,9 +566,13 @@ public:
|
|||
TypeDecl(const TypeDecl& other);
|
||||
~TypeDecl();
|
||||
|
||||
[[deprecated("Remove in v4.1. Use GetAttr().")]]
|
||||
const Attr* FindAttr(attr_tag a) const
|
||||
{ return attrs ? attrs->Find(a).get() : nullptr; }
|
||||
|
||||
const IntrusivePtr<Attr>& GetAttr(attr_tag a) const
|
||||
{ return attrs ? attrs->Find(a) : Attr::nil; }
|
||||
|
||||
void DescribeReST(ODesc* d, bool roles_only = false) const;
|
||||
|
||||
IntrusivePtr<BroType> type;
|
||||
|
@ -664,13 +668,13 @@ public:
|
|||
bool IsFieldDeprecated(int field) const
|
||||
{
|
||||
const TypeDecl* decl = FieldDecl(field);
|
||||
return decl && decl->FindAttr(ATTR_DEPRECATED) != nullptr;
|
||||
return decl && decl->GetAttr(ATTR_DEPRECATED) != nullptr;
|
||||
}
|
||||
|
||||
bool FieldHasAttr(int field, attr_tag at) const
|
||||
{
|
||||
const TypeDecl* decl = FieldDecl(field);
|
||||
return decl && decl->FindAttr(at) != nullptr;
|
||||
return decl && decl->GetAttr(at) != nullptr;
|
||||
}
|
||||
|
||||
std::string GetFieldDeprecationWarning(int field, bool has_check) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue