diff options
| author | Lichie <90825386+lichie567@users.noreply.github.com> | 2026-05-03 10:55:47 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-03 18:55:47 +0100 |
| commit | 6a7abd00379b4f37b468bc2d0e717d4ba293efe1 (patch) | |
| tree | d94eb1a5662ddc992d6dd2b3b6dc63aa97135fcc /src/helpers | |
| parent | 21fa9b2ee27227c964fdeb8090d98255edb89bec (diff) | |
config/lua: add clear tag api (#14273)
Diffstat (limited to 'src/helpers')
| -rw-r--r-- | src/helpers/TagKeeper.cpp | 9 | ||||
| -rw-r--r-- | src/helpers/TagKeeper.hpp | 1 |
2 files changed, 10 insertions, 0 deletions
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; |
