mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
low-level addition of enum values
This commit is contained in:
parent
d53d2ac755
commit
b242430bd1
2 changed files with 10 additions and 0 deletions
|
@ -1367,6 +1367,14 @@ void EnumType::AddNameInternal(const string& module_name, const char* name,
|
||||||
names[fullname] = val;
|
names[fullname] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EnumType::AddNameInternal(const string& full_name, bro_int_t val)
|
||||||
|
{
|
||||||
|
names[full_name] = val;
|
||||||
|
|
||||||
|
if ( vals.find(val) == vals.end() )
|
||||||
|
vals[val] = make_intrusive<EnumVal>(IntrusivePtr{NewRef{}, this}, val);
|
||||||
|
}
|
||||||
|
|
||||||
bro_int_t EnumType::Lookup(const string& module_name, const char* name) const
|
bro_int_t EnumType::Lookup(const string& module_name, const char* name) const
|
||||||
{
|
{
|
||||||
NameMap::const_iterator pos =
|
NameMap::const_iterator pos =
|
||||||
|
|
|
@ -716,6 +716,8 @@ protected:
|
||||||
void AddNameInternal(const std::string& module_name,
|
void AddNameInternal(const std::string& module_name,
|
||||||
const char* name, bro_int_t val, bool is_export);
|
const char* name, bro_int_t val, bool is_export);
|
||||||
|
|
||||||
|
void AddNameInternal(const std::string& full_name, bro_int_t val);
|
||||||
|
|
||||||
void CheckAndAddName(const std::string& module_name,
|
void CheckAndAddName(const std::string& module_name,
|
||||||
const char* name, bro_int_t val, bool is_export,
|
const char* name, bro_int_t val, bool is_export,
|
||||||
detail::Expr* deprecation = nullptr,
|
detail::Expr* deprecation = nullptr,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue