This commit is contained in:
Branimir Karadžić
2018-10-25 22:16:26 -07:00
parent 9bf79c70cc
commit 1e334b9983
3 changed files with 9 additions and 4 deletions

View File

@@ -236,4 +236,9 @@ namespace bx
}
}
inline StringView strSubstr(const StringView& _str, int32_t _start, int32_t _len)
{
return StringView(_str, _start, _len);
}
} // namespace bx

View File

@@ -245,12 +245,12 @@ namespace bx
/// Find end of line. Retuns pointer to new line terminator.
StringView strFindEol(const StringView& _str);
/// Returns pointer to first character after word.
const char* strSkipWord(const char* _str, int32_t _max = INT32_MAX);
/// Returns StringView of word or empty.
StringView strWord(const StringView& _str);
///
StringView strSubstr(const StringView& _str, int32_t _start, int32_t _len);
/// Find matching block.
const char* strmb(const char* _str, char _open, char _close);

View File

@@ -593,7 +593,7 @@ namespace bx
return StringView(_str.getTerm(), _str.getTerm() );
}
const char* strSkipWord(const char* _str, int32_t _max)
static const char* strSkipWord(const char* _str, int32_t _max)
{
for (char ch = *_str++; 0 < _max && (isAlphaNum(ch) || '_' == ch); ch = *_str++, --_max) {};
return _str-1;