diff options
| author | Brenno Lemos <brenno@syndel.is> | 2023-10-22 19:11:03 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-22 23:11:03 +0100 |
| commit | b135bd6cd4c27a9fd94dfa084e75188463c2eb3b (patch) | |
| tree | 74f04ca3dd010c41f0fd323187bfd916747da151 /src/helpers/VarList.hpp | |
| parent | 59f27e7f570170783ac01fb46a0ff90e14de53e6 (diff) | |
workspacerules: Add new optional "default command" for auto-launching apps on new workspaces (#3559)
Diffstat (limited to 'src/helpers/VarList.hpp')
| -rw-r--r-- | src/helpers/VarList.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/helpers/VarList.hpp b/src/helpers/VarList.hpp index 60e9a551..8f33f166 100644 --- a/src/helpers/VarList.hpp +++ b/src/helpers/VarList.hpp @@ -1,4 +1,5 @@ #pragma once +#include <functional> #include <vector> #include <string> #include "../macros.hpp" @@ -20,6 +21,15 @@ class CVarList { std::string join(const std::string& joiner, size_t from = 0, size_t to = 0) const; + void map(std::function<void(std::string&)> func) { + for (auto& s : m_vArgs) + func(s); + } + + void append(const std::string arg) { + m_vArgs.emplace_back(arg); + } + std::string operator[](const size_t& idx) const { if (idx >= m_vArgs.size()) return ""; |
