| 5870 | #endif |
| 5871 | |
| 5872 | Vector<uint8_t> String::to_ascii_buffer() const { |
| 5873 | const String *s = this; |
| 5874 | if (s->is_empty()) { |
| 5875 | return Vector<uint8_t>(); |
| 5876 | } |
| 5877 | CharString charstr = s->ascii(); |
| 5878 | |
| 5879 | Vector<uint8_t> retval; |
| 5880 | size_t len = charstr.length(); |
| 5881 | retval.resize_uninitialized(len); |
| 5882 | uint8_t *w = retval.ptrw(); |
| 5883 | memcpy(w, charstr.ptr(), len); |
| 5884 | |
| 5885 | return retval; |
| 5886 | } |
| 5887 | |
| 5888 | Vector<uint8_t> String::to_utf8_buffer() const { |
| 5889 | const String *s = this; |
no test coverage detected