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 /// return true if the char is a word separator
20 bool IsSeparatorChar(char c)
26 /// return true if the char is a line separator
28 bool IsLineSeparatorChar(char c)
34 /// return true if the char is "punctuation"
36 bool IsKommaChar(char c)
65 /// return true if a char is alphabetical (including accented chars)
67 bool IsLetterChar(unsigned char c)
69 return ((c >= 'A' && c <= 'Z')
70 || (c >= 'a' && c <= 'z')
71 || (c >= 192)); // in iso-8859-x these are accented chars
75 /// return true if the char is printable (masked to 7-bit ASCII)
77 bool IsPrintable(unsigned char c)
79 return ((c & 127) >= ' ');
83 /// return true if the char is printable and not a space (masked to 7-bit ASCII)
85 bool IsPrintableNonspace(unsigned char c)
87 return IsPrintable(c) && (c != ' ');
91 /// completely pointless FIXME
93 bool IsDigit(unsigned char ch)
95 return ch >= '0' && ch <= '9';
99 /// return true if the char is alphanumeric
101 bool IsLetterCharOrDigit(unsigned char ch)
103 return IsLetterChar(ch) || IsDigit(ch);
106 #endif // TEXTUTILS_H