4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Matthias Ettrich
8 * \author Lars Gullik Bjønnes
10 * Full author contact details are available in file CREDITS.
13 // FIXME: I can think of a better name for this file ...
18 #include "support/types.h"
20 #ifdef LIBC_WCTYPE_USES_UCS4
21 // We can use the libc ctype functions because we unset the LC_CTYPE
22 // category of the current locale in gettext.C
25 // Steal some code from somewhere else, e.g. glib (look at gunicode.h)
26 // The code that we currently use does not really work.
32 /// return true if the char is a line separator
34 bool isLineSeparatorChar(char_type c)
40 /// return true if a char is alphabetical (including accented chars)
42 bool isLetterChar(char_type c)
44 #ifdef LIBC_WCTYPE_USES_UCS4
47 // FIXME UNICODE This is wrong!
48 return (c >= 'A' && c <= 'Z')
49 || (c >= 'a' && c <= 'z')
50 || (c >= 192 && c < 256); // in iso-8859-x these are accented chars
55 /// return true if the char is printable
57 bool isPrintable(char_type c)
59 #ifdef LIBC_WCTYPE_USES_UCS4
62 // FIXME UNICODE This is wrong!
63 return (c & 127) >= ' ';
68 /// return true if the char is printable and not a space
70 bool isPrintableNonspace(char_type c)
72 #ifdef LIBC_WCTYPE_USES_UCS4
73 return iswprint(c) && !iswspace(c);
75 // FIXME UNICODE This is wrong!
76 return (c & 127) > ' ';
81 /// return true if a unicode char is a digit.
83 bool isDigit(char_type c)
85 #ifdef LIBC_WCTYPE_USES_UCS4
88 // FIXME UNICODE This is wrong!
89 return c >= '0' && c <= '9';