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 "paragraph.h"
20 /// return true if the char is a word separator
22 bool IsSeparatorChar(char c)
28 /// return true if the char is a line separator
30 bool IsLineSeparatorChar(char c)
36 /// return true if the char is a meta-character for an inset
38 bool IsInsetChar(char c)
40 return (c == Paragraph::META_INSET);
44 /// return true if the char is "punctuation"
46 bool IsKommaChar(char c)
75 /// return true if a char is alphabetical (including accented chars)
77 bool IsLetterChar(unsigned char c)
79 return ((c >= 'A' && c <= 'Z')
80 || (c >= 'a' && c <= 'z')
81 || (c >= 192)); // in iso-8859-x these are accented chars
85 /// return true if the char is printable (masked to 7-bit ASCII)
87 bool IsPrintable(unsigned char c)
89 return ((c & 127) >= ' ');
93 /// return true if the char is printable and not a space (masked to 7-bit ASCII)
95 bool IsPrintableNonspace(unsigned char c)
97 return IsPrintable(c) && (c != ' ');
101 /// return true if the char forms part of a word
103 bool IsWordChar(unsigned char c)
105 return !(IsSeparatorChar(c)
111 /// completely pointless FIXME
113 bool IsDigit(unsigned char ch)
115 return ch >= '0' && ch <= '9';
119 /// return true if the char is alphanumeric
121 bool IsLetterCharOrDigit(unsigned char ch)
123 return IsLetterChar(ch) || IsDigit(ch);
126 #endif // TEXTUTILS_H