X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Futil.h;h=ba47adfa5ce7096955588a2975373c5856a306ed;hp=342356fa38a5c2a0e486f99eb25e9fb00489ad6b;hb=e008cd12ef319c4b5f9fe5a8cc1524829551771d;hpb=4b45582f5d766e7324fe6d2abd260548ef0b9584;ds=sidebyside diff --git a/src/common/util.h b/src/common/util.h index 342356fa..ba47adfa 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -26,34 +26,26 @@ #include #include + +// TODO Use versions from NetworkInfo instead QString nickFromMask(QString mask); QString userFromMask(QString mask); QString hostFromMask(QString mask); +bool isChannelName(QString str); + //! Take a string and decode it using the specified text codec, recognizing utf8. /** This function takes a string and first checks if it is encoded in utf8, in which case it is * decoded appropriately. Otherwise, the specified text codec is used to transform the string. * \param input The input string containing encoded data - * \param encoding The text encoding we assume if it's not utf8 + * \param encoding The text codec we use if the input is not utf8 * \return The decoded string. */ -QString decodeString(QByteArray input, QString encoding = "ISO-8859-15"); - -bool isChannelName(QString str); - -/** - * Writes a QVariant to a device. The data item is prefixed with the resulting blocksize, - * so the corresponding function readDataFromDevice() can check if enough data is available - * at the device to reread the item. - */ -void writeDataToDevice(QIODevice *, const QVariant &); - -/** Reads a data item from a device that has previously been written by writeDataToDevice(). - * If not enough data bytes are available, the function returns false and the QVariant reference - * remains untouched. - */ -bool readDataFromDevice(QIODevice *, quint32 &, QVariant &); +QString decodeString(const QByteArray &input, QTextCodec *codec = 0); +// NOTE: We have static copies of these in SignalProxy... +//void writeDataToDevice(QIODevice *, const QVariant &); +//bool readDataFromDevice(QIODevice *, quint32 &, QVariant &); uint editingDistance(const QString &s1, const QString &s2);