MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / to_ascii_buffer

Method to_ascii_buffer

core/string/ustring.cpp:5872–5886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5870#endif
5871
5872Vector<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
5888Vector<uint8_t> String::to_utf8_buffer() const {
5889 const String *s = this;

Calls 6

is_emptyMethod · 0.45
asciiMethod · 0.45
lengthMethod · 0.45
resize_uninitializedMethod · 0.45
ptrwMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected