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

Method open_buffer

core/io/xml_parser.cpp:464–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464Error XMLParser::open_buffer(const Vector<uint8_t> &p_buffer) {
465 ERR_FAIL_COND_V(p_buffer.is_empty(), ERR_INVALID_DATA);
466
467 if (data_copy) {
468 memdelete_arr(data_copy);
469 data_copy = nullptr;
470 }
471
472 length = p_buffer.size();
473 data_copy = memnew_arr(char, length + 1);
474 memcpy(data_copy, p_buffer.ptr(), length);
475 data_copy[length] = 0;
476 data = data_copy;
477 P = data;
478 current_line = 0;
479
480 return OK;
481}
482
483Error XMLParser::_open_buffer(const uint8_t *p_buffer, size_t p_size) {
484 ERR_FAIL_COND_V(p_size == 0, ERR_INVALID_DATA);

Callers 3

load_compressedMethod · 0.80
test_xml_parser.hFile · 0.80

Calls 4

memdelete_arrFunction · 0.85
sizeMethod · 0.65
is_emptyMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected