28 bool allow_negative) {
31 if (is_negative && !allow_negative) {
36 [](
char c) {
return isdigit(
static_cast<unsigned char>(c)) != 0; });
41 value = __kmp_basic_str_to_int(data, num_digits);
42 if (value == INT_MAX) {
49 if (!allow_zero && value == 0) {
57 char *copy_str =
static_cast<char *
>(KMP_INTERNAL_MALLOC(len + 1));
59 KMP_FATAL(MemoryAllocFailed);
60 memcpy(copy_str, data, len);
kmp_str_ref is a non-owning string class (similar to llvm::StringRef).
bool consume_front(kmp_str_ref prefix)
bool consume_integer(int &value, bool allow_zero=true, bool allow_negative=false)
size_t count_while(const Fn &predicate) const
void drop_front(size_t n)