Encryption tool

This commit is contained in:
Jakub Melka
2021-06-01 16:09:00 +02:00
parent 453a3a24c7
commit c22cba2f50
12 changed files with 320 additions and 13 deletions

View File

@ -75,7 +75,8 @@ public:
/// are also present in given encoding).
/// \param string String to be tested
/// \param encoding Encoding used in verification of conversion
static bool canConvertToEncoding(const QString& string, Encoding encoding);
/// \param[out] invalidCharacters Storage, where not convertible characters are inserted
static bool canConvertToEncoding(const QString& string, Encoding encoding, QString* invalidCharacters);
/// Checks, if stream can be converted to string using encoding (i.e. all
/// characters are defined). If all characters are valid, then true is
@ -120,6 +121,11 @@ public:
/// \returns Unicode string or string converted to hexadecimal representation
static QString convertSmartFromByteStringToUnicode(const QByteArray& stream, bool* isBinary);
/// Returns all characters of the given encoding
/// \param encoding Encoding
/// \returns All characters reprezentable by encoding.
static QString getEncodingCharacters(Encoding encoding);
private:
/// Returns true, if byte array has UTF-16BE/LE unicode marking bytes at the
/// stream start. If they are present, then byte stream is probably encoded