Chatterino
|
Functions | |
int | skipSpace (const QStringRef &view, int startPos) |
bool | matchesIgnorePlural (const QStringRef &word, const QString &singular) |
std::pair< uint64_t, bool > | findUnitMultiplierToSec (const QStringRef &view, int &pos) |
std::pair< uint64_t, bool > chatterino::_helpers_internal::findUnitMultiplierToSec | ( | const QStringRef & | view, |
int & | pos | ||
) |
Tries to find the unit starting at pos
and returns its multiplier so valueInUnit * multiplier = valueInSeconds
(e.g. 60 for minutes).
Supported units are 'w[eek(s)]', 'd[ay(s)]', 'h[our(s)]', 'm[inute(s)]', 's[econd(s)]'. The unit must be in lowercase.
view | A view into a string |
pos | The starting position. This is set to the last position of the unit if it's a valid unit, undefined otherwise. |
bool chatterino::_helpers_internal::matchesIgnorePlural | ( | const QStringRef & | word, |
const QString & | expected | ||
) |
Checks if word
equals expected
(singular) or expected
+ 's' (plural).
word | Word to test. Must not be empty. |
expected | Singular of the expected word. |
word
is singular or plural of expected
. int chatterino::_helpers_internal::skipSpace | ( | const QStringRef & | view, |
int | startPos | ||
) |
Skips all spaces. The caller must guarantee view.at(startPos).isSpace().
view | The string to skip spaces in. |
startPos | The starting position (there must be a space in the view). |