55 #define handleWhitespace() \ 57 const TokenType t = consumeWhitespace(); \ 66 , m_length(query.length())
67 , m_state(startingState)
135 return Token(code, value);
149 const int len = input.
count();
155 for(
int i = 0; i < len; ++i)
332 return ch >=
'0' && ch <=
'9';
471 const int start =
m_pos;
492 const int startPos =
m_pos;
494 bool isXPath20 =
false;
500 char cell = ch.
cell();
502 if(cell ==
'e' || cell ==
'E')
513 if(cell ==
'+' || cell ==
'-')
520 if(cell < '0' || cell >
'9')
522 if(cell ==
'.' && !hasDot)
553 if(content.length() < 2)
560 content = content.
mid(2);
565 content = content.
mid(1);
568 bool conversionOK =
false;
569 const int codepoint = content.
toInt(&conversionOK, base);
573 const QChar ch(codepoint);
601 const int len = end -
m_pos;
655 else if(c == delimiter)
675 const int startPos =
m_pos;
695 const int offset)
const 703 for(
int i = offset; i < (len + offset); ++i)
793 switch(keyword->
token)
853 if(pc ==
'\'' || (pc ==
'"' && t))
1162 const int qNameLen =
id.value.length() + id2.
value.
length() + 1;
1234 const int currentPos =
m_pos;
1287 switch(keyword->
token)
1291 switch(keyword2->
token)
1400 switch(keyword2->
token)
1420 switch(keyword2->
token)
1796 bool mayBeWS =
true;
1847 const int start =
m_pos;
1944 const int start =
m_pos;
1967 const int start =
m_pos;
1996 const int start =
m_pos;
2047 const int start =
m_pos;
2064 const bool aInLiteral,
2067 bool inLiteral = aInLiteral;
2068 const char otherSep = (sep ==
QLatin1Char(
'"') ?
'\'' :
'"');
2093 if(
m_pos == startPos)
2245 #undef handleWhitespace
int scanUntil(const char *const content)
bool isValid() const
Returns true if the URL is valid; otherwise returns false.
#define QT_END_NAMESPACE
This macro expands to.
Q_CORE_EXPORT QTextStream & ws(QTextStream &s)
int peekForColonColon() const
const QChar at(int i) const
Returns the character at the given index position in the string.
QStack< State > m_stateStack
int toInt(bool *ok=0, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isNull() const
Returns true if the character is the Unicode character 0x0000 ('\0'); otherwise returns false...
Token tokenAndAdvance(const TokenType code, const int advance=1)
QStack< Token > m_tokenStack
void setState(const State s)
#define at(className, varName)
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
int length() const
Returns the number of characters in this string.
bool consumeRawWhitespace()
TokenType consumeWhitespace()
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
const QChar current() const
virtual void setParserContext(const ParserContext::Ptr &parseInfo)
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
static QString normalizeEOL(const QString &input, const CharacterSkips &characterSkips)
The QChar class provides a 16-bit Unicode character.
static const TokenMap * lookupKeyword(const QString &keyword)
const T value(const Key &key) const
Returns the value associated with the key.
bool isSpace() const
Returns true if the character is a separator character (Separator_* categories); otherwise returns fa...
Category category() const
Returns the character's category.
void reserve(int size)
Ensures that the QHash's internal hash table consists of at least size buckets.
virtual int commenceScanOnly()
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
static ushort highSurrogate(uint ucs4)
Returns the high surrogate value of a ucs4 code point.
static ushort lowSurrogate(uint ucs4)
Returns the low surrogate value of a ucs4 code point.
T pop()
Removes the top item from the stack and returns it.
void reserve(int size)
Attempts to allocate memory for at least size characters.
Token tokenizeNumberLiteral()
#define QT_BEGIN_NAMESPACE
This macro expands to.
const Tokenizer::TokenType token
bool contains(const T &value) const
static bool isDigit(const char ch)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The namespace for the internal API of QtXmlPatterns.
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
const_iterator insert(const T &value)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
virtual void resumeTokenizationFrom(const int position)
The State element defines configurations of objects and properties.
#define handleWhitespace()
Tokenizer::TokenType consumeComment()
Parses comments: (: comment content :). It recurses for parsing nested comments.
bool aheadEquals(const char *const chs, const int len, const int offset=1) const
QString tokenizeCharacterReference()
QHash< QString, QChar > m_charRefs
void push(const T &t)
Adds element t to the top of the stack.
char toAscii() const
Returns the character value of the QChar obtained using the current codec used to read C strings...
static const struct TokenMap * value(const char *str, unsigned int len)
const char * constData() const
Returns a pointer to the data stored in the byte array.
bool isNull() const
Returns true if this string is null; otherwise returns false.
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
uint qstrlen(const char *str)
Base class for the XPath Data Model's type hierarchy.
Token tokenizeNCNameOrQName()
XQueryTokenizer(const QString &query, const QUrl &location, const State startingState=Default)
QString & append(QChar c)
static bool isTypeToken(const TokenType t)
char peekAhead(const int length=1) const
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
static QTestResult::TestLocation location
QByteArray toAscii() const Q_REQUIRED_RESULT
Returns an 8-bit representation of the string as a QByteArray.
uchar cell() const
Returns the cell (least significant byte) of the Unicode character.
char peekCurrent() const
Returns the character at the current position, converted to ASCII.
static bool isNCNameStart(const QChar ch)
static bool isOperatorKeyword(const TokenType)
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
Base class for all tokenizers.
static const KeyPair *const end
void prepend(const T &t)
Inserts value at the beginning of the vector.
Token tokenAndChangeState(const TokenType code, const State state, const int advance=1)
static bool isNCNameBody(const QChar ch)
QSet< int > CharacterSkips
uchar row() const
Returns the row (most significant byte) of the Unicode character.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
static bool isPhraseKeyword(const TokenType code)
Token tokenizeStringLiteral()
Token attributeAsRaw(const QChar separator, int &stack, const int startPos, const bool inLiteral, QString &result)
QChar charForReference(const QString &reference)