fix a bug in generated xml code (#3114)

This commit is contained in:
JinmingHu 2021-11-18 10:16:10 +08:00 committed by GitHub
parent 5e0f1c9ac8
commit 52adaaa057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 11 deletions

View File

@ -3035,8 +3035,8 @@ namespace Azure { namespace Storage { namespace Blobs {
{
_internal::XmlWriter writer;
GetUserDelegationKeyOptionsToXml(writer, options);
xml_body = writer.GetDocument();
writer.Write(_internal::XmlNode{_internal::XmlNodeType::End});
xml_body = writer.GetDocument();
}
Azure::Core::IO::MemoryBodyStream xml_body_stream(
reinterpret_cast<const uint8_t*>(xml_body.data()), xml_body.length());
@ -3122,8 +3122,8 @@ namespace Azure { namespace Storage { namespace Blobs {
{
_internal::XmlWriter writer;
SetServicePropertiesOptionsToXml(writer, options);
xml_body = writer.GetDocument();
writer.Write(_internal::XmlNode{_internal::XmlNodeType::End});
xml_body = writer.GetDocument();
}
Azure::Core::IO::MemoryBodyStream xml_body_stream(
reinterpret_cast<const uint8_t*>(xml_body.data()), xml_body.length());
@ -5182,8 +5182,8 @@ namespace Azure { namespace Storage { namespace Blobs {
{
_internal::XmlWriter writer;
SetBlobContainerAccessPolicyOptionsToXml(writer, options);
xml_body = writer.GetDocument();
writer.Write(_internal::XmlNode{_internal::XmlNodeType::End});
xml_body = writer.GetDocument();
}
Azure::Core::IO::MemoryBodyStream xml_body_stream(
reinterpret_cast<const uint8_t*>(xml_body.data()), xml_body.length());
@ -8246,8 +8246,8 @@ namespace Azure { namespace Storage { namespace Blobs {
{
_internal::XmlWriter writer;
SetBlobTagsOptionsToXml(writer, options);
xml_body = writer.GetDocument();
writer.Write(_internal::XmlNode{_internal::XmlNodeType::End});
xml_body = writer.GetDocument();
}
Azure::Core::IO::MemoryBodyStream xml_body_stream(
reinterpret_cast<const uint8_t*>(xml_body.data()), xml_body.length());
@ -9266,8 +9266,8 @@ namespace Azure { namespace Storage { namespace Blobs {
{
_internal::XmlWriter writer;
CommitBlockListOptionsToXml(writer, options);
xml_body = writer.GetDocument();
writer.Write(_internal::XmlNode{_internal::XmlNodeType::End});
xml_body = writer.GetDocument();
}
Azure::Core::IO::MemoryBodyStream xml_body_stream(
reinterpret_cast<const uint8_t*>(xml_body.data()), xml_body.length());

View File

@ -608,9 +608,7 @@ namespace Azure { namespace Storage { namespace _internal {
std::string XmlWriter::GetDocument()
{
auto context = static_cast<XmlWriterContext*>(m_context);
xmlTextWriterPtr writer = context->writer;
xmlBufferPtr buffer = context->buffer;
xmlTextWriterFlush(writer);
return std::string(reinterpret_cast<const char*>(buffer->content), buffer->use);
}

View File

@ -642,8 +642,8 @@ namespace Azure { namespace Storage { namespace Queues {
{
_internal::XmlWriter writer;
SetServicePropertiesOptionsToXml(writer, options);
xml_body = writer.GetDocument();
writer.Write(_internal::XmlNode{_internal::XmlNodeType::End});
xml_body = writer.GetDocument();
}
Azure::Core::IO::MemoryBodyStream xml_body_stream(
reinterpret_cast<const uint8_t*>(xml_body.data()), xml_body.length());
@ -1740,8 +1740,8 @@ namespace Azure { namespace Storage { namespace Queues {
{
_internal::XmlWriter writer;
SetQueueAccessPolicyOptionsToXml(writer, options);
xml_body = writer.GetDocument();
writer.Write(_internal::XmlNode{_internal::XmlNodeType::End});
xml_body = writer.GetDocument();
}
Azure::Core::IO::MemoryBodyStream xml_body_stream(
reinterpret_cast<const uint8_t*>(xml_body.data()), xml_body.length());
@ -1785,8 +1785,8 @@ namespace Azure { namespace Storage { namespace Queues {
{
_internal::XmlWriter writer;
EnqueueMessageOptionsToXml(writer, options);
xml_body = writer.GetDocument();
writer.Write(_internal::XmlNode{_internal::XmlNodeType::End});
xml_body = writer.GetDocument();
}
Azure::Core::IO::MemoryBodyStream xml_body_stream(
reinterpret_cast<const uint8_t*>(xml_body.data()), xml_body.length());
@ -2038,8 +2038,8 @@ namespace Azure { namespace Storage { namespace Queues {
{
_internal::XmlWriter writer;
UpdateMessageOptionsToXml(writer, options);
xml_body = writer.GetDocument();
writer.Write(_internal::XmlNode{_internal::XmlNodeType::End});
xml_body = writer.GetDocument();
}
Azure::Core::IO::MemoryBodyStream xml_body_stream(
reinterpret_cast<const uint8_t*>(xml_body.data()), xml_body.length());