sources/mystring.cpp

branch
protocol5
changeset 159
970d58a01e8b
parent 150
37db42ad451a
parent 158
de7574d292ad
child 195
be953e1621d9
--- a/sources/mystring.cpp	Wed Jul 20 18:31:19 2016 +0300
+++ b/sources/mystring.cpp	Fri Jul 22 17:59:55 2016 +0300
@@ -561,6 +561,16 @@
 }
 
 /*!
+ * \brief Constructs a string from a vector of bytes. The bytes do not have to be null-terminated.
+ * \param bytes Bytes to use for construction
+ * \returns the resulting string.
+ */
+String String::fromBytes(const ByteArray& bytes)
+{
+	return String(reinterpret_cast<const Vector<char>&>(bytes));
+}
+
+/*!
  * \returns the MD5-checksum of this string.
  */
 String String::md5() const

mercurial