本文整理汇总了C++中qstring::const_iterator::isLetter方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::isLetter方法的具体用法?C++ const_iterator::isLetter怎么用?C++ const_iterator::isLetter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qstring::const_iterator
的用法示例。
在下文中一共展示了const_iterator::isLetter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isCorrectRules
bool isCorrectRules(const RulesMap &rules)
{
QString key, val;
//Для каждого правила
for (RulesMap::const_iterator i = rules.constBegin(); i != rules.constEnd(); ++i){
key = i.key();
val = i.value();
//Для каждого символа ключа
for (QString::const_iterator j = key.constBegin(); j != key.constEnd(); ++j){
if (j->isLetter()||*j == '`'){
if (!((*j >= QChar('a') && *j <= QChar('z')) || *j == '`' || (*j >= QChar('A') && *j <= QChar('Z')))){
return false;
}
}
else{
return false;
}
}
//Для каждого символа значения
for (QString::const_iterator j = val.constBegin(); j != val.constEnd(); ++j){
if (j->isLetter()){
if (!((*j >= QChar(1040) && *j <= (1105)))){
return false;
}
}
else{
return false;
}
}
}
return true;
}
示例2: consumeIdentifier
AnimExpression::Token AnimExpression::consumeIdentifier(const QString& str, QString::const_iterator& iter) const {
assert(iter != str.end());
assert(iter->isLetter());
auto begin = iter;
while ((iter->isLetter() || iter->isDigit()) && iter != str.end()) {
++iter;
}
int pos = (int)(begin - str.begin());
int len = (int)(iter - begin);
QStringRef stringRef(const_cast<const QString*>(&str), pos, len);
if (stringRef == "true") {
return Token(true);
} else if (stringRef == "false") {
return Token(false);
} else {
return Token(stringRef);
}
}
示例3: isCorrectText
bool isCorrectText(const QString &text)
{
for (QString::const_iterator i = text.constBegin(); i != text.constEnd(); ++i){
if (i->isLetter()){
if (!((*i >= 'a' && *i <= 'z') || (*i >= 'A' && *i <= 'Z'))){
return false;
}
}
}
return true;
}
示例4: consumeToken
AnimExpression::Token AnimExpression::consumeToken(const QString& str, QString::const_iterator& iter) const {
if (!_tokenStack.empty()) {
Token top = _tokenStack.top();
_tokenStack.pop();
return top;
} else {
while (iter != str.end()) {
if (iter->isSpace()) {
++iter;
} else if (iter->isLetter()) {
return consumeIdentifier(str, iter);
} else if (iter->isDigit()) {
return consumeNumber(str, iter);
} else {
switch (iter->unicode()) {
case '&': return consumeAnd(str, iter);
case '|': return consumeOr(str, iter);
case '>': return consumeGreaterThan(str, iter);
case '<': return consumeLessThan(str, iter);
case '(': ++iter; return Token(Token::LeftParen);
case ')': ++iter; return Token(Token::RightParen);
case '!': return consumeNot(str, iter);
case '-': ++iter; return Token(Token::Minus);
case '+': ++iter; return Token(Token::Plus);
case '*': ++iter; return Token(Token::Multiply);
case '/': ++iter; return Token(Token::Divide);
case '%': ++iter; return Token(Token::Modulus);
case ',': ++iter; return Token(Token::Comma);
default:
qCCritical(animation) << "AnimExpression: unexpected char" << *iter << "at index " << (int)(iter - str.begin());
return Token(Token::Error);
}
}
}
return Token(Token::End);
}
}