mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Deprecate RecordVal::Lookup(const char*, bool)
Replace with GetField(const char*) and GetFieldOrDefault(const char*).
This commit is contained in:
parent
2b4d80c849
commit
5bf2ed02d7
14 changed files with 128 additions and 80 deletions
14
src/Val.cc
14
src/Val.cc
|
@ -2781,14 +2781,24 @@ void RecordVal::DoneParsing()
|
|||
parse_time_records.clear();
|
||||
}
|
||||
|
||||
IntrusivePtr<Val> RecordVal::Lookup(const char* field, bool with_default) const
|
||||
const IntrusivePtr<Val>& RecordVal::GetField(const char* field) const
|
||||
{
|
||||
int idx = GetType()->AsRecordType()->FieldOffset(field);
|
||||
|
||||
if ( idx < 0 )
|
||||
reporter->InternalError("missing record field: %s", field);
|
||||
|
||||
return with_default ? GetFieldOrDefault(idx) : GetField(idx);
|
||||
return GetField(idx);
|
||||
}
|
||||
|
||||
IntrusivePtr<Val> RecordVal::GetFieldOrDefault(const char* field) const
|
||||
{
|
||||
int idx = GetType()->AsRecordType()->FieldOffset(field);
|
||||
|
||||
if ( idx < 0 )
|
||||
reporter->InternalError("missing record field: %s", field);
|
||||
|
||||
return GetFieldOrDefault(idx);
|
||||
}
|
||||
|
||||
IntrusivePtr<RecordVal> RecordVal::CoerceTo(IntrusivePtr<RecordType> t,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue