aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml
diff options
context:
space:
mode:
authororivej <orivej@yandex-team.ru>2022-02-10 16:44:49 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:49 +0300
commit718c552901d703c502ccbefdfc3c9028d608b947 (patch)
tree46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml
parente9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff)
downloadydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml')
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml/XmlSerializer.cpp188
1 files changed, 94 insertions, 94 deletions
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml/XmlSerializer.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml/XmlSerializer.cpp
index c06befaf9b..9c8c54c277 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml/XmlSerializer.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/xml/XmlSerializer.cpp
@@ -1,7 +1,7 @@
-/**
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0.
- */
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
+ */
#include <aws/core/utils/xml/XmlSerializer.h>
@@ -56,8 +56,8 @@ void XmlNode::SetName(const Aws::String& name)
const Aws::String XmlNode::GetAttributeValue(const Aws::String& name) const
{
- auto pointer = m_node->ToElement()->Attribute(name.c_str(), nullptr);
- return pointer ? pointer : "";
+ auto pointer = m_node->ToElement()->Attribute(name.c_str(), nullptr);
+ return pointer ? pointer : "";
}
void XmlNode::SetAttributeValue(const Aws::String& name, const Aws::String& value)
@@ -158,106 +158,106 @@ static const char* XML_SERIALIZER_ALLOCATION_TAG = "XmlDocument";
XmlDocument::XmlDocument()
{
- m_doc = nullptr;
+ m_doc = nullptr;
}
-XmlDocument::XmlDocument(const XmlDocument& doc)
-{
- if (doc.m_doc == nullptr)
- {
- m_doc = nullptr;
- }
- else
- {
- InitDoc();
- doc.m_doc->DeepCopy(m_doc);
- }
-}
-
-XmlDocument::XmlDocument(XmlDocument&& doc) : m_doc{ doc.m_doc } // take the innards
+XmlDocument::XmlDocument(const XmlDocument& doc)
+{
+ if (doc.m_doc == nullptr)
+ {
+ m_doc = nullptr;
+ }
+ else
+ {
+ InitDoc();
+ doc.m_doc->DeepCopy(m_doc);
+ }
+}
+
+XmlDocument::XmlDocument(XmlDocument&& doc) : m_doc{ doc.m_doc } // take the innards
{
doc.m_doc = nullptr; // leave nothing behind
}
-XmlDocument& XmlDocument::operator=(const XmlDocument& other)
-{
- if (this == &other)
- {
- return *this;
- }
-
- if (other.m_doc == nullptr)
- {
- if (m_doc != nullptr)
- {
- m_doc->Clear();
- m_doc = nullptr;
- }
- }
- else
- {
- if (m_doc == nullptr)
- {
- InitDoc();
- }
- else
- {
- m_doc->Clear();
- }
- other.m_doc->DeepCopy(m_doc);
- }
-
- return *this;
-}
-
-XmlDocument& XmlDocument::operator=(XmlDocument&& other)
-{
- if (this == &other)
- {
- return *this;
- }
-
- std::swap(m_doc, other.m_doc);
- return *this;
-}
-
+XmlDocument& XmlDocument::operator=(const XmlDocument& other)
+{
+ if (this == &other)
+ {
+ return *this;
+ }
+
+ if (other.m_doc == nullptr)
+ {
+ if (m_doc != nullptr)
+ {
+ m_doc->Clear();
+ m_doc = nullptr;
+ }
+ }
+ else
+ {
+ if (m_doc == nullptr)
+ {
+ InitDoc();
+ }
+ else
+ {
+ m_doc->Clear();
+ }
+ other.m_doc->DeepCopy(m_doc);
+ }
+
+ return *this;
+}
+
+XmlDocument& XmlDocument::operator=(XmlDocument&& other)
+{
+ if (this == &other)
+ {
+ return *this;
+ }
+
+ std::swap(m_doc, other.m_doc);
+ return *this;
+}
+
XmlDocument::~XmlDocument()
{
- if (m_doc)
- {
- Aws::Delete(m_doc);
- }
-}
-
-void XmlDocument::InitDoc()
-{
- m_doc = Aws::New<Aws::External::tinyxml2::XMLDocument>(XML_SERIALIZER_ALLOCATION_TAG, true, Aws::External::tinyxml2::Whitespace::PRESERVE_WHITESPACE);
+ if (m_doc)
+ {
+ Aws::Delete(m_doc);
+ }
}
+void XmlDocument::InitDoc()
+{
+ m_doc = Aws::New<Aws::External::tinyxml2::XMLDocument>(XML_SERIALIZER_ALLOCATION_TAG, true, Aws::External::tinyxml2::Whitespace::PRESERVE_WHITESPACE);
+}
+
XmlNode XmlDocument::GetRootElement() const
{
- if (m_doc)
- {
- return XmlNode(m_doc->FirstChildElement(), *this);
- }
- else
- {
- return XmlNode(nullptr, *this);
- }
-
+ if (m_doc)
+ {
+ return XmlNode(m_doc->FirstChildElement(), *this);
+ }
+ else
+ {
+ return XmlNode(nullptr, *this);
+ }
+
}
bool XmlDocument::WasParseSuccessful() const
{
- if (m_doc)
- {
- return !m_doc->Error();
- }
- else
- {
- return true;
- }
-
+ if (m_doc)
+ {
+ return !m_doc->Error();
+ }
+ else
+ {
+ return true;
+ }
+
}
Aws::String XmlDocument::GetErrorMessage() const
@@ -267,8 +267,8 @@ Aws::String XmlDocument::GetErrorMessage() const
Aws::String XmlDocument::ConvertToString() const
{
- if (!m_doc) return "";
-
+ if (!m_doc) return "";
+
Aws::External::tinyxml2::XMLPrinter printer;
printer.PushHeader(false, true);
m_doc->Accept(&printer);
@@ -285,7 +285,7 @@ XmlDocument XmlDocument::CreateFromXmlStream(Aws::IOStream& xmlStream)
XmlDocument XmlDocument::CreateFromXmlString(const Aws::String& xmlText)
{
XmlDocument xmlDocument;
- xmlDocument.InitDoc();
+ xmlDocument.InitDoc();
xmlDocument.m_doc->Parse(xmlText.c_str(), xmlText.size());
return xmlDocument;
}
@@ -293,7 +293,7 @@ XmlDocument XmlDocument::CreateFromXmlString(const Aws::String& xmlText)
XmlDocument XmlDocument::CreateWithRootNode(const Aws::String& rootNodeName)
{
XmlDocument xmlDocument;
- xmlDocument.InitDoc();
+ xmlDocument.InitDoc();
Aws::External::tinyxml2::XMLElement* rootNode = xmlDocument.m_doc->NewElement(rootNodeName.c_str());
xmlDocument.m_doc->LinkEndChild(rootNode);