| 1886 | } |
| 1887 | |
| 1888 | static void _encode_string(const String &p_string, uint8_t *&buf, int &r_len) { |
| 1889 | CharString utf8 = p_string.utf8(); |
| 1890 | |
| 1891 | if (buf) { |
| 1892 | encode_uint32(utf8.length(), buf); |
| 1893 | buf += 4; |
| 1894 | memcpy(buf, utf8.get_data(), utf8.length()); |
| 1895 | buf += utf8.length(); |
| 1896 | } |
| 1897 | |
| 1898 | r_len += 4 + utf8.length(); |
| 1899 | while (r_len % 4) { |
| 1900 | r_len++; //pad |
| 1901 | if (buf) { |
| 1902 | *(buf++) = 0; |
| 1903 | } |
| 1904 | } |
| 1905 | } |
| 1906 | |
| 1907 | Error VariantDecoderCompat::encode_variant_3(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bool p_full_objects, int p_depth) { |
| 1908 | ERR_FAIL_COND_V_MSG(p_depth > Variant::MAX_RECURSION_DEPTH, ERR_OUT_OF_MEMORY, "Potential infinite recursion detected. Bailing."); |
no test coverage detected