From ccaf4c0110067442ff8b141a73604ab2c5d5e715 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Tue, 16 Feb 2016 15:36:54 +0100 Subject: Add missing Util --- Util.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Util.hpp (limited to 'Util.hpp') diff --git a/Util.hpp b/Util.hpp new file mode 100644 index 0000000..f90e108 --- /dev/null +++ b/Util.hpp @@ -0,0 +1,18 @@ +#pragma once + +#include +#include + +namespace Util { + static const QMap unescapeChars { + {'n', '\n'}, + }; + + QString trimQuotes(QString string, bool& trimmed); + QString unescape(const QString& string, const QChar escapeChar = '\\'); + QString escape(const QString& string, const QChar escapeChar = '\\', const QString& escapeChars = ""); + QString joinEscape(const QStringList& list, const QChar joinChar, const QChar escapeChar = '\\'); + QStringList splitEscaped(const QString& joined, const QChar splitChar, const QChar escapeChar = '\\'); + QString& unescapeClonkString(QString&& string); + int indexOfEscaped(const QString& string, const QChar subject, int startPos = 0, const QChar escapeChar = '\\'); +} -- cgit v1.2.3-54-g00ecf