| 1157 | } |
| 1158 | |
| 1159 | PUGI__FN bool get_mutable_buffer(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, bool is_mutable) |
| 1160 | { |
| 1161 | if (is_mutable) |
| 1162 | { |
| 1163 | out_buffer = static_cast<char_t*>(const_cast<void*>(contents)); |
| 1164 | } |
| 1165 | else |
| 1166 | { |
| 1167 | void* buffer = xml_memory::allocate(size > 0 ? size : 1); |
| 1168 | if (!buffer) return false; |
| 1169 | |
| 1170 | memcpy(buffer, contents, size); |
| 1171 | |
| 1172 | out_buffer = static_cast<char_t*>(buffer); |
| 1173 | } |
| 1174 | |
| 1175 | out_length = size / sizeof(char_t); |
| 1176 | |
| 1177 | return true; |
| 1178 | } |
| 1179 | |
| 1180 | #ifdef PUGIXML_WCHAR_MODE |
| 1181 | PUGI__FN bool need_endian_swap_utf(xml_encoding le, xml_encoding re) |
no outgoing calls
no test coverage detected