summaryrefslogtreecommitdiffstats
path: root/tdecore/tequivchars.h
diff options
context:
space:
mode:
authorVincent Reher <tde@4reher.org>2023-06-22 09:22:42 -0700
committerVincent Reher <tde@4reher.org>2023-10-02 11:22:04 -0700
commita39403fb8be586e9b9e4b326616156fbfed27c6c (patch)
tree85f7bf35279604d3c648d7fe0521890e2ee5283d /tdecore/tequivchars.h
parent4c0dae60b2fbc60996fc8f4bd29ee6219b869527 (diff)
downloadtdelibs-a39403fb8be586e9b9e4b326616156fbfed27c6c.tar.gz
tdelibs-a39403fb8be586e9b9e4b326616156fbfed27c6c.zip
This new branch is a follow-up to the latest and
final commit to branch issue/270/tdelibs-V3. It includes the following files that were mistakenly omitted in that commit: tdecore/CMakeLists.txt tdecore/README.tdestringmatcher tdecore/tdeglobal.cpp tdecore/tdeglobal.h tdecore/tdestringmatcher.cpp tdecore/tdestringmatcher.h tdeio/tdeio/tdefileitem.cpp tdeio/tdeio/tdefileitem.h It also includes updates to the following files, some of which are based on recent feedback from @MicheleC: tdecore/tequivchars-mapping.h tdecore/tequivchars.cpp tdecore/tequivchars.h Signed-off-by: Vincent Reher <tde@4reher.org>
Diffstat (limited to 'tdecore/tequivchars.h')
-rw-r--r--tdecore/tequivchars.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/tdecore/tequivchars.h b/tdecore/tequivchars.h
new file mode 100644
index 000000000..0b933ae7a
--- /dev/null
+++ b/tdecore/tequivchars.h
@@ -0,0 +1,34 @@
+#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( const TQString &inputString, bool isRegex = false );
+
+
+private:
+
+ class TEquivChars_Private *p;
+};
+
+#endif // TEQUIVCHARS_H