1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
2002-05-30 02:24:33 +00:00
|
|
|
/**
|
|
|
|
* \file textutils.h
|
2002-09-25 10:03:41 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2002-09-25 10:03:41 +00:00
|
|
|
* \author Matthias Ettrich
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Lars Gullik Bjønnes
|
2002-09-25 10:03:41 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-05-30 02:24:33 +00:00
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2002-05-30 02:24:33 +00:00
|
|
|
// FIXME: I can think of a better name for this file ...
|
2002-08-14 17:15:18 +00:00
|
|
|
|
1999-11-15 10:54:16 +00:00
|
|
|
#ifndef TEXTUTILS_H
|
|
|
|
#define TEXTUTILS_H
|
|
|
|
|
2007-10-31 22:40:34 +00:00
|
|
|
#include "support/strfwd.h"
|
1999-11-15 10:54:16 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2002-05-30 02:24:33 +00:00
|
|
|
/// return true if the char is a line separator
|
2007-10-31 22:40:34 +00:00
|
|
|
inline bool isLineSeparatorChar(char_type c) { return c == ' '; }
|
2002-08-14 17:15:18 +00:00
|
|
|
|
2002-05-30 02:24:33 +00:00
|
|
|
/// return true if a char is alphabetical (including accented chars)
|
2007-02-26 09:03:21 +00:00
|
|
|
bool isLetterChar(char_type c);
|
1999-11-15 10:54:16 +00:00
|
|
|
|
2009-01-04 23:35:08 +00:00
|
|
|
/// return true if a char is lowercase
|
|
|
|
bool isLower(char_type c);
|
|
|
|
|
2007-04-02 15:21:36 +00:00
|
|
|
/// return whether \p c is an alphabetic character in the ASCII range
|
|
|
|
bool isAlphaASCII(char_type c);
|
|
|
|
|
2006-11-13 09:53:25 +00:00
|
|
|
/// return true if the char is printable
|
2007-02-26 09:03:21 +00:00
|
|
|
bool isPrintable(char_type c);
|
1999-11-15 10:54:16 +00:00
|
|
|
|
2006-11-13 09:53:25 +00:00
|
|
|
/// return true if the char is printable and not a space
|
2007-02-26 09:03:21 +00:00
|
|
|
bool isPrintableNonspace(char_type c);
|
2006-11-13 09:53:25 +00:00
|
|
|
|
2007-04-04 20:06:34 +00:00
|
|
|
/// return true if a unicode char is a space.
|
|
|
|
bool isSpace(char_type c);
|
|
|
|
|
2010-12-07 00:13:19 +00:00
|
|
|
/// return true if a unicode char is a numeral.
|
|
|
|
bool isNumber(char_type c);
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2018-07-22 10:36:38 +00:00
|
|
|
/// return true if a unicode char has the direction attribute
|
|
|
|
/// European Number Separator [ES]
|
|
|
|
bool isEuropeanNumberSeparator(char_type c);
|
|
|
|
|
|
|
|
/// return true if a unicode char has the direction attribute
|
|
|
|
/// European Number Terminator [ET]
|
|
|
|
bool isEuropeanNumberTerminator(char_type c);
|
|
|
|
|
2007-04-02 15:21:36 +00:00
|
|
|
/// return whether \p c is a digit in the ASCII range
|
|
|
|
bool isDigitASCII(char_type c);
|
|
|
|
|
2010-11-17 22:17:53 +00:00
|
|
|
/// return whether \p c is alpha or a digit in the ASCII range
|
|
|
|
bool isAlnumASCII(char_type c);
|
|
|
|
|
2012-12-29 13:30:18 +00:00
|
|
|
/// return whether \p c is in the ASCII range
|
|
|
|
bool isASCII(char_type c);
|
|
|
|
|
2016-12-27 11:06:54 +00:00
|
|
|
/// return whether \p c is in the 'Punctuation, Open' unicode category
|
|
|
|
bool isOpenPunctuation(char_type c);
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
2002-05-30 02:24:33 +00:00
|
|
|
#endif // TEXTUTILS_H
|