]> git.lyx.org Git - lyx.git/blob - src/support/textutils.h
Fix bug #12772
[lyx.git] / src / support / textutils.h
1 // -*- C++ -*-
2 /**
3  * \file textutils.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Matthias Ettrich
8  * \author Lars Gullik Bjønnes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 // FIXME: I can think of a better name for this file ...
14
15 #ifndef TEXTUTILS_H
16 #define TEXTUTILS_H
17
18 #include "support/strfwd.h"
19
20
21 namespace lyx {
22
23 /// return true if the char is a line separator
24 inline bool isLineSeparatorChar(char_type c) { return c == ' '; }
25
26 /// return true if a char is alphabetical (including accented chars)
27 bool isLetterChar(char_type c);
28
29 /// return true if a char is lowercase
30 bool isLower(char_type c);
31
32 /// return whether \p c is an alphabetic character in the ASCII range
33 bool isAlphaASCII(char_type c);
34
35 /// return true if the char is printable
36 bool isPrintable(char_type c);
37
38 /// return true if the char is printable and not a space
39 bool isPrintableNonspace(char_type c);
40
41 /// return true if a unicode char is a space.
42 bool isSpace(char_type c);
43
44 /// return true if a unicode char is a numeral.
45 bool isNumber(char_type c);
46
47 /// return true if a unicode char has the direction attribute
48 /// Common Number Separator [CS]
49 bool isCommonNumberSeparator(char_type c);
50
51 /// return true if a unicode char has the direction attribute
52 /// European Number Terminator [ET]
53 bool isEuropeanNumberTerminator(char_type c);
54
55 /// return whether \p c is a digit in the ASCII range
56 bool isDigitASCII(char_type c);
57
58 /// return whether \p c is a digit (not just 0-9)
59 bool isNumberChar(char_type c);
60
61 /// return whether \p c is alpha or a digit in the ASCII range
62 bool isAlnumASCII(char_type c);
63
64 /// return whether \p c is in the ASCII range
65 bool isASCII(char_type c);
66
67 /// return whether \p c is in the 'Punctuation, Open' unicode category
68 bool isOpenPunctuation(char_type c);
69
70 } // namespace lyx
71
72 #endif // TEXTUTILS_H