blob: 51708fc13f8b298a77cf1ebdb25fb5ee4faae3cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/*
SPDX-FileCopyrightText: 2020 Jonathan Poelen <jonathan.poelen@gmail.com>
SPDX-License-Identifier: MIT
*/
#ifndef KSYNTAXHIGHLIGHTING_WORDDELIMITERS_P_H
#define KSYNTAXHIGHLIGHTING_WORDDELIMITERS_P_H
#include <QString>
namespace KSyntaxHighlighting
{
/**
* Repesents a list of character that separates 2 words.
*
* Default delimiters are .():!+*,-<=>%&/;?[]^{|}~\, space (' ') and tabulator ('\t').
*
* @see Rule
* @since 5.74
*/
class WordDelimiters
{
public:
WordDelimiters();
/**
* Returns @c true if @p c is a word delimiter; otherwise returns @c false.
*/
bool contains(QChar c) const;
/**
* Appends the character @p c to word delimiter.
*/
void append(QChar c);
/**
* Removes the character @p c from word delimiters.
*/
void remove(QChar c);
private:
/**
* An array which represents ascii characters for very fast lookup.
* The character is used as an index and the value @c true indicates a word delimiter.
*/
bool asciiDelimiters[128];
/**
* Contains characters that are not ascii and is empty for most syntax definition.
*/
QString notAsciiDelimiters;
};
}
#endif
|