4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 // FIXME: I can think of a better name for this file ...
16 #include "support/textutils.h"
17 #include "support/qstring_helpers.h"
22 /// Maximum valid UCS4 code point
23 char_type const ucs4_max = 0x10ffff;
27 bool isLetterChar(char_type c)
31 // outside the UCS4 range
33 // assume that all non-utf16 characters are letters
36 return ucs4_to_qchar(c).isLetter();
40 bool isPrintable(char_type c)
44 // outside the UCS4 range
46 // assume that all non-utf16 characters are printable
49 return ucs4_to_qchar(c).isPrint();
53 bool isPrintableNonspace(char_type c)
57 // outside the UCS4 range
59 // assume that all non-utf16 characters are printable and
63 QChar const qc = ucs4_to_qchar(c);
64 return qc.isPrint() && !qc.isSpace();
68 bool isDigit(char_type c)
71 // assume that no non-utf16 character is a digit
72 // c outside the UCS4 range is catched as well
74 return ucs4_to_qchar(c).isDigit();