diff --git a/src/Tag.cc b/src/Tag.cc index 8f177a4b75..fc9036150f 100644 --- a/src/Tag.cc +++ b/src/Tag.cc @@ -3,6 +3,8 @@ #include "Tag.h" #include "Val.h" +namespace zeek { + Tag::Tag(const zeek::EnumTypePtr& etype, type_t arg_type, subtype_t arg_subtype) { assert(arg_type > 0); @@ -92,3 +94,5 @@ std::string Tag::AsString() const { return fmt("%" PRIu32 "/%" PRIu32, type, subtype); } + +} // namespace zeek diff --git a/src/Tag.h b/src/Tag.h index bccc85a6cd..52030f7d10 100644 --- a/src/Tag.h +++ b/src/Tag.h @@ -14,9 +14,9 @@ ZEEK_FORWARD_DECLARE_NAMESPACED(EnumVal, zeek); ZEEK_FORWARD_DECLARE_NAMESPACED(EnumType, zeek); namespace zeek { + using EnumTypePtr = zeek::IntrusivePtr; using EnumValPtr = zeek::IntrusivePtr; -} /** * Class to identify an analyzer type. @@ -157,3 +157,7 @@ private: subtype_t subtype; // Subtype. mutable zeek::EnumValPtr val; // Script-layer value. }; + +} // namespace zeek + +using Tag [[deprecated("Remove in v4.1. Use zeek::Tag instead")]] = zeek::Tag; diff --git a/src/analyzer/Tag.cc b/src/analyzer/Tag.cc index 5af0adfaf7..98740a2a78 100644 --- a/src/analyzer/Tag.cc +++ b/src/analyzer/Tag.cc @@ -6,19 +6,19 @@ const analyzer::Tag analyzer::Tag::Error; analyzer::Tag::Tag(type_t type, subtype_t subtype) - : ::Tag(analyzer_mgr->GetTagType(), type, subtype) + : zeek::Tag(analyzer_mgr->GetTagType(), type, subtype) { } analyzer::Tag& analyzer::Tag::operator=(const analyzer::Tag& other) { - ::Tag::operator=(other); + zeek::Tag::operator=(other); return *this; } const zeek::EnumValPtr& analyzer::Tag::AsVal() const { - return ::Tag::AsVal(analyzer_mgr->GetTagType()); + return zeek::Tag::AsVal(analyzer_mgr->GetTagType()); } zeek::EnumVal* analyzer::Tag::AsEnumVal() const @@ -27,9 +27,9 @@ zeek::EnumVal* analyzer::Tag::AsEnumVal() const } analyzer::Tag::Tag(zeek::EnumValPtr val) - : ::Tag(std::move(val)) + : zeek::Tag(std::move(val)) { } analyzer::Tag::Tag(zeek::EnumVal* val) - : ::Tag({zeek::NewRef{}, val}) + : zeek::Tag({zeek::NewRef{}, val}) { } diff --git a/src/analyzer/Tag.h b/src/analyzer/Tag.h index ce968f1a06..2d7e2f45dd 100644 --- a/src/analyzer/Tag.h +++ b/src/analyzer/Tag.h @@ -31,18 +31,18 @@ class Component; * * The script-layer analogue is Analyzer::Tag. */ -class Tag : public ::Tag { +class Tag : public zeek::Tag { public: /* * Copy constructor. */ - Tag(const Tag& other) : ::Tag(other) {} + Tag(const Tag& other) : zeek::Tag(other) {} /** * Default constructor. This initializes the tag with an error value * that will make \c operator \c bool return false. */ - Tag() : ::Tag() {} + Tag() : zeek::Tag() {} /** * Destructor. @@ -65,7 +65,7 @@ public: */ bool operator==(const Tag& other) const { - return ::Tag::operator==(other); + return zeek::Tag::operator==(other); } /** @@ -73,7 +73,7 @@ public: */ bool operator!=(const Tag& other) const { - return ::Tag::operator!=(other); + return zeek::Tag::operator!=(other); } /** @@ -81,7 +81,7 @@ public: */ bool operator<(const Tag& other) const { - return ::Tag::operator<(other); + return zeek::Tag::operator<(other); } /** diff --git a/src/file_analysis/Tag.cc b/src/file_analysis/Tag.cc index 712f90dd59..30a8728f1a 100644 --- a/src/file_analysis/Tag.cc +++ b/src/file_analysis/Tag.cc @@ -14,13 +14,13 @@ file_analysis::Tag::Tag(type_t type, subtype_t subtype) file_analysis::Tag& file_analysis::Tag::operator=(const file_analysis::Tag& other) { - ::Tag::operator=(other); + zeek::Tag::operator=(other); return *this; } const zeek::EnumValPtr& file_analysis::Tag::AsVal() const { - return ::Tag::AsVal(file_mgr->GetTagType()); + return zeek::Tag::AsVal(file_mgr->GetTagType()); } zeek::EnumVal* file_analysis::Tag::AsEnumVal() const @@ -29,9 +29,9 @@ zeek::EnumVal* file_analysis::Tag::AsEnumVal() const } file_analysis::Tag::Tag(zeek::EnumValPtr val) - : ::Tag(std::move(val)) + : zeek::Tag(std::move(val)) { } file_analysis::Tag::Tag(zeek::EnumVal* val) - : ::Tag({zeek::NewRef{}, val}) + : zeek::Tag({zeek::NewRef{}, val}) { } diff --git a/src/file_analysis/Tag.h b/src/file_analysis/Tag.h index 1aa758b6ff..ad4fcf2960 100644 --- a/src/file_analysis/Tag.h +++ b/src/file_analysis/Tag.h @@ -29,18 +29,18 @@ class Component; * * The script-layer analogue is Files::Tag. */ -class Tag : public ::Tag { +class Tag : public zeek::Tag { public: /* * Copy constructor. */ - Tag(const Tag& other) : ::Tag(other) {} + Tag(const Tag& other) : zeek::Tag(other) {} /** * Default constructor. This initializes the tag with an error value * that will make \c operator \c bool return false. */ - Tag() : ::Tag() {} + Tag() : zeek::Tag() {} /** * Destructor. @@ -63,7 +63,7 @@ public: */ bool operator==(const Tag& other) const { - return ::Tag::operator==(other); + return zeek::Tag::operator==(other); } /** @@ -71,7 +71,7 @@ public: */ bool operator!=(const Tag& other) const { - return ::Tag::operator!=(other); + return zeek::Tag::operator!=(other); } /** @@ -79,7 +79,7 @@ public: */ bool operator<(const Tag& other) const { - return ::Tag::operator<(other); + return zeek::Tag::operator<(other); } /** diff --git a/src/input/Tag.cc b/src/input/Tag.cc index 86c481d843..28c68f1938 100644 --- a/src/input/Tag.cc +++ b/src/input/Tag.cc @@ -6,19 +6,19 @@ const input::Tag input::Tag::Error; input::Tag::Tag(type_t type, subtype_t subtype) - : ::Tag(input_mgr->GetTagType(), type, subtype) + : zeek::Tag(input_mgr->GetTagType(), type, subtype) { } input::Tag& input::Tag::operator=(const input::Tag& other) { - ::Tag::operator=(other); + zeek::Tag::operator=(other); return *this; } const zeek::EnumValPtr& input::Tag::AsVal() const { - return ::Tag::AsVal(input_mgr->GetTagType()); + return zeek::Tag::AsVal(input_mgr->GetTagType()); } zeek::EnumVal* input::Tag::AsEnumVal() const @@ -27,9 +27,9 @@ zeek::EnumVal* input::Tag::AsEnumVal() const } input::Tag::Tag(zeek::EnumValPtr val) - : ::Tag(std::move(val)) + : zeek::Tag(std::move(val)) { } input::Tag::Tag(zeek::EnumVal* val) - : ::Tag({zeek::NewRef{}, val}) + : zeek::Tag({zeek::NewRef{}, val}) { } diff --git a/src/input/Tag.h b/src/input/Tag.h index 534314fbc0..0b98977e77 100644 --- a/src/input/Tag.h +++ b/src/input/Tag.h @@ -30,18 +30,18 @@ class Component; * * The script-layer analogue is Input::Reader. */ -class Tag : public ::Tag { +class Tag : public zeek::Tag { public: /* * Copy constructor. */ - Tag(const Tag& other) : ::Tag(other) {} + Tag(const Tag& other) : zeek::Tag(other) {} /** * Default constructor. This initializes the tag with an error value * that will make \c operator \c bool return false. */ - Tag() : ::Tag() {} + Tag() : zeek::Tag() {} /** * Destructor. @@ -64,7 +64,7 @@ public: */ bool operator==(const Tag& other) const { - return ::Tag::operator==(other); + return zeek::Tag::operator==(other); } /** @@ -72,7 +72,7 @@ public: */ bool operator!=(const Tag& other) const { - return ::Tag::operator!=(other); + return zeek::Tag::operator!=(other); } /** @@ -80,7 +80,7 @@ public: */ bool operator<(const Tag& other) const { - return ::Tag::operator<(other); + return zeek::Tag::operator<(other); } /** diff --git a/src/logging/Tag.cc b/src/logging/Tag.cc index 03b7131bf7..ffe366f48d 100644 --- a/src/logging/Tag.cc +++ b/src/logging/Tag.cc @@ -6,25 +6,25 @@ const logging::Tag logging::Tag::Error; logging::Tag::Tag(type_t type, subtype_t subtype) - : ::Tag(log_mgr->GetTagType(), type, subtype) + : zeek::Tag(log_mgr->GetTagType(), type, subtype) { } logging::Tag& logging::Tag::operator=(const logging::Tag& other) { - ::Tag::operator=(other); + zeek::Tag::operator=(other); return *this; } logging::Tag& logging::Tag::operator=(const logging::Tag&& other) noexcept { - ::Tag::operator=(other); + zeek::Tag::operator=(other); return *this; } const zeek::EnumValPtr& logging::Tag::AsVal() const { - return ::Tag::AsVal(log_mgr->GetTagType()); + return zeek::Tag::AsVal(log_mgr->GetTagType()); } zeek::EnumVal* logging::Tag::AsEnumVal() const @@ -33,9 +33,9 @@ zeek::EnumVal* logging::Tag::AsEnumVal() const } logging::Tag::Tag(zeek::EnumValPtr val) - : ::Tag(std::move(val)) + : zeek::Tag(std::move(val)) { } logging::Tag::Tag(zeek::EnumVal* val) - : ::Tag({zeek::NewRef{}, val}) + : zeek::Tag({zeek::NewRef{}, val}) { } diff --git a/src/logging/Tag.h b/src/logging/Tag.h index 144789c5ef..b3a05920e9 100644 --- a/src/logging/Tag.h +++ b/src/logging/Tag.h @@ -30,18 +30,18 @@ class Component; * * The script-layer analogue is Log::Writer. */ -class Tag : public ::Tag { +class Tag : public zeek::Tag { public: /* * Copy constructor. */ - Tag(const Tag& other) : ::Tag(other) {} + Tag(const Tag& other) : zeek::Tag(other) {} /** * Default constructor. This initializes the tag with an error value * that will make \c operator \c bool return false. */ - Tag() : ::Tag() {} + Tag() : zeek::Tag() {} /** * Destructor. @@ -69,7 +69,7 @@ public: */ bool operator==(const Tag& other) const { - return ::Tag::operator==(other); + return zeek::Tag::operator==(other); } /** @@ -77,7 +77,7 @@ public: */ bool operator!=(const Tag& other) const { - return ::Tag::operator!=(other); + return zeek::Tag::operator!=(other); } /** @@ -85,7 +85,7 @@ public: */ bool operator<(const Tag& other) const { - return ::Tag::operator<(other); + return zeek::Tag::operator<(other); } /**