mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28:20 +00:00
Deprecate RecordVal::LookupWithDefault() replace with GetFieldOrDefault()
(The former was previously changed during this release cycle to return Intrusive pointer, but this just changes it back to return Val* and deprecates it).
This commit is contained in:
parent
f729247778
commit
2b4d80c849
7 changed files with 26 additions and 11 deletions
14
src/Val.h
14
src/Val.h
|
@ -986,7 +986,19 @@ public:
|
|||
IntrusivePtr<T> GetField(int field) const
|
||||
{ return cast_intrusive<T>(GetField(field)); }
|
||||
|
||||
IntrusivePtr<Val> LookupWithDefault(int field) const;
|
||||
/**
|
||||
* Returns the value of a given field index if it's previously been
|
||||
* assigned, * or else returns the value created from evaluating the
|
||||
* record field's &default expression.
|
||||
* @param field The field index to retrieve.
|
||||
* @return The value at the given field index or the default value if
|
||||
* the field hasn't been assigned yet.
|
||||
*/
|
||||
IntrusivePtr<Val> GetFieldOrDefault(int field) const;
|
||||
|
||||
[[deprecated("Remove in v4.1. Use GetFieldOrDefault().")]]
|
||||
Val* LookupWithDefault(int field) const
|
||||
{ return GetFieldOrDefault(field).release(); }
|
||||
|
||||
/**
|
||||
* Looks up the value of a field by field name. If the field doesn't
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue