| 3581 | } |
| 3582 | |
| 3583 | template <typename T> PUGI__FN xml_parse_result load_stream_impl(xml_document& doc, std::basic_istream<T>& stream, unsigned int options, xml_encoding encoding) |
| 3584 | { |
| 3585 | void* buffer = 0; |
| 3586 | size_t size = 0; |
| 3587 | |
| 3588 | // load stream to memory (using seek-based implementation if possible, since it's faster and takes less memory) |
| 3589 | xml_parse_status status = (stream.tellg() < 0) ? load_stream_data_noseek(stream, &buffer, &size) : load_stream_data_seek(stream, &buffer, &size); |
| 3590 | if (status != status_ok) return make_parse_result(status); |
| 3591 | |
| 3592 | return doc.load_buffer_inplace_own(buffer, size, options, encoding); |
| 3593 | } |
| 3594 | #endif |
| 3595 | |
| 3596 | #if defined(PUGI__MSVC_CRT_VERSION) || defined(__BORLANDC__) || (defined(__MINGW32__) && !defined(__STRICT_ANSI__)) |
nothing calls this directly
no test coverage detected