559 ::sprintf (buffer, "%f", value); |
559 ::sprintf (buffer, "%f", value); |
560 return String (buffer); |
560 return String (buffer); |
561 } |
561 } |
562 |
562 |
563 /*! |
563 /*! |
|
564 * \brief Constructs a string from a vector of bytes. The bytes do not have to be null-terminated. |
|
565 * \param bytes Bytes to use for construction |
|
566 * \returns the resulting string. |
|
567 */ |
|
568 String String::fromBytes(const Vector<unsigned char>& bytes) |
|
569 { |
|
570 return String(reinterpret_cast<const Vector<char>&>(bytes)); |
|
571 } |
|
572 |
|
573 /*! |
564 * \returns the MD5-checksum of this string. |
574 * \returns the MD5-checksum of this string. |
565 */ |
575 */ |
566 String String::md5() const |
576 String String::md5() const |
567 { |
577 { |
568 char checksum[33]; |
578 char checksum[33]; |