Add contains method to ValueTokenizer
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
|
||||
#include "tokenizer.h"
|
||||
#include "utils.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
@ -84,6 +85,10 @@ bool ValueTokenizer::has_next() const {
|
||||
return current != tokens.cend();
|
||||
}
|
||||
|
||||
bool ValueTokenizer::contains(const std::string & value) const {
|
||||
return std::find(tokens.cbegin(), tokens.cend(), value) != tokens.cend();
|
||||
}
|
||||
|
||||
std::string ValueTokenizer::next_string() {
|
||||
if (has_next()) {
|
||||
std::string value = *current;
|
||||
|
||||
Reference in New Issue
Block a user