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)
19 return (c == Paragraph::META_NEWLINE);
23 /// return true if the char is a word separator
25 bool IsSeparatorChar(char c)
31 /// return true if the char is a line separator
33 bool IsLineSeparatorChar(char c)
39 /// return true if the char is a meta-character for hfill
41 bool IsHfillChar(char c)
43 return (c == Paragraph::META_HFILL);
47 /// return true if the char is a meta-character for an inset
49 bool IsInsetChar(char c)
51 return (c == Paragraph::META_INSET);
55 /// return true if the char is "punctuation"
57 bool IsKommaChar(char c)
82 || c == Paragraph::META_NEWLINE
87 /// return true if a char is alphabetical (including accented chars)
89 bool IsLetterChar(unsigned char c)
91 return ((c >= 'A' && c <= 'Z')
92 || (c >= 'a' && c <= 'z')
93 || (c >= 192)); // in iso-8859-x these are accented chars
97 /// return true if the char is printable (masked to 7-bit ASCII)
99 bool IsPrintable(unsigned char c)
101 return ((c & 127) >= ' ');
105 /// return true if the char is printable and not a space (masked to 7-bit ASCII)
107 bool IsPrintableNonspace(unsigned char c)
109 return IsPrintable(c) && (c != ' ');
113 /// return true if the char forms part of a word
115 bool IsWordChar(unsigned char c)
117 return !(IsSeparatorChar(c)
124 /// completely pointless FIXME
126 bool IsDigit(unsigned char ch)
128 return ch >= '0' && ch <= '9';
132 /// return true if the char is alphanumeric
134 bool IsLetterCharOrDigit(unsigned char ch)
136 return IsLetterChar(ch) || IsDigit(ch);
139 #endif // TEXTUTILS_H