mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-10 04:31:34 -10:00
* 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
23 lines
470 B
C++
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);
|
|
});
|
|
}
|
|
|
|
}
|