MCPcopy Create free account
hub / github.com/MyGUI/mygui / get_mutable_buffer

Function get_mutable_buffer

Tools/EditorFramework/pugixml.cpp:1297–1322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1295}
1296
1297PUGI__FN bool get_mutable_buffer(
1298 char_t*& out_buffer,
1299 size_t& out_length,
1300 const void* contents,
1301 size_t size,
1302 bool is_mutable)
1303{
1304 if (is_mutable)
1305 {
1306 out_buffer = static_cast<char_t*>(const_cast<void*>(contents));
1307 }
1308 else
1309 {
1310 void* buffer = xml_memory::allocate(size > 0 ? size : 1);
1311 if (!buffer)
1312 return false;
1313
1314 memcpy(buffer, contents, size);
1315
1316 out_buffer = static_cast<char_t*>(buffer);
1317 }
1318
1319 out_length = size / sizeof(char_t);
1320
1321 return true;
1322}
1323
1324#ifdef PUGIXML_WCHAR_MODE
1325PUGI__FN bool need_endian_swap_utf(xml_encoding le, xml_encoding re)

Callers 2

convert_bufferFunction · 0.70
convert_buffer_latin1Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected