Port remaining file analysis API to use IntrusivePtr

This commit is contained in:
Jon Siwek 2020-05-22 16:32:40 -07:00
parent 57a6069cd1
commit b1042e2824
8 changed files with 117 additions and 75 deletions

View file

@ -44,7 +44,8 @@ function Files::__add_analyzer%(file_id: string, tag: Files::Tag, args: any%): b
using zeek::BifType::Record::Files::AnalyzerArgs;
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
bool result = file_mgr->AddAnalyzer(file_id->CheckString(),
file_mgr->GetComponentTag(tag), rv.get());
file_mgr->GetComponentTag(tag),
std::move(rv));
return val_mgr->Bool(result);
%}
@ -54,7 +55,8 @@ function Files::__remove_analyzer%(file_id: string, tag: Files::Tag, args: any%)
using zeek::BifType::Record::Files::AnalyzerArgs;
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
bool result = file_mgr->RemoveAnalyzer(file_id->CheckString(),
file_mgr->GetComponentTag(tag) , rv.get());
file_mgr->GetComponentTag(tag),
std::move(rv));
return val_mgr->Bool(result);
%}