| 1295 | } |
| 1296 | |
| 1297 | PUGI__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 |
| 1325 | PUGI__FN bool need_endian_swap_utf(xml_encoding le, xml_encoding re) |
no outgoing calls
no test coverage detected