You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
#ifndef TEQUIVCHARS_H
|
|
#define TEQUIVCHARS_H
|
|
|
|
#include "tdelibs_export.h"
|
|
|
|
#include <tqstring.h>
|
|
|
|
/**
|
|
* Class representing a mapping of each alphanumeric character to its "collating
|
|
* equivalent" as defined by the Default Unicode Collation Entity Table (DUCET).
|
|
* The mapping is limited to single-codepoint characters <= U+FFFF.
|
|
*/
|
|
class TDECORE_EXPORT TEquivChars
|
|
{
|
|
public:
|
|
TEquivChars();
|
|
~TEquivChars();
|
|
|
|
/**
|
|
@return copy of @param inputString modified such that each alphanumeric
|
|
character is replaced with it's collating character equivalent. If the
|
|
value @param isRegex is true, the input string is treated as a regular
|
|
expression and the alphabetical characters inside Posix bracket [::]
|
|
expressions are left as-is
|
|
*/
|
|
TQString replaceChars( TQString inputString, bool isRegex = false );
|
|
|
|
/**
|
|
Alternative implementation of replaceChars function that uses some
|
|
"multibyte string" / "wide character" functions defined in wchar.h.
|
|
*/
|
|
TQString replaceCharsMB( TQString inputString, bool isRegex = false );
|
|
|
|
private:
|
|
class TEquivChars_Private *p;
|
|
};
|
|
|
|
#endif // TEQUIVCHARS_H
|