diff options
Diffstat (limited to 'Source/Utils/WarpXUtil.cpp')
-rw-r--r-- | Source/Utils/WarpXUtil.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/Utils/WarpXUtil.cpp b/Source/Utils/WarpXUtil.cpp index ddd3cf4b6..7340056fc 100644 --- a/Source/Utils/WarpXUtil.cpp +++ b/Source/Utils/WarpXUtil.cpp @@ -224,3 +224,26 @@ void AlwaysAssert(bool is_expression_true, const std::string& msg = "ERROR!") } } + +namespace WarpXUtilStr +{ + bool is_in(const std::vector<std::string>& vect, + const std::string& elem) + { + bool value = false; + if (std::find(vect.begin(), vect.end(), elem) != vect.end()){ + value = true; + } + return value; + } + + bool is_in(const std::vector<std::string>& vect, + const std::vector<std::string>& elems) + { + bool value = false; + for (auto elem : elems){ + if (is_in(vect, elem)) value = true; + } + return value; + } +} |