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 meta-character newline
20 bool IsNewlineChar(char c)
22 return (c == Paragraph::META_NEWLINE);
26 /// return true if the char is a word separator
28 bool IsSeparatorChar(char c)
34 /// return true if the char is a line separator
36 bool IsLineSeparatorChar(char c)
42 /// return true if the char is a meta-character for hfill
44 bool IsHfillChar(char c)
46 return (c == Paragraph::META_HFILL);
50 /// return true if the char is a meta-character for an inset
52 bool IsInsetChar(char c)
54 return (c == Paragraph::META_INSET);
58 /// return true if the char is "punctuation"
60 bool IsKommaChar(char c)
85 || c == Paragraph::META_NEWLINE
90 /// return true if a char is alphabetical (including accented chars)
92 bool IsLetterChar(unsigned char c)
94 return ((c >= 'A' && c <= 'Z')
95 || (c >= 'a' && c <= 'z')
96 || (c >= 192)); // in iso-8859-x these are accented chars
100 /// return true if the char is printable (masked to 7-bit ASCII)
102 bool IsPrintable(unsigned char c)
104 return ((c & 127) >= ' ');
108 /// return true if the char is printable and not a space (masked to 7-bit ASCII)
110 bool IsPrintableNonspace(unsigned char c)
112 return IsPrintable(c) && (c != ' ');
116 /// return true if the char forms part of a word
118 bool IsWordChar(unsigned char c)
120 return !(IsSeparatorChar(c)
127 /// completely pointless FIXME
129 bool IsDigit(unsigned char ch)
131 return ch >= '0' && ch <= '9';
135 /// return true if the char is alphanumeric
137 bool IsLetterCharOrDigit(unsigned char ch)
139 return IsLetterChar(ch) || IsDigit(ch);
142 #endif // TEXTUTILS_H