]> git.lyx.org Git - lyx.git/blob - src/support/textutils.h
Fix bug 1826 + A more precise parser for bibtex files based on the description found...
[lyx.git] / src / support / textutils.h
1 // -*- C++ -*-
2 /**
3  * \file textutils.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Matthias Ettrich
8  * \author Lars Gullik Bjønnes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 // FIXME: I can think of a better name for this file ...
14
15 #ifndef TEXTUTILS_H
16 #define TEXTUTILS_H
17
18 #include "support/types.h"
19
20
21 namespace lyx {
22
23 /// return true if the char is a line separator
24 inline
25 bool isLineSeparatorChar(char_type c)
26 {
27         return c == ' ';
28 }
29
30 /// return true if a char is alphabetical (including accented chars)
31 bool isLetterChar(char_type c);
32
33 /// return whether \p c is an alphabetic character in the ASCII range
34 bool isAlphaASCII(char_type c);
35
36 /// return true if the char is printable
37 bool isPrintable(char_type c);
38
39 /// return true if the char is printable and not a space
40 bool isPrintableNonspace(char_type c);
41
42 /// return true if a unicode char is a space.
43 bool isSpace(char_type c);
44
45 /// return true if a unicode char is a digit.
46 bool isDigit(char_type c);
47
48 /// return whether \p c is a digit in the ASCII range
49 bool isDigitASCII(char_type c);
50
51 } // namespace lyx
52
53 #endif // TEXTUTILS_H