mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Val: eliminate the "BroString.h" include
This commit is contained in:
parent
728184ea93
commit
e98cf0a4a0
21 changed files with 48 additions and 6 deletions
21
src/Val.cc
21
src/Val.cc
|
@ -14,6 +14,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "Attr.h"
|
||||
#include "BroString.h"
|
||||
#include "CompHash.h"
|
||||
#include "Dict.h"
|
||||
#include "Net.h"
|
||||
|
@ -998,6 +999,26 @@ StringVal::StringVal(const string& s) : Val(TYPE_STRING)
|
|||
val.string_val = new BroString(reinterpret_cast<const u_char*>(s.data()), s.length(), 1);
|
||||
}
|
||||
|
||||
Val* StringVal::SizeVal() const
|
||||
{
|
||||
return val_mgr->GetCount(val.string_val->Len());
|
||||
}
|
||||
|
||||
int StringVal::Len()
|
||||
{
|
||||
return AsString()->Len();
|
||||
}
|
||||
|
||||
const u_char* StringVal::Bytes()
|
||||
{
|
||||
return AsString()->Bytes();
|
||||
}
|
||||
|
||||
const char* StringVal::CheckString()
|
||||
{
|
||||
return AsString()->CheckString();
|
||||
}
|
||||
|
||||
string StringVal::ToStdString() const
|
||||
{
|
||||
auto* bs = AsString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue