Files
fs2open.github.com/code/utils/string_utils.cpp
T
Mike Nelson 4dfaa85b6f Default settings tbl (#6491)
* initial version of default_settings.tbl

* Add a way to change player detail level defaults and implement a couple more options to detail_settings.tbl

* support the rest of 2d.cpp options

* Allow enforcing options to a specific value

* modernize detail defaults, levels, and values

* Fix parsing issue and remove lambda capture by reference

* fix print

* clang

* More efficient +Enforce parsing

* cleanup

* typo

* don't negate this

* error_display

* clarify language between presets, levels, and values

* add default case

* small fix

* use a map to minimize string lookups
2025-01-12 11:29:11 -05:00

23 lines
470 B
C++

//
//
#include "string_utils.h"
namespace util {
std::vector<std::string> split_string(const std::string& s, char delim) {
std::vector<std::string> elems;
split_string(s, delim, std::back_inserter(elems));
return elems;
}
bool isStringOneOf(const std::string& value, const std::vector<std::string>& candidates)
{
return std::any_of(candidates.begin(), candidates.end(), [&value](const std::string& candidate) {
return lcase_equal(value, candidate);
});
}
}