From 6a7abd00379b4f37b468bc2d0e717d4ba293efe1 Mon Sep 17 00:00:00 2001 From: Lichie <90825386+lichie567@users.noreply.github.com> Date: Sun, 3 May 2026 10:55:47 -0700 Subject: config/lua: add clear tag api (#14273) --- src/helpers/TagKeeper.cpp | 9 +++++++++ src/helpers/TagKeeper.hpp | 1 + 2 files changed, 10 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/TagKeeper.cpp b/src/helpers/TagKeeper.cpp index 7f377657..80bf3957 100644 --- a/src/helpers/TagKeeper.cpp +++ b/src/helpers/TagKeeper.cpp @@ -38,6 +38,15 @@ bool CTagKeeper::applyTag(const std::string& tag, bool dynamic) { return true; } +bool CTagKeeper::clearTags() { + if (!m_tags.empty()) { + m_tags.clear(); + return true; + } + + return false; +} + bool CTagKeeper::removeDynamicTag(const std::string& s) { return std::erase_if(m_tags, [&s](const auto& tag) { return tag == s + "*"; }); } diff --git a/src/helpers/TagKeeper.hpp b/src/helpers/TagKeeper.hpp index d18a0d29..f90b0629 100644 --- a/src/helpers/TagKeeper.hpp +++ b/src/helpers/TagKeeper.hpp @@ -8,6 +8,7 @@ class CTagKeeper { bool isTagged(const std::string& tag, bool strict = false) const; bool applyTag(const std::string& tag, bool dynamic = false); bool removeDynamicTag(const std::string& tag); + bool clearTags(); const auto& getTags() const { return m_tags; -- cgit v1.2.3