4 * Copyright 1995-2002 the LyX Team
5 * Read the file COPYING
10 // FIXME: I can think of a better name for this file ...
15 /// return true if the char is a meta-character newline
17 bool IsNewlineChar(char c) {
18 return (c == Paragraph::META_NEWLINE);
22 /// return true if the char is a word separator
24 bool IsSeparatorChar(char c) {
29 /// return true if the char is a line separator
31 bool IsLineSeparatorChar(char c) {
36 /// return true if the char is a meta-character for hfill
38 bool IsHfillChar(char c) {
39 return (c == Paragraph::META_HFILL);
43 /// return true if the char is a meta-character for an inset
45 bool IsInsetChar(char c) {
46 return (c == Paragraph::META_INSET);
50 /// return true if the char is "punctuation"
52 bool IsKommaChar(char c) {
76 || c == Paragraph::META_NEWLINE
81 /// return true if a char is alphabetical (including accented chars)
83 bool IsLetterChar(unsigned char c) {
84 return ((c >= 'A' && c <= 'Z')
85 || (c >= 'a' && c <= 'z')
86 || (c >= 192)); // in iso-8859-x these are accented chars
90 /// return true if the char is printable (masked to 7-bit ASCII)
92 bool IsPrintable(unsigned char c) {
93 return ((c & 127) >= ' ');
97 /// return true if the char is printable and not a space (masked to 7-bit ASCII)
99 bool IsPrintableNonspace(unsigned char c) {
100 return IsPrintable(c) && (c != ' ');
104 /// return true if the char forms part of a word
106 bool IsWordChar(unsigned char c) {
107 return !(IsSeparatorChar(c)
114 /// completely pointless FIXME
116 bool IsDigit(unsigned char ch)
118 return ch >= '0' && ch <= '9';
122 /// return true if the char is alphanumeric
124 bool IsLetterCharOrDigit(unsigned char ch)
126 return IsLetterChar(ch) || IsDigit(ch);
129 #endif // TEXTUTILS_H