| 41 | } |
| 42 | |
| 43 | bool ReadXmlFromBuffer( void const* pBuffer, size_t bufferSize, xml_document& outDoc, bool suppressLogging ) |
| 44 | { |
| 45 | EE_ASSERT( pBuffer != nullptr && bufferSize > 0 ); |
| 46 | |
| 47 | pugi::xml_parse_result const result = outDoc.load_buffer( pBuffer, bufferSize ); |
| 48 | |
| 49 | if ( !result && !suppressLogging ) |
| 50 | { |
| 51 | EE_LOG_ERROR( LogCategory::Serialization, "XML", "Failed to load xml from str: %s", result.description() ); |
| 52 | } |
| 53 | |
| 54 | return result; |
| 55 | } |
| 56 | |
| 57 | bool ReadXmlFromBufferInPlace( void* pBuffer, size_t bufferSize, xml_document& outDoc, bool suppressLogging ) |
| 58 | { |
| 59 | EE_ASSERT( pBuffer != nullptr && bufferSize > 0 ); |
| 60 | |
| 61 | pugi::xml_parse_result const result = outDoc.load_buffer_inplace( pBuffer, bufferSize ); |
no test coverage detected