MCPcopy Create free account
hub / github.com/BobbyAnguelov/Esoterica / ReadXmlFromString

Function ReadXmlFromString

Code/Base/Serialization/XmlSerialization.cpp:43–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 );

Callers 2

ReadTypeFromStringFunction · 0.85
PasteNodesMethod · 0.85

Calls 5

load_bufferMethod · 0.80
descriptionMethod · 0.80
emptyMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected