aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws
diff options
context:
space:
mode:
authornalpp <nalpp@yandex-team.ru>2022-02-10 16:46:46 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:46 +0300
commit30d1ef3941e0dc835be7609de5ebee66958f215a (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws
parent87f3eb38999df2d3c1cb77f8ffb9c52ec9c516fb (diff)
downloadydb-30d1ef3941e0dc835be7609de5ebee66958f215a.tar.gz
Restoring authorship annotation for <nalpp@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws')
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h92
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonStreamingWebServiceRequest.h148
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h262
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceResult.h144
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Aws.h506
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Core_EXPORTS.h62
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Globals.h62
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/NoResult.h20
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Region.h36
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/SDKConfig.h4
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Version.h30
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/VersionConfig.h2
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h510
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSignerProvider.h70
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProvider.h480
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProviderChain.h128
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h668
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSError.h208
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSErrorMarshaller.h128
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AsyncCallerContext.h110
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h280
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/CoreErrors.h114
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/DefaultRetryStrategy.h52
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/RetryStrategy.h64
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/config/AWSProfileConfigLoader.h288
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/cjson/cJSON.h552
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/tinyxml2/tinyxml2.h4554
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClient.h146
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClientFactory.h122
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpRequest.h906
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpResponse.h388
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpTypes.h104
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/Scheme.h68
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/URI.h328
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHandleContainer.h114
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h110
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpRequest.h168
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpResponse.h138
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h270
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/CoreMetrics.h46
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/DefaultMonitoring.h118
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/HttpClientMetrics.h124
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h46
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringInterface.h152
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringManager.h112
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/Net.h40
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/SimpleUDP.h256
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Android.h50
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Environment.h36
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h444
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/OSVersionInfo.h46
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Platform.h10
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Security.h40
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Time.h56
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Array.h492
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DNS.h24
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DateTime.h468
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/EnumParseOverflowContainer.h64
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/FileSystemUtils.h132
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/GetTheLights.h62
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/HashingUtils.h164
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Outcome.h208
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ResourceManager.h220
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/StringUtils.h308
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UUID.h96
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UnreferencedParam.h28
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/base64/Base64.h132
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Cipher.h378
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoMaterial.h342
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoScheme.h56
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoBuf.h288
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoStream.h152
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/EncryptionMaterials.h80
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Factories.h268
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HMAC.h128
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Hash.h138
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HashResult.h42
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/KeyWrapAlgorithm.h50
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/MD5.h122
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/SecureRandom.h224
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256.h122
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256HMAC.h110
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/openssl/CryptoImpl.h676
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/json/JsonSerializer.h754
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/AWSLogging.h92
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/ConsoleLogSystem.h72
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/DefaultLogSystem.h158
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/FormattedLogSystem.h124
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogLevel.h66
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h354
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogSystemInterface.h86
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h568
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/MemorySystemInterface.h90
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h194
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSDeque.h32
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSList.h32
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSMap.h60
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSQueue.h36
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSSet.h32
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStack.h36
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStreamFwd.h50
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSString.h198
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStringStream.h78
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSVector.h32
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/SimpleStringStream.h234
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/RateLimiterInterface.h82
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/PreallocatedStreamBuf.h96
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ResponseStream.h140
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/SimpleStreamBuf.h118
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Executor.h230
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ReaderWriterLock.h224
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Semaphore.h84
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ThreadTask.h88
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/xml/XmlSerializer.h408
114 files changed, 12217 insertions, 12217 deletions
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h
index 83babb5b72..2ba298546e 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonSerializableWebServiceRequest.h
@@ -2,55 +2,55 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/AmazonWebServiceRequest.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/UnreferencedParam.h>
-#include <aws/core/http/HttpTypes.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-
-namespace Aws
-{
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/AmazonWebServiceRequest.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/UnreferencedParam.h>
+#include <aws/core/http/HttpTypes.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+
+namespace Aws
+{
static const char JSON_CONTENT_TYPE[] = "application/json";
static const char AMZN_JSON_CONTENT_TYPE_1_0[] = "application/x-amz-json-1.0";
static const char AMZN_JSON_CONTENT_TYPE_1_1[] = "application/x-amz-json-1.1";
static const char FORM_CONTENT_TYPE[] = "application/x-www-form-urlencoded";
static const char AMZN_XML_CONTENT_TYPE[] = "application/xml";
static const char AMZN_EVENTSTREAM_CONTENT_TYPE[] = "application/vnd.amazon.eventstream";
-
- /**
- * High-level abstraction over AWS requests. GetBody() calls SerializePayload() and uses a stringbuf under the hood.
- * This is for payloads such as query, xml, or json
- */
- class AWS_CORE_API AmazonSerializableWebServiceRequest : public AmazonWebServiceRequest
- {
- public:
- AmazonSerializableWebServiceRequest()
- {
- //prevent unreferenced var warnings
- //for these values.
- AWS_UNREFERENCED_PARAM(JSON_CONTENT_TYPE);
- AWS_UNREFERENCED_PARAM(AMZN_JSON_CONTENT_TYPE_1_0);
- AWS_UNREFERENCED_PARAM(AMZN_JSON_CONTENT_TYPE_1_1);
- AWS_UNREFERENCED_PARAM(FORM_CONTENT_TYPE);
- AWS_UNREFERENCED_PARAM(AMZN_XML_CONTENT_TYPE);
- }
-
- virtual ~AmazonSerializableWebServiceRequest() {}
-
- /**
- * Convert payload into String.
- */
- virtual Aws::String SerializePayload() const = 0;
-
- /**
- * Loads serialized payload into string buf and returns the stream
- */
- std::shared_ptr<Aws::IOStream> GetBody() const override;
- };
-
-} // namespace Aws
-
+
+ /**
+ * High-level abstraction over AWS requests. GetBody() calls SerializePayload() and uses a stringbuf under the hood.
+ * This is for payloads such as query, xml, or json
+ */
+ class AWS_CORE_API AmazonSerializableWebServiceRequest : public AmazonWebServiceRequest
+ {
+ public:
+ AmazonSerializableWebServiceRequest()
+ {
+ //prevent unreferenced var warnings
+ //for these values.
+ AWS_UNREFERENCED_PARAM(JSON_CONTENT_TYPE);
+ AWS_UNREFERENCED_PARAM(AMZN_JSON_CONTENT_TYPE_1_0);
+ AWS_UNREFERENCED_PARAM(AMZN_JSON_CONTENT_TYPE_1_1);
+ AWS_UNREFERENCED_PARAM(FORM_CONTENT_TYPE);
+ AWS_UNREFERENCED_PARAM(AMZN_XML_CONTENT_TYPE);
+ }
+
+ virtual ~AmazonSerializableWebServiceRequest() {}
+
+ /**
+ * Convert payload into String.
+ */
+ virtual Aws::String SerializePayload() const = 0;
+
+ /**
+ * Loads serialized payload into string buf and returns the stream
+ */
+ std::shared_ptr<Aws::IOStream> GetBody() const override;
+ };
+
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonStreamingWebServiceRequest.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonStreamingWebServiceRequest.h
index a8261d7c38..c267d06aaf 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonStreamingWebServiceRequest.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonStreamingWebServiceRequest.h
@@ -2,82 +2,82 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-#include <aws/core/utils/UnreferencedParam.h>
-#include <aws/core/http/HttpTypes.h>
-#include <aws/core/http/HttpRequest.h>
-#include <aws/core/AmazonWebServiceRequest.h>
-
-namespace Aws
-{
- static const char* DEFAULT_CONTENT_TYPE = "binary/octet-stream";
-
- /**
- * High-level abstraction over AWS requests that don't have well formed payloads. GetBody() uses an underlying stream that has been set by a call to SetBody()
- * Also supports request specific headers such as in rest protocols.
- */
- class AWS_CORE_API AmazonStreamingWebServiceRequest : public AmazonWebServiceRequest
- {
- public:
- /**
- * Initializes members to defaults
- */
- AmazonStreamingWebServiceRequest() : m_contentType(DEFAULT_CONTENT_TYPE)
- {
- }
-
- virtual ~AmazonStreamingWebServiceRequest();
-
- /**
- * Get the user set stream
- */
- inline std::shared_ptr<Aws::IOStream> GetBody() const override { return m_bodyStream; }
- /**
- * Set the body stream to use for the request.
- */
- inline void SetBody(const std::shared_ptr<Aws::IOStream>& body) { m_bodyStream = body; }
- /**
- * Gets all headers that will be needed in the request. Calls GetRequestSpecificHeaders(), which is the chance for subclasses to add
- * headers from their modeled data.
- */
- inline Aws::Http::HeaderValueCollection GetHeaders() const override
- {
- auto headers = GetRequestSpecificHeaders();
- headers.insert(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, GetContentType()));
-
- return headers;
- }
-
- /**
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+#include <aws/core/utils/UnreferencedParam.h>
+#include <aws/core/http/HttpTypes.h>
+#include <aws/core/http/HttpRequest.h>
+#include <aws/core/AmazonWebServiceRequest.h>
+
+namespace Aws
+{
+ static const char* DEFAULT_CONTENT_TYPE = "binary/octet-stream";
+
+ /**
+ * High-level abstraction over AWS requests that don't have well formed payloads. GetBody() uses an underlying stream that has been set by a call to SetBody()
+ * Also supports request specific headers such as in rest protocols.
+ */
+ class AWS_CORE_API AmazonStreamingWebServiceRequest : public AmazonWebServiceRequest
+ {
+ public:
+ /**
+ * Initializes members to defaults
+ */
+ AmazonStreamingWebServiceRequest() : m_contentType(DEFAULT_CONTENT_TYPE)
+ {
+ }
+
+ virtual ~AmazonStreamingWebServiceRequest();
+
+ /**
+ * Get the user set stream
+ */
+ inline std::shared_ptr<Aws::IOStream> GetBody() const override { return m_bodyStream; }
+ /**
+ * Set the body stream to use for the request.
+ */
+ inline void SetBody(const std::shared_ptr<Aws::IOStream>& body) { m_bodyStream = body; }
+ /**
+ * Gets all headers that will be needed in the request. Calls GetRequestSpecificHeaders(), which is the chance for subclasses to add
+ * headers from their modeled data.
+ */
+ inline Aws::Http::HeaderValueCollection GetHeaders() const override
+ {
+ auto headers = GetRequestSpecificHeaders();
+ headers.insert(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, GetContentType()));
+
+ return headers;
+ }
+
+ /**
* AmazonStreamingWebServiceRequest always returns true.
*/
bool IsStreaming() const override { return true; }
/**
- * Get the user set contentType. Defaults to binary/octet-stream
- */
- const Aws::String& GetContentType() const { return m_contentType; }
- /**
- * Set the content type.
- */
- void SetContentType(const Aws::String& contentType) { m_contentType = contentType; }
-
- protected:
- /**
- * Override this method to put data members from a subclass into the headers collection.
- */
- virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); };
-
- private:
- std::shared_ptr<Aws::IOStream> m_bodyStream;
- Aws::String m_contentType;
- };
-
-} // namespace Aws
-
+ * Get the user set contentType. Defaults to binary/octet-stream
+ */
+ const Aws::String& GetContentType() const { return m_contentType; }
+ /**
+ * Set the content type.
+ */
+ void SetContentType(const Aws::String& contentType) { m_contentType = contentType; }
+
+ protected:
+ /**
+ * Override this method to put data members from a subclass into the headers collection.
+ */
+ virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); };
+
+ private:
+ std::shared_ptr<Aws::IOStream> m_bodyStream;
+ Aws::String m_contentType;
+ };
+
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h
index 8d6d081c3d..1fc7c0e7e0 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h
@@ -2,66 +2,66 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/UnreferencedParam.h>
-#include <aws/core/http/HttpTypes.h>
-#include <aws/core/http/HttpRequest.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-#include <aws/core/utils/stream/ResponseStream.h>
-#include <aws/core/auth/AWSAuthSigner.h>
-
-namespace Aws
-{
- namespace Http
- {
- class URI;
- } // namespace Http
-
- class AmazonWebServiceRequest;
-
- /**
- * Closure definition for handling a retry notification. This is only for if you want to be notified that a particular request is being retried.
- */
- typedef std::function<void(const AmazonWebServiceRequest&)> RequestRetryHandler;
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/UnreferencedParam.h>
+#include <aws/core/http/HttpTypes.h>
+#include <aws/core/http/HttpRequest.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+#include <aws/core/utils/stream/ResponseStream.h>
+#include <aws/core/auth/AWSAuthSigner.h>
+
+namespace Aws
+{
+ namespace Http
+ {
+ class URI;
+ } // namespace Http
+
+ class AmazonWebServiceRequest;
+
+ /**
+ * Closure definition for handling a retry notification. This is only for if you want to be notified that a particular request is being retried.
+ */
+ typedef std::function<void(const AmazonWebServiceRequest&)> RequestRetryHandler;
typedef std::function<void(const Aws::Http::HttpRequest&)> RequestSignedHandler;
-
- /**
- * Base level abstraction for all modeled AWS requests
- */
- class AWS_CORE_API AmazonWebServiceRequest
- {
- public:
- /**
- * Sets up default response stream factory. initializes other pointers to nullptr.
- */
- AmazonWebServiceRequest();
- virtual ~AmazonWebServiceRequest() = default;
-
- /**
- * Get the payload for the request
- */
- virtual std::shared_ptr<Aws::IOStream> GetBody() const = 0;
- /**
- * Get the headers for the request
- */
- virtual Aws::Http::HeaderValueCollection GetHeaders() const = 0;
- /**
- * Do nothing virtual, override this to add query strings to the request
- */
- virtual void AddQueryStringParameters(Aws::Http::URI& uri) const { AWS_UNREFERENCED_PARAM(uri); }
-
- /**
- * Put the request to a url for later presigning. This will push the body to the url and
- * then adds the existing query string parameters as normal.
- */
- virtual void PutToPresignedUrl(Aws::Http::URI& uri) const { DumpBodyToUrl(uri); AddQueryStringParameters(uri); }
-
- /**
+
+ /**
+ * Base level abstraction for all modeled AWS requests
+ */
+ class AWS_CORE_API AmazonWebServiceRequest
+ {
+ public:
+ /**
+ * Sets up default response stream factory. initializes other pointers to nullptr.
+ */
+ AmazonWebServiceRequest();
+ virtual ~AmazonWebServiceRequest() = default;
+
+ /**
+ * Get the payload for the request
+ */
+ virtual std::shared_ptr<Aws::IOStream> GetBody() const = 0;
+ /**
+ * Get the headers for the request
+ */
+ virtual Aws::Http::HeaderValueCollection GetHeaders() const = 0;
+ /**
+ * Do nothing virtual, override this to add query strings to the request
+ */
+ virtual void AddQueryStringParameters(Aws::Http::URI& uri) const { AWS_UNREFERENCED_PARAM(uri); }
+
+ /**
+ * Put the request to a url for later presigning. This will push the body to the url and
+ * then adds the existing query string parameters as normal.
+ */
+ virtual void PutToPresignedUrl(Aws::Http::URI& uri) const { DumpBodyToUrl(uri); AddQueryStringParameters(uri); }
+
+ /**
* Defaults to false, if this is set to true, it's a streaming request, which means the payload is not well structured bits.
*/
virtual bool IsStreaming() const { return false; }
@@ -71,11 +71,11 @@ namespace Aws
*/
inline virtual bool IsEventStreamRequest() const { return false; }
/**
- * Defaults to true, if this is set to false, then signers, if they support body signing, will not do so
- */
- virtual bool SignBody() const { return true; }
-
- /**
+ * Defaults to true, if this is set to false, then signers, if they support body signing, will not do so
+ */
+ virtual bool SignBody() const { return true; }
+
+ /**
* Defaults to false, if this is set to true, it supports chunked transfer encoding.
*/
virtual bool IsChunked() const { return false; }
@@ -90,84 +90,84 @@ namespace Aws
inline virtual const RequestSignedHandler& GetRequestSignedHandler() const { return m_onRequestSigned; }
/**
- * Retrieves the factory for creating response streams.
- */
- const Aws::IOStreamFactory& GetResponseStreamFactory() const { return m_responseStreamFactory; }
- /**
- * Set the response stream factory.
- */
- void SetResponseStreamFactory(const Aws::IOStreamFactory& factory) { m_responseStreamFactory = factory; }
- /**
+ * Retrieves the factory for creating response streams.
+ */
+ const Aws::IOStreamFactory& GetResponseStreamFactory() const { return m_responseStreamFactory; }
+ /**
+ * Set the response stream factory.
+ */
+ void SetResponseStreamFactory(const Aws::IOStreamFactory& factory) { m_responseStreamFactory = factory; }
+ /**
* Register closure for data received event.
- */
- inline virtual void SetDataReceivedEventHandler(const Aws::Http::DataReceivedEventHandler& dataReceivedEventHandler) { m_onDataReceived = dataReceivedEventHandler; }
- /**
- * register closure for data sent event
- */
- inline virtual void SetDataSentEventHandler(const Aws::Http::DataSentEventHandler& dataSentEventHandler) { m_onDataSent = dataSentEventHandler; }
- /**
- * Register closure for handling whether or not to continue a request.
- */
- inline virtual void SetContinueRequestHandler(const Aws::Http::ContinueRequestHandler& continueRequestHandler) { m_continueRequest = continueRequestHandler; }
- /**
+ */
+ inline virtual void SetDataReceivedEventHandler(const Aws::Http::DataReceivedEventHandler& dataReceivedEventHandler) { m_onDataReceived = dataReceivedEventHandler; }
+ /**
+ * register closure for data sent event
+ */
+ inline virtual void SetDataSentEventHandler(const Aws::Http::DataSentEventHandler& dataSentEventHandler) { m_onDataSent = dataSentEventHandler; }
+ /**
+ * Register closure for handling whether or not to continue a request.
+ */
+ inline virtual void SetContinueRequestHandler(const Aws::Http::ContinueRequestHandler& continueRequestHandler) { m_continueRequest = continueRequestHandler; }
+ /**
* Register closure for data received event.
*/
- inline virtual void SetDataReceivedEventHandler(Aws::Http::DataReceivedEventHandler&& dataReceivedEventHandler) { m_onDataReceived = std::move(dataReceivedEventHandler); }
- /**
+ inline virtual void SetDataReceivedEventHandler(Aws::Http::DataReceivedEventHandler&& dataReceivedEventHandler) { m_onDataReceived = std::move(dataReceivedEventHandler); }
+ /**
* register closure for data sent event
*/
- inline virtual void SetDataSentEventHandler(Aws::Http::DataSentEventHandler&& dataSentEventHandler) { m_onDataSent = std::move(dataSentEventHandler); }
- /**
- * Register closure for handling whether or not to cancel a request.
- */
- inline virtual void SetContinueRequestHandler(Aws::Http::ContinueRequestHandler&& continueRequestHandler) { m_continueRequest = std::move(continueRequestHandler); }
- /**
+ inline virtual void SetDataSentEventHandler(Aws::Http::DataSentEventHandler&& dataSentEventHandler) { m_onDataSent = std::move(dataSentEventHandler); }
+ /**
+ * Register closure for handling whether or not to cancel a request.
+ */
+ inline virtual void SetContinueRequestHandler(Aws::Http::ContinueRequestHandler&& continueRequestHandler) { m_continueRequest = std::move(continueRequestHandler); }
+ /**
* Register closure for notification that a request is being retried
*/
- inline virtual void SetRequestRetryHandler(const RequestRetryHandler& handler) { m_requestRetryHandler = handler; }
- /**
+ inline virtual void SetRequestRetryHandler(const RequestRetryHandler& handler) { m_requestRetryHandler = handler; }
+ /**
* Register closure for notification that a request is being retried
*/
- inline virtual void SetRequestRetryHandler(RequestRetryHandler&& handler) { m_requestRetryHandler = std::move(handler); }
- /**
+ inline virtual void SetRequestRetryHandler(RequestRetryHandler&& handler) { m_requestRetryHandler = std::move(handler); }
+ /**
* get closure for data received event.
*/
- inline virtual const Aws::Http::DataReceivedEventHandler& GetDataReceivedEventHandler() const { return m_onDataReceived; }
- /**
+ inline virtual const Aws::Http::DataReceivedEventHandler& GetDataReceivedEventHandler() const { return m_onDataReceived; }
+ /**
* get closure for data sent event
*/
- inline virtual const Aws::Http::DataSentEventHandler& GetDataSentEventHandler() const { return m_onDataSent; }
- /**
- * get closure for handling whether or not to cancel a request.
- */
- inline virtual const Aws::Http::ContinueRequestHandler& GetContinueRequestHandler() const { return m_continueRequest; }
- /**
- * get closure for notification that a request is being retried
- */
- inline virtual const RequestRetryHandler& GetRequestRetryHandler() const { return m_requestRetryHandler; }
- /**
- * If this is set to true, content-md5 needs to be computed and set on the request
- */
- inline virtual bool ShouldComputeContentMd5() const { return false; }
-
- virtual const char* GetServiceRequestName() const = 0;
-
- protected:
- /**
- * Default does nothing. Override this to convert what would otherwise be the payload of the
- * request to a query string format.
- */
- virtual void DumpBodyToUrl(Aws::Http::URI& uri) const { AWS_UNREFERENCED_PARAM(uri); }
-
- private:
- Aws::IOStreamFactory m_responseStreamFactory;
-
- Aws::Http::DataReceivedEventHandler m_onDataReceived;
- Aws::Http::DataSentEventHandler m_onDataSent;
- Aws::Http::ContinueRequestHandler m_continueRequest;
+ inline virtual const Aws::Http::DataSentEventHandler& GetDataSentEventHandler() const { return m_onDataSent; }
+ /**
+ * get closure for handling whether or not to cancel a request.
+ */
+ inline virtual const Aws::Http::ContinueRequestHandler& GetContinueRequestHandler() const { return m_continueRequest; }
+ /**
+ * get closure for notification that a request is being retried
+ */
+ inline virtual const RequestRetryHandler& GetRequestRetryHandler() const { return m_requestRetryHandler; }
+ /**
+ * If this is set to true, content-md5 needs to be computed and set on the request
+ */
+ inline virtual bool ShouldComputeContentMd5() const { return false; }
+
+ virtual const char* GetServiceRequestName() const = 0;
+
+ protected:
+ /**
+ * Default does nothing. Override this to convert what would otherwise be the payload of the
+ * request to a query string format.
+ */
+ virtual void DumpBodyToUrl(Aws::Http::URI& uri) const { AWS_UNREFERENCED_PARAM(uri); }
+
+ private:
+ Aws::IOStreamFactory m_responseStreamFactory;
+
+ Aws::Http::DataReceivedEventHandler m_onDataReceived;
+ Aws::Http::DataSentEventHandler m_onDataSent;
+ Aws::Http::ContinueRequestHandler m_continueRequest;
RequestSignedHandler m_onRequestSigned;
- RequestRetryHandler m_requestRetryHandler;
- };
-
-} // namespace Aws
-
+ RequestRetryHandler m_requestRetryHandler;
+ };
+
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceResult.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceResult.h
index 1b344b7dc5..cde25d80f6 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceResult.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceResult.h
@@ -2,76 +2,76 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/http/HttpTypes.h>
-#include <utility>
-#include <aws/core/http/HttpResponse.h>
-
-namespace Aws
-{
- /**
- * Container for web response to an AWS Request.
- */
- template <typename PAYLOAD_TYPE>
- class AmazonWebServiceResult
- {
- public:
+
+#pragma once
+
+#include <aws/core/http/HttpTypes.h>
+#include <utility>
+#include <aws/core/http/HttpResponse.h>
+
+namespace Aws
+{
+ /**
+ * Container for web response to an AWS Request.
+ */
+ template <typename PAYLOAD_TYPE>
+ class AmazonWebServiceResult
+ {
+ public:
AmazonWebServiceResult() : m_responseCode(Http::HttpResponseCode::REQUEST_NOT_MADE) {}
-
- /**
- * Sets payload, header collection and a response code.
- */
- AmazonWebServiceResult(const PAYLOAD_TYPE& payload, const Http::HeaderValueCollection& headers, Http::HttpResponseCode responseCode = Http::HttpResponseCode::OK) :
- m_payload(payload),
- m_responseHeaders(headers),
- m_responseCode(responseCode)
- {}
-
- /**
- * Sets payload, header collection and a response code, but transfers ownership of payload and headers (for move only operations).
- */
- AmazonWebServiceResult(PAYLOAD_TYPE&& payload, Http::HeaderValueCollection&& headers, Http::HttpResponseCode responseCode = Http::HttpResponseCode::OK) :
- m_payload(std::forward<PAYLOAD_TYPE>(payload)),
- m_responseHeaders(std::forward<Http::HeaderValueCollection>(headers)),
- m_responseCode(responseCode)
- {}
-
- AmazonWebServiceResult(const AmazonWebServiceResult& result) :
- m_payload(result.m_payload),
- m_responseHeaders(result.m_responseHeaders),
- m_responseCode(result.m_responseCode)
- {}
-
- AmazonWebServiceResult(AmazonWebServiceResult&& result) :
- m_payload(std::move(result.m_payload)),
- m_responseHeaders(std::move(result.m_responseHeaders)),
- m_responseCode(result.m_responseCode)
- {}
-
- /**
- * Get the payload from the response
- */
- inline const PAYLOAD_TYPE& GetPayload() const { return m_payload; }
- /**
- * Get the payload from the response and take ownership of it.
- */
- inline PAYLOAD_TYPE TakeOwnershipOfPayload() { return std::move(m_payload); }
- /**
- * Get the headers from the response
- */
- inline const Http::HeaderValueCollection& GetHeaderValueCollection() const { return m_responseHeaders; }
- /**
- * Get the http response code from the response
- */
- inline Http::HttpResponseCode GetResponseCode() const { return m_responseCode; }
-
- private:
- PAYLOAD_TYPE m_payload;
- Http::HeaderValueCollection m_responseHeaders;
- Http::HttpResponseCode m_responseCode;
- };
-
-
-}
+
+ /**
+ * Sets payload, header collection and a response code.
+ */
+ AmazonWebServiceResult(const PAYLOAD_TYPE& payload, const Http::HeaderValueCollection& headers, Http::HttpResponseCode responseCode = Http::HttpResponseCode::OK) :
+ m_payload(payload),
+ m_responseHeaders(headers),
+ m_responseCode(responseCode)
+ {}
+
+ /**
+ * Sets payload, header collection and a response code, but transfers ownership of payload and headers (for move only operations).
+ */
+ AmazonWebServiceResult(PAYLOAD_TYPE&& payload, Http::HeaderValueCollection&& headers, Http::HttpResponseCode responseCode = Http::HttpResponseCode::OK) :
+ m_payload(std::forward<PAYLOAD_TYPE>(payload)),
+ m_responseHeaders(std::forward<Http::HeaderValueCollection>(headers)),
+ m_responseCode(responseCode)
+ {}
+
+ AmazonWebServiceResult(const AmazonWebServiceResult& result) :
+ m_payload(result.m_payload),
+ m_responseHeaders(result.m_responseHeaders),
+ m_responseCode(result.m_responseCode)
+ {}
+
+ AmazonWebServiceResult(AmazonWebServiceResult&& result) :
+ m_payload(std::move(result.m_payload)),
+ m_responseHeaders(std::move(result.m_responseHeaders)),
+ m_responseCode(result.m_responseCode)
+ {}
+
+ /**
+ * Get the payload from the response
+ */
+ inline const PAYLOAD_TYPE& GetPayload() const { return m_payload; }
+ /**
+ * Get the payload from the response and take ownership of it.
+ */
+ inline PAYLOAD_TYPE TakeOwnershipOfPayload() { return std::move(m_payload); }
+ /**
+ * Get the headers from the response
+ */
+ inline const Http::HeaderValueCollection& GetHeaderValueCollection() const { return m_responseHeaders; }
+ /**
+ * Get the http response code from the response
+ */
+ inline Http::HttpResponseCode GetResponseCode() const { return m_responseCode; }
+
+ private:
+ PAYLOAD_TYPE m_payload;
+ Http::HeaderValueCollection m_responseHeaders;
+ Http::HttpResponseCode m_responseCode;
+ };
+
+
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Aws.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Aws.h
index 693421bf17..4fcdb17779 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Aws.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Aws.h
@@ -2,261 +2,261 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-
-#include <aws/core/utils/logging/LogLevel.h>
-#include <aws/core/utils/logging/LogSystemInterface.h>
-#include <aws/core/utils/memory/MemorySystemInterface.h>
-#include <aws/core/utils/crypto/Factories.h>
-#include <aws/core/http/HttpClientFactory.h>
-#include <aws/core/monitoring/MonitoringManager.h>
-#include <aws/core/Core_EXPORTS.h>
-
-namespace Aws
-{
- static const char* DEFAULT_LOG_PREFIX = "aws_sdk_";
-
- /**
- * SDK wide options for logging
- */
- struct LoggingOptions
- {
- LoggingOptions() : logLevel(Aws::Utils::Logging::LogLevel::Off), defaultLogPrefix(DEFAULT_LOG_PREFIX)
- { }
-
- /**
- * Defaults to Off, if this is set to something else, then logging will be turned on and logLevel will be passed to the logger
- */
- Aws::Utils::Logging::LogLevel logLevel;
-
- /**
- * Defaults to aws_sdk_. This will only be used if the default logger is used.
- */
- const char* defaultLogPrefix;
-
- /**
- * Defaults to empty, if logLevel has been set and this field is empty, then the default log interface will be used.
- * otherwise, we will call this closure to create a logger
- */
- std::function<std::shared_ptr<Aws::Utils::Logging::LogSystemInterface>()> logger_create_fn;
- };
-
- /**
- * SDK wide options for memory management
- */
- struct MemoryManagementOptions
- {
- MemoryManagementOptions() : memoryManager(nullptr)
- { }
-
- /**
- * Defaults to nullptr. If custom memory management is being used and this hasn't been set then the default memory
- * manager will be used. If this has been set and custom memory management has been turned on, then this will be installed
- * at startup time.
- */
- Aws::Utils::Memory::MemorySystemInterface* memoryManager;
- };
-
- /**
- * SDK wide options for http
- */
- struct HttpOptions
- {
- HttpOptions() : initAndCleanupCurl(true), installSigPipeHandler(false)
- { }
-
- /**
- * Defaults to empty, if this is set, then the result of your closure will be installed and used instead of the system defaults
- */
- std::function<std::shared_ptr<Aws::Http::HttpClientFactory>()> httpClientFactory_create_fn;
- /**
- * libCurl infects everything with its global state. If it is being used then we automatically initialize and clean it up.
- * If this is a problem for you, set this to false. If you manually initialize libcurl please add the option CURL_GLOBAL_ALL to your init call.
- */
- bool initAndCleanupCurl;
- /**
- * Installs a global SIGPIPE handler that logs the error and prevents it from terminating the current process.
+#pragma once
+
+#include <aws/core/utils/logging/LogLevel.h>
+#include <aws/core/utils/logging/LogSystemInterface.h>
+#include <aws/core/utils/memory/MemorySystemInterface.h>
+#include <aws/core/utils/crypto/Factories.h>
+#include <aws/core/http/HttpClientFactory.h>
+#include <aws/core/monitoring/MonitoringManager.h>
+#include <aws/core/Core_EXPORTS.h>
+
+namespace Aws
+{
+ static const char* DEFAULT_LOG_PREFIX = "aws_sdk_";
+
+ /**
+ * SDK wide options for logging
+ */
+ struct LoggingOptions
+ {
+ LoggingOptions() : logLevel(Aws::Utils::Logging::LogLevel::Off), defaultLogPrefix(DEFAULT_LOG_PREFIX)
+ { }
+
+ /**
+ * Defaults to Off, if this is set to something else, then logging will be turned on and logLevel will be passed to the logger
+ */
+ Aws::Utils::Logging::LogLevel logLevel;
+
+ /**
+ * Defaults to aws_sdk_. This will only be used if the default logger is used.
+ */
+ const char* defaultLogPrefix;
+
+ /**
+ * Defaults to empty, if logLevel has been set and this field is empty, then the default log interface will be used.
+ * otherwise, we will call this closure to create a logger
+ */
+ std::function<std::shared_ptr<Aws::Utils::Logging::LogSystemInterface>()> logger_create_fn;
+ };
+
+ /**
+ * SDK wide options for memory management
+ */
+ struct MemoryManagementOptions
+ {
+ MemoryManagementOptions() : memoryManager(nullptr)
+ { }
+
+ /**
+ * Defaults to nullptr. If custom memory management is being used and this hasn't been set then the default memory
+ * manager will be used. If this has been set and custom memory management has been turned on, then this will be installed
+ * at startup time.
+ */
+ Aws::Utils::Memory::MemorySystemInterface* memoryManager;
+ };
+
+ /**
+ * SDK wide options for http
+ */
+ struct HttpOptions
+ {
+ HttpOptions() : initAndCleanupCurl(true), installSigPipeHandler(false)
+ { }
+
+ /**
+ * Defaults to empty, if this is set, then the result of your closure will be installed and used instead of the system defaults
+ */
+ std::function<std::shared_ptr<Aws::Http::HttpClientFactory>()> httpClientFactory_create_fn;
+ /**
+ * libCurl infects everything with its global state. If it is being used then we automatically initialize and clean it up.
+ * If this is a problem for you, set this to false. If you manually initialize libcurl please add the option CURL_GLOBAL_ALL to your init call.
+ */
+ bool initAndCleanupCurl;
+ /**
+ * Installs a global SIGPIPE handler that logs the error and prevents it from terminating the current process.
* This can be used on operating systems on which CURL is being used. In some situations CURL cannot avoid
- * triggering a SIGPIPE.
- * For more information see: https://curl.haxx.se/libcurl/c/CURLOPT_NOSIGNAL.html
- * NOTE: CURLOPT_NOSIGNAL is already being set.
- */
- bool installSigPipeHandler;
- };
-
- /**
- * SDK wide options for crypto
- */
- struct CryptoOptions
- {
- CryptoOptions() : initAndCleanupOpenSSL(true)
- { }
-
- /**
- * If set, this closure will be used to create and install the factory.
- */
- std::function<std::shared_ptr<Aws::Utils::Crypto::HashFactory>()> md5Factory_create_fn;
- /**
- * If set, this closure will be used to create and install the factory.
- */
- std::function<std::shared_ptr<Aws::Utils::Crypto::HashFactory>()> sha256Factory_create_fn;
- /**
- * If set, this closure will be used to create and install the factory.
- */
- std::function<std::shared_ptr<Aws::Utils::Crypto::HMACFactory>()> sha256HMACFactory_create_fn;
- /**
- * If set, this closure will be used to create and install the factory.
- */
- std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_CBCFactory_create_fn;
- /**
- * If set, this closure will be used to create and install the factory.
- */
- std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_CTRFactory_create_fn;
- /**
- * If set, this closure will be used to create and install the factory.
- */
- std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_GCMFactory_create_fn;
- /**
- * If set, this closure will be used to create and install the factory.
- */
- std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_KeyWrapFactory_create_fn;
- /**
- * If set, this closure will be used to create and install the factory.
- */
- std::function<std::shared_ptr<Aws::Utils::Crypto::SecureRandomFactory>()> secureRandomFactory_create_fn;
- /**
- * OpenSSL infects everything with its global state. If it is being used then we automatically initialize and clean it up.
+ * triggering a SIGPIPE.
+ * For more information see: https://curl.haxx.se/libcurl/c/CURLOPT_NOSIGNAL.html
+ * NOTE: CURLOPT_NOSIGNAL is already being set.
+ */
+ bool installSigPipeHandler;
+ };
+
+ /**
+ * SDK wide options for crypto
+ */
+ struct CryptoOptions
+ {
+ CryptoOptions() : initAndCleanupOpenSSL(true)
+ { }
+
+ /**
+ * If set, this closure will be used to create and install the factory.
+ */
+ std::function<std::shared_ptr<Aws::Utils::Crypto::HashFactory>()> md5Factory_create_fn;
+ /**
+ * If set, this closure will be used to create and install the factory.
+ */
+ std::function<std::shared_ptr<Aws::Utils::Crypto::HashFactory>()> sha256Factory_create_fn;
+ /**
+ * If set, this closure will be used to create and install the factory.
+ */
+ std::function<std::shared_ptr<Aws::Utils::Crypto::HMACFactory>()> sha256HMACFactory_create_fn;
+ /**
+ * If set, this closure will be used to create and install the factory.
+ */
+ std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_CBCFactory_create_fn;
+ /**
+ * If set, this closure will be used to create and install the factory.
+ */
+ std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_CTRFactory_create_fn;
+ /**
+ * If set, this closure will be used to create and install the factory.
+ */
+ std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_GCMFactory_create_fn;
+ /**
+ * If set, this closure will be used to create and install the factory.
+ */
+ std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_KeyWrapFactory_create_fn;
+ /**
+ * If set, this closure will be used to create and install the factory.
+ */
+ std::function<std::shared_ptr<Aws::Utils::Crypto::SecureRandomFactory>()> secureRandomFactory_create_fn;
+ /**
+ * OpenSSL infects everything with its global state. If it is being used then we automatically initialize and clean it up.
* If this is a problem for you, set this to false. Be aware that if you don't use our init and cleanup and you are using
- * crypto functionality, you are responsible for installing thread locking, and loading strings and error messages.
- */
- bool initAndCleanupOpenSSL;
- };
-
- /**
+ * crypto functionality, you are responsible for installing thread locking, and loading strings and error messages.
+ */
+ bool initAndCleanupOpenSSL;
+ };
+
+ /**
* MonitoringOptions is used to set up monitoring functionalities globally and(or) for users to customize monitoring listeners.
- */
- struct MonitoringOptions
- {
- /**
+ */
+ struct MonitoringOptions
+ {
+ /**
* These factory functions will be used to try to create customized monitoring listener factories, then be used to create monitoring listener instances.
- * Based on functions and factory's implementation, it may fail to create an instance.
- * If a function failed to create factory or a created factory failed to create an instance, SDK just ignore it.
- * By default, SDK will try to create a default Client Side Monitoring Listener.
- */
- std::vector<Aws::Monitoring::MonitoringFactoryCreateFunction> customizedMonitoringFactory_create_fn;
- };
-
-
- /**
- * You may notice that instead of taking pointers directly to your factories, we take a closure. This is because
- * if you have installed custom memory management, the allocation for your factories needs to happen after
- * the memory system has been initialized and shutdown needs to happen prior to the memory management being shutdown.
- *
- * Common Recipes:
- *
- * Just use defaults:
- *
- * SDKOptions options;
- * Aws::InitAPI(options);
- * .....
- * Aws::ShutdownAPI(options);
- *
- * Turn logging on using the default logger:
- *
- * SDKOptions options;
- * options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Info;
- * Aws::InitAPI(options);
- * .....
- * Aws::ShutdownAPI(options);
- *
- * Install custom memory manager:
- *
- * MyMemoryManager memoryManager;
- *
- * SDKOptions options;
- * options.memoryManagementOptions.memoryManager = &memoryManager;
- * Aws::InitAPI(options);
- * .....
- * Aws::ShutdownAPI(options);
- *
- * Override default http client factory
- *
- * SDKOptions options;
- * options.httpOptions.httpClientFactory_create_fn = [](){ return Aws::MakeShared<MyCustomHttpClientFactory>("ALLOC_TAG", arg1); };
- * Aws::InitAPI(options);
- * .....
- * Aws::ShutdownAPI(options);
- */
- struct SDKOptions
- {
- /**
- * SDK wide options for logging
- */
- LoggingOptions loggingOptions;
- /**
- * SDK wide options for memory management
- */
- MemoryManagementOptions memoryManagementOptions;
- /**
- * SDK wide options for http
- */
- HttpOptions httpOptions;
- /**
- * SDK wide options for crypto
- */
- CryptoOptions cryptoOptions;
-
- /**
- * Options used to set up customized monitoring implementations
+ * Based on functions and factory's implementation, it may fail to create an instance.
+ * If a function failed to create factory or a created factory failed to create an instance, SDK just ignore it.
+ * By default, SDK will try to create a default Client Side Monitoring Listener.
+ */
+ std::vector<Aws::Monitoring::MonitoringFactoryCreateFunction> customizedMonitoringFactory_create_fn;
+ };
+
+
+ /**
+ * You may notice that instead of taking pointers directly to your factories, we take a closure. This is because
+ * if you have installed custom memory management, the allocation for your factories needs to happen after
+ * the memory system has been initialized and shutdown needs to happen prior to the memory management being shutdown.
+ *
+ * Common Recipes:
+ *
+ * Just use defaults:
+ *
+ * SDKOptions options;
+ * Aws::InitAPI(options);
+ * .....
+ * Aws::ShutdownAPI(options);
+ *
+ * Turn logging on using the default logger:
+ *
+ * SDKOptions options;
+ * options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Info;
+ * Aws::InitAPI(options);
+ * .....
+ * Aws::ShutdownAPI(options);
+ *
+ * Install custom memory manager:
+ *
+ * MyMemoryManager memoryManager;
+ *
+ * SDKOptions options;
+ * options.memoryManagementOptions.memoryManager = &memoryManager;
+ * Aws::InitAPI(options);
+ * .....
+ * Aws::ShutdownAPI(options);
+ *
+ * Override default http client factory
+ *
+ * SDKOptions options;
+ * options.httpOptions.httpClientFactory_create_fn = [](){ return Aws::MakeShared<MyCustomHttpClientFactory>("ALLOC_TAG", arg1); };
+ * Aws::InitAPI(options);
+ * .....
+ * Aws::ShutdownAPI(options);
+ */
+ struct SDKOptions
+ {
+ /**
+ * SDK wide options for logging
+ */
+ LoggingOptions loggingOptions;
+ /**
+ * SDK wide options for memory management
+ */
+ MemoryManagementOptions memoryManagementOptions;
+ /**
+ * SDK wide options for http
+ */
+ HttpOptions httpOptions;
+ /**
+ * SDK wide options for crypto
+ */
+ CryptoOptions cryptoOptions;
+
+ /**
+ * Options used to set up customized monitoring implementations
* Put your monitoring factory in a closure (a create factory function) and put all closures in a vector.
- * Basic usage can be found in aws-cpp-sdk-core-tests/monitoring/MonitoringTest.cpp
- */
- MonitoringOptions monitoringOptions;
- };
-
- /*
- * Initialize SDK wide state for the SDK. This method must be called before doing anything else with this library.
- *
- * Common Recipes:
- *
- * Just use defaults:
- *
- * SDKOptions options;
- * Aws::InitAPI(options);
- * .....
- * Aws::ShutdownAPI(options);
- *
- * Turn logging on using the default logger:
- *
- * SDKOptions options;
- * options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Info;
- * Aws::InitAPI(options);
- * .....
- * Aws::ShutdownAPI(options);
- *
- * Install custom memory manager:
- *
- * MyMemoryManager memoryManager;
- *
- * SDKOptions options;
- * options.memoryManagementOptions.memoryManager = &memoryManager;
- * Aws::InitAPI(options);
- * .....
- * Aws::ShutdownAPI(options);
- *
- * Override default http client factory
- *
- * SDKOptions options;
- * options.httpOptions.httpClientFactory_create_fn = [](){ return Aws::MakeShared<MyCustomHttpClientFactory>("ALLOC_TAG", arg1); };
- * Aws::InitAPI(options);
- * .....
- * Aws::ShutdownAPI(options);
- */
- AWS_CORE_API void InitAPI(const SDKOptions& options);
-
- /**
- * Shutdown SDK wide state for the SDK. This method must be called when you are finished using the SDK.
- * Do not call any other SDK methods after calling ShutdownAPI.
- */
- AWS_CORE_API void ShutdownAPI(const SDKOptions& options);
-}
+ * Basic usage can be found in aws-cpp-sdk-core-tests/monitoring/MonitoringTest.cpp
+ */
+ MonitoringOptions monitoringOptions;
+ };
+
+ /*
+ * Initialize SDK wide state for the SDK. This method must be called before doing anything else with this library.
+ *
+ * Common Recipes:
+ *
+ * Just use defaults:
+ *
+ * SDKOptions options;
+ * Aws::InitAPI(options);
+ * .....
+ * Aws::ShutdownAPI(options);
+ *
+ * Turn logging on using the default logger:
+ *
+ * SDKOptions options;
+ * options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Info;
+ * Aws::InitAPI(options);
+ * .....
+ * Aws::ShutdownAPI(options);
+ *
+ * Install custom memory manager:
+ *
+ * MyMemoryManager memoryManager;
+ *
+ * SDKOptions options;
+ * options.memoryManagementOptions.memoryManager = &memoryManager;
+ * Aws::InitAPI(options);
+ * .....
+ * Aws::ShutdownAPI(options);
+ *
+ * Override default http client factory
+ *
+ * SDKOptions options;
+ * options.httpOptions.httpClientFactory_create_fn = [](){ return Aws::MakeShared<MyCustomHttpClientFactory>("ALLOC_TAG", arg1); };
+ * Aws::InitAPI(options);
+ * .....
+ * Aws::ShutdownAPI(options);
+ */
+ AWS_CORE_API void InitAPI(const SDKOptions& options);
+
+ /**
+ * Shutdown SDK wide state for the SDK. This method must be called when you are finished using the SDK.
+ * Do not call any other SDK methods after calling ShutdownAPI.
+ */
+ AWS_CORE_API void ShutdownAPI(const SDKOptions& options);
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Core_EXPORTS.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Core_EXPORTS.h
index f7a40fbda9..12e9dfc9be 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Core_EXPORTS.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Core_EXPORTS.h
@@ -2,29 +2,29 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/SDKConfig.h>
-
+
+#pragma once
+
+#include <aws/core/SDKConfig.h>
+
#if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
- #ifdef _MSC_VER
- #pragma warning(disable : 4251)
- #endif // _MSC_VER
-
- #ifdef USE_IMPORT_EXPORT
- #ifdef AWS_CORE_EXPORTS
- #define AWS_CORE_API __declspec(dllexport)
- #else // AWS_CORE_EXPORTS
- #define AWS_CORE_API __declspec(dllimport)
- #endif // AWS_CORE_EXPORTS
- #else // USE_IMPORT_EXPORT
- #define AWS_CORE_API
- #endif // USE_IMPORT_EXPORT
+ #ifdef _MSC_VER
+ #pragma warning(disable : 4251)
+ #endif // _MSC_VER
+
+ #ifdef USE_IMPORT_EXPORT
+ #ifdef AWS_CORE_EXPORTS
+ #define AWS_CORE_API __declspec(dllexport)
+ #else // AWS_CORE_EXPORTS
+ #define AWS_CORE_API __declspec(dllimport)
+ #endif // AWS_CORE_EXPORTS
+ #else // USE_IMPORT_EXPORT
+ #define AWS_CORE_API
+ #endif // USE_IMPORT_EXPORT
#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
- #define AWS_CORE_API
+ #define AWS_CORE_API
#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
-
+
#ifdef _MSC_VER
#define AWS_SUPPRESS_WARNING_PUSH(W) \
__pragma(warning(push)) \
@@ -89,15 +89,15 @@
// Update: When deprecating a function/components, we won't remove the existing tests
// immediately, so we need AWS_DISABLE_DEPRECATION as well.
#if defined(AWS_DISABLE_DEPRECATION)
- #define AWS_DEPRECATED(msg)
-#elif defined (__cplusplus) && __cplusplus > 201103L // standard attributes are available since C++14
- #define AWS_DEPRECATED(msg) [[deprecated(msg)]]
-#else
- #ifdef _MSC_VER
- #define AWS_DEPRECATED(msg) __declspec(deprecated(msg))
+ #define AWS_DEPRECATED(msg)
+#elif defined (__cplusplus) && __cplusplus > 201103L // standard attributes are available since C++14
+ #define AWS_DEPRECATED(msg) [[deprecated(msg)]]
+#else
+ #ifdef _MSC_VER
+ #define AWS_DEPRECATED(msg) __declspec(deprecated(msg))
#elif defined (__clang__) || defined (__GNUC__)
- #define AWS_DEPRECATED(msg) __attribute__((deprecated(msg)))
- #else
- #define AWS_DEPRECATED(msg)
- #endif
-#endif
+ #define AWS_DEPRECATED(msg) __attribute__((deprecated(msg)))
+ #else
+ #define AWS_DEPRECATED(msg)
+ #endif
+#endif
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Globals.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Globals.h
index 65d372be45..cebe4891b7 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Globals.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Globals.h
@@ -2,34 +2,34 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-namespace Aws
-{
- namespace Utils
- {
- class EnumParseOverflowContainer;
- }
- /**
- * This is used to handle the Enum round tripping problem
- * for when a service updates their enumerations, but the user does not
- * have an up to date client. This container will be initialized during Aws::InitAPI
- * and will be cleaned on Aws::ShutdownAPI.
- */
- AWS_CORE_API Utils::EnumParseOverflowContainer* GetEnumOverflowContainer();
-
- /**
- * Initializes a global overflow container to a new instance.
- * This should only be called once from within Aws::InitAPI
- */
- void InitializeEnumOverflowContainer();
-
- /**
- * Destroys the global overflow container instance.
- * This should only be called once from within Aws::ShutdownAPI
- */
- void CleanupEnumOverflowContainer();
-}
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ class EnumParseOverflowContainer;
+ }
+ /**
+ * This is used to handle the Enum round tripping problem
+ * for when a service updates their enumerations, but the user does not
+ * have an up to date client. This container will be initialized during Aws::InitAPI
+ * and will be cleaned on Aws::ShutdownAPI.
+ */
+ AWS_CORE_API Utils::EnumParseOverflowContainer* GetEnumOverflowContainer();
+
+ /**
+ * Initializes a global overflow container to a new instance.
+ * This should only be called once from within Aws::InitAPI
+ */
+ void InitializeEnumOverflowContainer();
+
+ /**
+ * Destroys the global overflow container instance.
+ * This should only be called once from within Aws::ShutdownAPI
+ */
+ void CleanupEnumOverflowContainer();
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/NoResult.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/NoResult.h
index 9e49f1bdaa..c4f233cbb9 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/NoResult.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/NoResult.h
@@ -2,13 +2,13 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-namespace Aws
-{
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+namespace Aws
+{
namespace Utils
{
namespace Xml
@@ -20,7 +20,7 @@ namespace Json
class JsonValue;
}
} // namespace Utils
-
+
class AWS_CORE_API NoResult
{
public:
@@ -28,5 +28,5 @@ public:
NoResult(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>&) {};
NoResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>&) {};
};
-
-} // namespace Aws
+
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Region.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Region.h
index b71377666c..a728c829ed 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Region.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Region.h
@@ -2,20 +2,20 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- /**
- * AWS Regions
- */
- namespace Region
- {
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ /**
+ * AWS Regions
+ */
+ namespace Region
+ {
// AWS_GLOBAL is a pseudo region that can be used to tell SDK to use the service global endpoint if there is any.
// You can specify this region to corresponding environment variable, config file item and in your code.
// For services without global region, the request will be directed to us-east-1
@@ -47,7 +47,7 @@ namespace Aws
// If a pseudo region, for example, aws-global or us-east-1-fips is provided, it should be converted to the region name used for signing.
Aws::String AWS_CORE_API ComputeSignerRegion(const Aws::String& region);
- }
-
-} // namespace Aws
-
+ }
+
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/SDKConfig.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/SDKConfig.h
index a3f3f72a18..9561d20253 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/SDKConfig.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/SDKConfig.h
@@ -2,6 +2,6 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
+
/* #undef USE_AWS_MEMORY_MANAGEMENT */
-
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Version.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Version.h
index c24b5ec590..71215ec6bd 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Version.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/Version.h
@@ -2,18 +2,18 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
-namespace Version
-{
- AWS_CORE_API const char* GetVersionString();
- AWS_CORE_API unsigned GetVersionMajor();
- AWS_CORE_API unsigned GetVersionMinor();
- AWS_CORE_API unsigned GetVersionPatch();
- AWS_CORE_API const char* GetCompilerVersionString();
-} //namespace Version
-} //namespace Aws
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+namespace Version
+{
+ AWS_CORE_API const char* GetVersionString();
+ AWS_CORE_API unsigned GetVersionMajor();
+ AWS_CORE_API unsigned GetVersionMinor();
+ AWS_CORE_API unsigned GetVersionPatch();
+ AWS_CORE_API const char* GetCompilerVersionString();
+} //namespace Version
+} //namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/VersionConfig.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/VersionConfig.h
index 7ebbdb8ae4..9304d56ee7 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/VersionConfig.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/VersionConfig.h
@@ -2,5 +2,5 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
+
#define AWS_SDK_VERSION_STRING "1.8.113"
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h
index 9d048d0d12..8061ee1e25 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSigner.h
@@ -2,80 +2,80 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/Region.h>
-#include <aws/core/utils/memory/AWSMemory.h>
-#include <aws/core/utils/memory/stl/AWSSet.h>
-#include <aws/core/utils/DateTime.h>
-#include <aws/core/utils/Array.h>
-#include <aws/core/utils/threading/ReaderWriterLock.h>
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/Region.h>
+#include <aws/core/utils/memory/AWSMemory.h>
+#include <aws/core/utils/memory/stl/AWSSet.h>
+#include <aws/core/utils/DateTime.h>
+#include <aws/core/utils/Array.h>
+#include <aws/core/utils/threading/ReaderWriterLock.h>
#include <aws/core/utils/crypto/Sha256.h>
#include <aws/core/utils/crypto/Sha256HMAC.h>
-
-#include <memory>
-#include <atomic>
-#include <chrono>
-
-namespace Aws
-{
- namespace Http
- {
- class HttpClientFactory;
- class HttpRequest;
- } // namespace Http
-
- namespace Utils
- {
+
+#include <memory>
+#include <atomic>
+#include <chrono>
+
+namespace Aws
+{
+ namespace Http
+ {
+ class HttpClientFactory;
+ class HttpRequest;
+ } // namespace Http
+
+ namespace Utils
+ {
namespace Event
{
class Message;
}
- } // namespace Utils
-
- namespace Auth
- {
- class AWSCredentials;
- class AWSCredentialsProvider;
- AWS_CORE_API extern const char SIGV4_SIGNER[];
+ } // namespace Utils
+
+ namespace Auth
+ {
+ class AWSCredentials;
+ class AWSCredentialsProvider;
+ AWS_CORE_API extern const char SIGV4_SIGNER[];
AWS_CORE_API extern const char EVENTSTREAM_SIGV4_SIGNER[];
AWS_CORE_API extern const char SIGNATURE[];
- AWS_CORE_API extern const char NULL_SIGNER[];
- } // namespace Auth
-
- namespace Client
- {
- struct ClientConfiguration;
-
- /**
- * Auth Signer interface. Takes a generic AWS request and applies crypto tamper resistent signatures on the request.
- */
- class AWS_CORE_API AWSAuthSigner
- {
- public:
- AWSAuthSigner() : m_clockSkew() { m_clockSkew.store(std::chrono::milliseconds(0L)); }
- virtual ~AWSAuthSigner() = default;
-
- /**
- * Signs the request itself (usually by adding a signature header) based on info in the request and uri.
- */
- virtual bool SignRequest(Aws::Http::HttpRequest& request) const = 0;
-
- /**
- * Signs the request itself (usually by adding a signature header) based on info in the request and uri.
+ AWS_CORE_API extern const char NULL_SIGNER[];
+ } // namespace Auth
+
+ namespace Client
+ {
+ struct ClientConfiguration;
+
+ /**
+ * Auth Signer interface. Takes a generic AWS request and applies crypto tamper resistent signatures on the request.
+ */
+ class AWS_CORE_API AWSAuthSigner
+ {
+ public:
+ AWSAuthSigner() : m_clockSkew() { m_clockSkew.store(std::chrono::milliseconds(0L)); }
+ virtual ~AWSAuthSigner() = default;
+
+ /**
+ * Signs the request itself (usually by adding a signature header) based on info in the request and uri.
+ */
+ virtual bool SignRequest(Aws::Http::HttpRequest& request) const = 0;
+
+ /**
+ * Signs the request itself (usually by adding a signature header) based on info in the request and uri.
* If signBody is false and https is being used then the body of the payload will not be signed.
- * The default virtual function, just calls SignRequest.
- */
+ * The default virtual function, just calls SignRequest.
+ */
virtual bool SignRequest(Aws::Http::HttpRequest& request, bool signBody) const
{
AWS_UNREFERENCED_PARAM(signBody);
return SignRequest(request);
}
-
- /**
+
+ /**
* Signs the request itself (usually by adding a signature header) based on info in the request and uri.
* If signBody is false and https is being used then the body of the payload will not be signed.
* The default virtual function, just calls SignRequest.
@@ -118,115 +118,115 @@ namespace Aws
virtual bool SignEventMessage(Aws::Utils::Event::Message&, Aws::String& /* priorSignature */) const { return false; }
/**
- * Takes a request and signs the URI based on the HttpMethod, URI and other info from the request.
- * The URI can then be used in a normal HTTP call until expiration.
- */
- virtual bool PresignRequest(Aws::Http::HttpRequest& request, long long expirationInSeconds) const = 0;
-
- /**
- * Generates a signed Uri using the injected signer. for the supplied uri and http method and region. expirationInSeconds defaults
- * to 0 which is the default 7 days.
+ * Takes a request and signs the URI based on the HttpMethod, URI and other info from the request.
+ * The URI can then be used in a normal HTTP call until expiration.
+ */
+ virtual bool PresignRequest(Aws::Http::HttpRequest& request, long long expirationInSeconds) const = 0;
+
+ /**
+ * Generates a signed Uri using the injected signer. for the supplied uri and http method and region. expirationInSeconds defaults
+ * to 0 which is the default 7 days.
* Using m_region by default if parameter region is nullptr.
- */
- virtual bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, long long expirationInSeconds = 0) const = 0;
-
- /**
- * Generates a signed Uri using the injected signer. for the supplied uri and http method, region, and service name. expirationInSeconds defaults
- * to 0 which is the default 7 days.
+ */
+ virtual bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, long long expirationInSeconds = 0) const = 0;
+
+ /**
+ * Generates a signed Uri using the injected signer. for the supplied uri and http method, region, and service name. expirationInSeconds defaults
+ * to 0 which is the default 7 days.
* Using m_region by default if parameter region is nullptr.
* Using m_serviceName by default if parameter serviceName is nullptr.
- */
- virtual bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, long long expirationInSeconds = 0) const = 0;
-
- /**
- * Return the signer's name
- */
- virtual const char* GetName() const = 0;
-
- /**
- * This handles detection of clock skew between clients and the server and adjusts the clock so that the next request will not
- * fail on the timestamp check.
- */
- virtual void SetClockSkew(const std::chrono::milliseconds& clockSkew) { m_clockSkew = clockSkew; }
-
- /**
- * Gets the timestamp being used by the signer. This may include a clock skew if a clock skew has been detected.
- */
- virtual Aws::Utils::DateTime GetSigningTimestamp() const { return Aws::Utils::DateTime::Now() + GetClockSkewOffset(); }
-
+ */
+ virtual bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, long long expirationInSeconds = 0) const = 0;
+
+ /**
+ * Return the signer's name
+ */
+ virtual const char* GetName() const = 0;
+
+ /**
+ * This handles detection of clock skew between clients and the server and adjusts the clock so that the next request will not
+ * fail on the timestamp check.
+ */
+ virtual void SetClockSkew(const std::chrono::milliseconds& clockSkew) { m_clockSkew = clockSkew; }
+
+ /**
+ * Gets the timestamp being used by the signer. This may include a clock skew if a clock skew has been detected.
+ */
+ virtual Aws::Utils::DateTime GetSigningTimestamp() const { return Aws::Utils::DateTime::Now() + GetClockSkewOffset(); }
+
protected:
- virtual std::chrono::milliseconds GetClockSkewOffset() const { return m_clockSkew.load(); }
-
- std::atomic<std::chrono::milliseconds> m_clockSkew;
- };
-
- /**
- * AWS Auth v4 Signer implementation of the AWSAuthSigner interface. More information on AWS Auth v4 Can be found here:
- * http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html
- */
- class AWS_CORE_API AWSAuthV4Signer : public AWSAuthSigner
- {
-
- public:
- /**
- * Even though different payload signing polices, HTTP will force payload signing to be on.
- */
- enum class PayloadSigningPolicy
- {
- /**
- * Sign the request based on the value returned by AmazonWebServiceRequest::SignBody()
- */
- RequestDependent,
- /**
- * Always sign the body of the request.
- */
- Always,
- /**
- * Never sign the body of the request
- */
- Never
- };
- /**
- * credentialsProvider, source of AWS Credentials to sign requests with
- * serviceName, canonical service name to sign with
- * region, region string to use in signature
- * signPayloads, if Always, the payload will have a sha256 computed on the body of the request. If this is set
- * to Never, the sha256 will not be computed on the body. This is only useful for Amazon S3 over Https. If
- * Https is not used then this flag will be ignored. If set to RequestDependent, compute or not is based on
- * the value from AmazonWebServiceRequest::SignBody()
- */
- AWSAuthV4Signer(const std::shared_ptr<Auth::AWSCredentialsProvider>& credentialsProvider,
- const char* serviceName, const Aws::String& region, PayloadSigningPolicy signingPolicy = PayloadSigningPolicy::RequestDependent,
- bool urlEscapePath = true);
-
- virtual ~AWSAuthV4Signer();
-
- /**
- * AWSAuthV4signer's implementation of virtual function from base class
- * Return Auth Signer's name, here the value is specified in Aws::Auth::DEFAULT_AUTHV4_SIGNER.
- */
- const char* GetName() const override { return Aws::Auth::SIGV4_SIGNER; }
-
- /**
- * Signs the request itself based on info in the request and uri.
- * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm.
- */
+ virtual std::chrono::milliseconds GetClockSkewOffset() const { return m_clockSkew.load(); }
+
+ std::atomic<std::chrono::milliseconds> m_clockSkew;
+ };
+
+ /**
+ * AWS Auth v4 Signer implementation of the AWSAuthSigner interface. More information on AWS Auth v4 Can be found here:
+ * http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html
+ */
+ class AWS_CORE_API AWSAuthV4Signer : public AWSAuthSigner
+ {
+
+ public:
+ /**
+ * Even though different payload signing polices, HTTP will force payload signing to be on.
+ */
+ enum class PayloadSigningPolicy
+ {
+ /**
+ * Sign the request based on the value returned by AmazonWebServiceRequest::SignBody()
+ */
+ RequestDependent,
+ /**
+ * Always sign the body of the request.
+ */
+ Always,
+ /**
+ * Never sign the body of the request
+ */
+ Never
+ };
+ /**
+ * credentialsProvider, source of AWS Credentials to sign requests with
+ * serviceName, canonical service name to sign with
+ * region, region string to use in signature
+ * signPayloads, if Always, the payload will have a sha256 computed on the body of the request. If this is set
+ * to Never, the sha256 will not be computed on the body. This is only useful for Amazon S3 over Https. If
+ * Https is not used then this flag will be ignored. If set to RequestDependent, compute or not is based on
+ * the value from AmazonWebServiceRequest::SignBody()
+ */
+ AWSAuthV4Signer(const std::shared_ptr<Auth::AWSCredentialsProvider>& credentialsProvider,
+ const char* serviceName, const Aws::String& region, PayloadSigningPolicy signingPolicy = PayloadSigningPolicy::RequestDependent,
+ bool urlEscapePath = true);
+
+ virtual ~AWSAuthV4Signer();
+
+ /**
+ * AWSAuthV4signer's implementation of virtual function from base class
+ * Return Auth Signer's name, here the value is specified in Aws::Auth::DEFAULT_AUTHV4_SIGNER.
+ */
+ const char* GetName() const override { return Aws::Auth::SIGV4_SIGNER; }
+
+ /**
+ * Signs the request itself based on info in the request and uri.
+ * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm.
+ */
bool SignRequest(Aws::Http::HttpRequest& request) const override
{
return SignRequest(request, m_region.c_str(), m_serviceName.c_str(), true/*signBody*/);
}
-
- /**
- * Signs the request itself based on info in the request and uri.
- * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. If signBody is false
- * and https is being used then the body of the payload will not be signed.
- */
+
+ /**
+ * Signs the request itself based on info in the request and uri.
+ * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. If signBody is false
+ * and https is being used then the body of the payload will not be signed.
+ */
bool SignRequest(Aws::Http::HttpRequest& request, bool signBody) const override
{
return SignRequest(request, m_region.c_str(), m_serviceName.c_str(), signBody);
}
-
- /**
+
+ /**
* Uses AWS Auth V4 signing method with SHA256 HMAC algorithm. If signBody is false
* and https is being used then the body of the payload will not be signed.
* Using m_region by default if parameter region is nullptr.
@@ -244,84 +244,84 @@ namespace Aws
bool SignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, bool signBody) const override;
/**
- * Takes a request and signs the URI based on the HttpMethod, URI and other info from the request.
- * the region the signer was initialized with will be used for the signature.
- * The URI can then be used in a normal HTTP call until expiration.
- * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm.
- * expirationInSeconds defaults to 0 which provides a URI good for 7 days.
- */
- bool PresignRequest(Aws::Http::HttpRequest& request, long long expirationInSeconds = 0) const override;
-
- /**
* Takes a request and signs the URI based on the HttpMethod, URI and other info from the request.
- * The URI can then be used in a normal HTTP call until expiration.
- * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm.
- * expirationInSeconds defaults to 0 which provides a URI good for 7 days.
+ * the region the signer was initialized with will be used for the signature.
+ * The URI can then be used in a normal HTTP call until expiration.
+ * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm.
+ * expirationInSeconds defaults to 0 which provides a URI good for 7 days.
+ */
+ bool PresignRequest(Aws::Http::HttpRequest& request, long long expirationInSeconds = 0) const override;
+
+ /**
+ * Takes a request and signs the URI based on the HttpMethod, URI and other info from the request.
+ * The URI can then be used in a normal HTTP call until expiration.
+ * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm.
+ * expirationInSeconds defaults to 0 which provides a URI good for 7 days.
* Using m_region by default if parameter region is nullptr.
- */
- bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, long long expirationInSeconds = 0) const override;
-
- /**
- * Takes a request and signs the URI based on the HttpMethod, URI and other info from the request.
- * The URI can then be used in a normal HTTP call until expiration.
- * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm.
- * expirationInSeconds defaults to 0 which provides a URI good for 7 days.
+ */
+ bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, long long expirationInSeconds = 0) const override;
+
+ /**
+ * Takes a request and signs the URI based on the HttpMethod, URI and other info from the request.
+ * The URI can then be used in a normal HTTP call until expiration.
+ * Uses AWS Auth V4 signing method with SHA256 HMAC algorithm.
+ * expirationInSeconds defaults to 0 which provides a URI good for 7 days.
* Using m_region by default if parameter region is nullptr.
* Using m_serviceName by default if parameter serviceName is nullptr.
- */
- bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, long long expirationInSeconds = 0) const override;
-
+ */
+ bool PresignRequest(Aws::Http::HttpRequest& request, const char* region, const char* serviceName, long long expirationInSeconds = 0) const override;
+
Aws::String GetServiceName() const { return m_serviceName; }
Aws::String GetRegion() const { return m_region; }
Aws::String GenerateSignature(const Aws::Auth::AWSCredentials& credentials,
const Aws::String& stringToSign, const Aws::String& simpleDate) const;
bool ShouldSignHeader(const Aws::String& header) const;
- protected:
- bool m_includeSha256HashHeader;
-
- private:
-
- Aws::String GenerateSignature(const Aws::Auth::AWSCredentials& credentials,
+ protected:
+ bool m_includeSha256HashHeader;
+
+ private:
+
+ Aws::String GenerateSignature(const Aws::Auth::AWSCredentials& credentials,
const Aws::String& stringToSign, const Aws::String& simpleDate, const Aws::String& region,
- const Aws::String& serviceName) const;
-
- Aws::String GenerateSignature(const Aws::String& stringToSign, const Aws::Utils::ByteBuffer& key) const;
- bool ServiceRequireUnsignedPayload(const Aws::String& serviceName) const;
- Aws::String ComputePayloadHash(Aws::Http::HttpRequest&) const;
- Aws::String GenerateStringToSign(const Aws::String& dateValue, const Aws::String& simpleDate,
- const Aws::String& canonicalRequestHash, const Aws::String& region,
- const Aws::String& serviceName) const;
- Aws::Utils::ByteBuffer ComputeHash(const Aws::String& secretKey, const Aws::String& simpleDate) const;
- Aws::Utils::ByteBuffer ComputeHash(const Aws::String& secretKey,
- const Aws::String& simpleDate, const Aws::String& region, const Aws::String& serviceName) const;
-
-
- std::shared_ptr<Auth::AWSCredentialsProvider> m_credentialsProvider;
- const Aws::String m_serviceName;
- const Aws::String m_region;
- Aws::UniquePtr<Aws::Utils::Crypto::Sha256> m_hash;
- Aws::UniquePtr<Aws::Utils::Crypto::Sha256HMAC> m_HMAC;
-
- Aws::Set<Aws::String> m_unsignedHeaders;
-
- //these next four fields are ONLY for caching purposes and do not change
- //the logical state of the signer. They are marked mutable so the
- //interface can remain const.
- mutable Aws::Utils::ByteBuffer m_partialSignature;
- mutable Aws::String m_currentDateStr;
- mutable Aws::String m_currentSecretKey;
- mutable Utils::Threading::ReaderWriterLock m_partialSignatureLock;
- PayloadSigningPolicy m_payloadSigningPolicy;
- bool m_urlEscapePath;
- };
-
+ const Aws::String& serviceName) const;
+
+ Aws::String GenerateSignature(const Aws::String& stringToSign, const Aws::Utils::ByteBuffer& key) const;
+ bool ServiceRequireUnsignedPayload(const Aws::String& serviceName) const;
+ Aws::String ComputePayloadHash(Aws::Http::HttpRequest&) const;
+ Aws::String GenerateStringToSign(const Aws::String& dateValue, const Aws::String& simpleDate,
+ const Aws::String& canonicalRequestHash, const Aws::String& region,
+ const Aws::String& serviceName) const;
+ Aws::Utils::ByteBuffer ComputeHash(const Aws::String& secretKey, const Aws::String& simpleDate) const;
+ Aws::Utils::ByteBuffer ComputeHash(const Aws::String& secretKey,
+ const Aws::String& simpleDate, const Aws::String& region, const Aws::String& serviceName) const;
+
+
+ std::shared_ptr<Auth::AWSCredentialsProvider> m_credentialsProvider;
+ const Aws::String m_serviceName;
+ const Aws::String m_region;
+ Aws::UniquePtr<Aws::Utils::Crypto::Sha256> m_hash;
+ Aws::UniquePtr<Aws::Utils::Crypto::Sha256HMAC> m_HMAC;
+
+ Aws::Set<Aws::String> m_unsignedHeaders;
+
+ //these next four fields are ONLY for caching purposes and do not change
+ //the logical state of the signer. They are marked mutable so the
+ //interface can remain const.
+ mutable Aws::Utils::ByteBuffer m_partialSignature;
+ mutable Aws::String m_currentDateStr;
+ mutable Aws::String m_currentSecretKey;
+ mutable Utils::Threading::ReaderWriterLock m_partialSignatureLock;
+ PayloadSigningPolicy m_payloadSigningPolicy;
+ bool m_urlEscapePath;
+ };
+
class AWS_CORE_API AWSAuthEventStreamV4Signer : public AWSAuthSigner
{
public:
AWSAuthEventStreamV4Signer(const std::shared_ptr<Auth::AWSCredentialsProvider>& credentialsProvider,
const char* serviceName, const Aws::String& region);
-
+
const char* GetName() const override { return Aws::Auth::EVENTSTREAM_SIGV4_SIGNER; }
bool SignEventMessage(Aws::Utils::Event::Message&, Aws::String& priorSignature) const override;
@@ -382,44 +382,44 @@ namespace Aws
};
- /**
- * A no-op implementation of the AWSAuthSigner interface
- */
- class AWS_CORE_API AWSNullSigner : public AWSAuthSigner
- {
- public:
- /**
- * AWSNullSigner's implementation of virtual function from base class
- * Here the returned value is specified in Aws::Auth::NULL_SIGNER.
- */
- const char* GetName() const override { return Aws::Auth::NULL_SIGNER; }
-
- /**
- * Do nothing
- */
- bool SignRequest(Aws::Http::HttpRequest&) const override { return true; }
-
- /**
- * Do nothing
- */
+ /**
+ * A no-op implementation of the AWSAuthSigner interface
+ */
+ class AWS_CORE_API AWSNullSigner : public AWSAuthSigner
+ {
+ public:
+ /**
+ * AWSNullSigner's implementation of virtual function from base class
+ * Here the returned value is specified in Aws::Auth::NULL_SIGNER.
+ */
+ const char* GetName() const override { return Aws::Auth::NULL_SIGNER; }
+
+ /**
+ * Do nothing
+ */
+ bool SignRequest(Aws::Http::HttpRequest&) const override { return true; }
+
+ /**
+ * Do nothing
+ */
bool SignEventMessage(Aws::Utils::Event::Message&, Aws::String& /* priorSignature */) const override { return true; }
/**
* Do nothing
*/
- bool PresignRequest(Aws::Http::HttpRequest&, long long) const override { return false; }
-
- /**
- * Do nothing
- */
- bool PresignRequest(Aws::Http::HttpRequest&, const char*, long long) const override { return false; }
-
- /**
- * Do nothing
- */
- bool PresignRequest(Aws::Http::HttpRequest&, const char*, const char*, long long) const override { return false; }
- };
-
- } // namespace Client
-} // namespace Aws
-
+ bool PresignRequest(Aws::Http::HttpRequest&, long long) const override { return false; }
+
+ /**
+ * Do nothing
+ */
+ bool PresignRequest(Aws::Http::HttpRequest&, const char*, long long) const override { return false; }
+
+ /**
+ * Do nothing
+ */
+ bool PresignRequest(Aws::Http::HttpRequest&, const char*, const char*, long long) const override { return false; }
+ };
+
+ } // namespace Client
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSignerProvider.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSignerProvider.h
index 84b5613738..305c58cd9d 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSignerProvider.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSAuthSignerProvider.h
@@ -2,37 +2,37 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/memory/stl/AWSVector.h>
-#include <memory>
-
-
-namespace Aws
-{
- namespace Client
- {
- class AWSAuthSigner;
- }
- namespace Auth
- {
+
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSVector.h>
+#include <memory>
+
+
+namespace Aws
+{
+ namespace Client
+ {
+ class AWSAuthSigner;
+ }
+ namespace Auth
+ {
class AWSCredentialsProvider;
- class AWS_CORE_API AWSAuthSignerProvider
- {
- public:
- virtual std::shared_ptr<Aws::Client::AWSAuthSigner> GetSigner(const Aws::String& signerName) const = 0;
+ class AWS_CORE_API AWSAuthSignerProvider
+ {
+ public:
+ virtual std::shared_ptr<Aws::Client::AWSAuthSigner> GetSigner(const Aws::String& signerName) const = 0;
virtual void AddSigner(std::shared_ptr<Aws::Client::AWSAuthSigner>& signer) = 0;
- virtual ~AWSAuthSignerProvider() = default;
- };
-
- class AWS_CORE_API DefaultAuthSignerProvider : public AWSAuthSignerProvider
- {
- public:
+ virtual ~AWSAuthSignerProvider() = default;
+ };
+
+ class AWS_CORE_API DefaultAuthSignerProvider : public AWSAuthSignerProvider
+ {
+ public:
/**
* Creates a Signature-V4 signer provider that supports the different implementations of Signature-V4
* used for standard and event-stream requests.
@@ -43,11 +43,11 @@ namespace Aws
*/
DefaultAuthSignerProvider(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
const Aws::String& serviceName, const Aws::String& region);
- explicit DefaultAuthSignerProvider(const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer);
+ explicit DefaultAuthSignerProvider(const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer);
void AddSigner(std::shared_ptr<Aws::Client::AWSAuthSigner>& signer) override;
- std::shared_ptr<Aws::Client::AWSAuthSigner> GetSigner(const Aws::String& signerName) const override;
- private:
- Aws::Vector<std::shared_ptr<Aws::Client::AWSAuthSigner>> m_signers;
- };
- }
-}
+ std::shared_ptr<Aws::Client::AWSAuthSigner> GetSigner(const Aws::String& signerName) const override;
+ private:
+ Aws::Vector<std::shared_ptr<Aws::Client::AWSAuthSigner>> m_signers;
+ };
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProvider.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProvider.h
index 43ec431f8f..a3a46964e8 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProvider.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProvider.h
@@ -2,34 +2,34 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/UnreferencedParam.h>
-#include <aws/core/utils/DateTime.h>
-#include <aws/core/utils/memory/stl/AWSMap.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/threading/ReaderWriterLock.h>
-#include <aws/core/internal/AWSHttpResourceClient.h>
+
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/UnreferencedParam.h>
+#include <aws/core/utils/DateTime.h>
+#include <aws/core/utils/memory/stl/AWSMap.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/threading/ReaderWriterLock.h>
+#include <aws/core/internal/AWSHttpResourceClient.h>
#include <aws/core/auth/AWSCredentials.h>
#include <aws/core/config/AWSProfileConfigLoader.h>
#include <aws/core/client/RetryStrategy.h>
-#include <memory>
-
-namespace Aws
-{
- namespace Auth
- {
+#include <memory>
+
+namespace Aws
+{
+ namespace Auth
+ {
constexpr int REFRESH_THRESHOLD = 1000 * 60 * 5;
-
+
/**
* Returns the full path of the config file.
*/
AWS_CORE_API Aws::String GetConfigProfileFilename(); //defaults to "config"
-
- /**
+
+ /**
* Returns the default profile name.
* The value is the first non-empty value of the following:
* 1. AWS_PROFILE environment variable
@@ -44,233 +44,233 @@ namespace Aws
AWS_CORE_API AWSCredentials GetCredentialsFromProcess(const Aws::String& process);
/**
- * Abstract class for retrieving AWS credentials. Create a derived class from this to allow
- * various methods of storing and retrieving credentials. Examples would be cognito-identity, some encrypted store etc...
- */
- class AWS_CORE_API AWSCredentialsProvider
- {
- public:
- /**
- * Initializes provider. Sets last Loaded time count to 0, forcing a refresh on the
- * first call to GetAWSCredentials.
- */
- AWSCredentialsProvider() : m_lastLoadedMs(0)
- {
- }
-
- virtual ~AWSCredentialsProvider() = default;
-
- /**
- * The core of the credential provider interface. Override this method to control how credentials are retrieved.
- */
- virtual AWSCredentials GetAWSCredentials() = 0;
-
- protected:
- /**
- * The default implementation keeps up with the cache times and lets you know if it's time to refresh your internal caching
- * to aid your implementation of GetAWSCredentials.
- */
- virtual bool IsTimeToRefresh(long reloadFrequency);
- virtual void Reload();
- mutable Aws::Utils::Threading::ReaderWriterLock m_reloadLock;
- private:
- long long m_lastLoadedMs;
- };
-
- /**
- * Simply a provider that always returns empty credentials. This is useful for a client that needs to make unsigned
- * calls.
- */
- class AWS_CORE_API AnonymousAWSCredentialsProvider : public AWSCredentialsProvider
- {
- public:
- /**
- * Returns empty credentials object.
- */
+ * Abstract class for retrieving AWS credentials. Create a derived class from this to allow
+ * various methods of storing and retrieving credentials. Examples would be cognito-identity, some encrypted store etc...
+ */
+ class AWS_CORE_API AWSCredentialsProvider
+ {
+ public:
+ /**
+ * Initializes provider. Sets last Loaded time count to 0, forcing a refresh on the
+ * first call to GetAWSCredentials.
+ */
+ AWSCredentialsProvider() : m_lastLoadedMs(0)
+ {
+ }
+
+ virtual ~AWSCredentialsProvider() = default;
+
+ /**
+ * The core of the credential provider interface. Override this method to control how credentials are retrieved.
+ */
+ virtual AWSCredentials GetAWSCredentials() = 0;
+
+ protected:
+ /**
+ * The default implementation keeps up with the cache times and lets you know if it's time to refresh your internal caching
+ * to aid your implementation of GetAWSCredentials.
+ */
+ virtual bool IsTimeToRefresh(long reloadFrequency);
+ virtual void Reload();
+ mutable Aws::Utils::Threading::ReaderWriterLock m_reloadLock;
+ private:
+ long long m_lastLoadedMs;
+ };
+
+ /**
+ * Simply a provider that always returns empty credentials. This is useful for a client that needs to make unsigned
+ * calls.
+ */
+ class AWS_CORE_API AnonymousAWSCredentialsProvider : public AWSCredentialsProvider
+ {
+ public:
+ /**
+ * Returns empty credentials object.
+ */
inline AWSCredentials GetAWSCredentials() override { return AWSCredentials(); }
- };
-
- /**
- * A simple string provider. It takes the AccessKeyId and the SecretKey as constructor args and
- * provides them through the interface. This is the default class for AWSClients that take string
- * arguments for credentials.
- */
- class AWS_CORE_API SimpleAWSCredentialsProvider : public AWSCredentialsProvider
- {
- public:
- /**
- * Initializes object from awsAccessKeyId, awsSecretAccessKey, and sessionToken parameters. sessionToken parameter is defaulted to empty.
- */
- inline SimpleAWSCredentialsProvider(const Aws::String& awsAccessKeyId, const Aws::String& awsSecretAccessKey, const Aws::String& sessionToken = "")
+ };
+
+ /**
+ * A simple string provider. It takes the AccessKeyId and the SecretKey as constructor args and
+ * provides them through the interface. This is the default class for AWSClients that take string
+ * arguments for credentials.
+ */
+ class AWS_CORE_API SimpleAWSCredentialsProvider : public AWSCredentialsProvider
+ {
+ public:
+ /**
+ * Initializes object from awsAccessKeyId, awsSecretAccessKey, and sessionToken parameters. sessionToken parameter is defaulted to empty.
+ */
+ inline SimpleAWSCredentialsProvider(const Aws::String& awsAccessKeyId, const Aws::String& awsSecretAccessKey, const Aws::String& sessionToken = "")
: m_credentials(awsAccessKeyId, awsSecretAccessKey, sessionToken)
- { }
-
- /**
- * Initializes object from credentials object. everything is copied.
- */
- inline SimpleAWSCredentialsProvider(const AWSCredentials& credentials)
+ { }
+
+ /**
+ * Initializes object from credentials object. everything is copied.
+ */
+ inline SimpleAWSCredentialsProvider(const AWSCredentials& credentials)
: m_credentials(credentials)
- { }
-
- /**
- * Returns the credentials this object was initialized with as an AWSCredentials object.
- */
- inline AWSCredentials GetAWSCredentials() override
- {
+ { }
+
+ /**
+ * Returns the credentials this object was initialized with as an AWSCredentials object.
+ */
+ inline AWSCredentials GetAWSCredentials() override
+ {
return m_credentials;
- }
-
- private:
+ }
+
+ private:
AWSCredentials m_credentials;
- };
-
- /**
- * Reads AWS credentials from the Environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN if they exist. If they
- * are not found, empty credentials are returned.
- */
- class AWS_CORE_API EnvironmentAWSCredentialsProvider : public AWSCredentialsProvider
- {
- public:
- /**
- * Reads AWS credentials from the Environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN if they exist. If they
- * are not found, empty credentials are returned. Credentials are not cached.
- */
- AWSCredentials GetAWSCredentials() override;
- };
-
- /**
- * Reads credentials profile from the default Profile Config File. Refreshes at set interval for credential rotation.
- * Looks for environment variables AWS_SHARED_CREDENTIALS_FILE and AWS_PROFILE. If they aren't found, then it defaults
+ };
+
+ /**
+ * Reads AWS credentials from the Environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN if they exist. If they
+ * are not found, empty credentials are returned.
+ */
+ class AWS_CORE_API EnvironmentAWSCredentialsProvider : public AWSCredentialsProvider
+ {
+ public:
+ /**
+ * Reads AWS credentials from the Environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN if they exist. If they
+ * are not found, empty credentials are returned. Credentials are not cached.
+ */
+ AWSCredentials GetAWSCredentials() override;
+ };
+
+ /**
+ * Reads credentials profile from the default Profile Config File. Refreshes at set interval for credential rotation.
+ * Looks for environment variables AWS_SHARED_CREDENTIALS_FILE and AWS_PROFILE. If they aren't found, then it defaults
* to the default profile in ~/.aws/credentials.
- * Optionally a user can specify the profile and it will override the environment variable
- * and defaults. To alter the file this pulls from, then the user should alter the AWS_SHARED_CREDENTIALS_FILE variable.
- */
- class AWS_CORE_API ProfileConfigFileAWSCredentialsProvider : public AWSCredentialsProvider
- {
- public:
-
- /**
- * Initializes with refreshRateMs as the frequency at which the file is reparsed in milliseconds. Defaults to 5 minutes.
- */
- ProfileConfigFileAWSCredentialsProvider(long refreshRateMs = REFRESH_THRESHOLD);
-
- /**
- * Initializes with a profile override and
- * refreshRateMs as the frequency at which the file is reparsed in milliseconds. Defaults to 5 minutes.
- */
- ProfileConfigFileAWSCredentialsProvider(const char* profile, long refreshRateMs = REFRESH_THRESHOLD);
-
- /**
- * Retrieves the credentials if found, otherwise returns empty credential set.
- */
- AWSCredentials GetAWSCredentials() override;
-
- /**
- * Returns the fullpath of the calculated credentials profile file
- */
- static Aws::String GetCredentialsProfileFilename();
-
- /**
- * Returns the directory storing the profile file.
- */
- static Aws::String GetProfileDirectory();
-
- protected:
- void Reload() override;
- private:
-
- /**
+ * Optionally a user can specify the profile and it will override the environment variable
+ * and defaults. To alter the file this pulls from, then the user should alter the AWS_SHARED_CREDENTIALS_FILE variable.
+ */
+ class AWS_CORE_API ProfileConfigFileAWSCredentialsProvider : public AWSCredentialsProvider
+ {
+ public:
+
+ /**
+ * Initializes with refreshRateMs as the frequency at which the file is reparsed in milliseconds. Defaults to 5 minutes.
+ */
+ ProfileConfigFileAWSCredentialsProvider(long refreshRateMs = REFRESH_THRESHOLD);
+
+ /**
+ * Initializes with a profile override and
+ * refreshRateMs as the frequency at which the file is reparsed in milliseconds. Defaults to 5 minutes.
+ */
+ ProfileConfigFileAWSCredentialsProvider(const char* profile, long refreshRateMs = REFRESH_THRESHOLD);
+
+ /**
+ * Retrieves the credentials if found, otherwise returns empty credential set.
+ */
+ AWSCredentials GetAWSCredentials() override;
+
+ /**
+ * Returns the fullpath of the calculated credentials profile file
+ */
+ static Aws::String GetCredentialsProfileFilename();
+
+ /**
+ * Returns the directory storing the profile file.
+ */
+ static Aws::String GetProfileDirectory();
+
+ protected:
+ void Reload() override;
+ private:
+
+ /**
* Checks to see if the refresh interval has expired and reparses the file if it has.
*/
- void RefreshIfExpired();
-
- Aws::String m_profileToUse;
+ void RefreshIfExpired();
+
+ Aws::String m_profileToUse;
Aws::Config::AWSConfigFileProfileConfigLoader m_credentialsFileLoader;
- long m_loadFrequencyMs;
- };
-
- /**
- * Credentials provider implementation that loads credentials from the Amazon
- * EC2 Instance Metadata Service.
- */
- class AWS_CORE_API InstanceProfileCredentialsProvider : public AWSCredentialsProvider
- {
- public:
- /**
- * Initializes the provider to refresh credentials form the EC2 instance metadata service every 5 minutes.
- * Constructs an EC2MetadataClient using the default http stack (most likely what you want).
- */
- InstanceProfileCredentialsProvider(long refreshRateMs = REFRESH_THRESHOLD);
-
- /**
- * Initializes the provider to refresh credentials form the EC2 instance metadata service every 5 minutes,
- * uses a supplied EC2MetadataClient.
- */
- InstanceProfileCredentialsProvider(const std::shared_ptr<Aws::Config::EC2InstanceProfileConfigLoader>&, long refreshRateMs = REFRESH_THRESHOLD);
-
- /**
- * Retrieves the credentials if found, otherwise returns empty credential set.
- */
- AWSCredentials GetAWSCredentials() override;
-
- protected:
- void Reload() override;
-
- private:
- void RefreshIfExpired();
-
- std::shared_ptr<Aws::Config::AWSProfileConfigLoader> m_ec2MetadataConfigLoader;
- long m_loadFrequencyMs;
- };
-
- /**
- * ECS credentials provider implementation that loads credentials from the Amazon
- * ECS metadata service or an arbitrary endpoint.
- */
- class AWS_CORE_API TaskRoleCredentialsProvider : public AWSCredentialsProvider
- {
- public:
- /**
- * Initializes the provider to retrieve credentials from the ECS metadata service every 5 minutes,
- * or before it expires.
- * @param resourcePath A path appended to the metadata service endpoint.
- * @param refreshRateMs The number of milliseconds after which the credentials will be fetched again.
- */
- TaskRoleCredentialsProvider(const char* resourcePath, long refreshRateMs = REFRESH_THRESHOLD);
-
- /**
- * Initializes the provider to retrieve credentials from a provided endpoint every 5 minutes or before it
- * expires.
- * @param endpoint The full URI to resolve to get credentials.
- * @param token An optional authorization token passed to the URI via the 'Authorization' HTTP header.
- * @param refreshRateMs The number of milliseconds after which the credentials will be fetched again.
- */
- TaskRoleCredentialsProvider(const char* endpoint, const char* token, long refreshRateMs = REFRESH_THRESHOLD);
-
- /**
- * Initializes the provider to retrieve credentials using the provided client.
- * @param client The ECSCredentialsClient instance to use when retrieving credentials.
- * @param refreshRateMs The number of milliseconds after which the credentials will be fetched again.
- */
- TaskRoleCredentialsProvider(const std::shared_ptr<Aws::Internal::ECSCredentialsClient>& client,
- long refreshRateMs = REFRESH_THRESHOLD);
- /**
- * Retrieves the credentials if found, otherwise returns empty credential set.
- */
- AWSCredentials GetAWSCredentials() override;
-
- protected:
- void Reload() override;
- private:
- bool ExpiresSoon() const;
- void RefreshIfExpired();
-
- private:
- std::shared_ptr<Aws::Internal::ECSCredentialsClient> m_ecsCredentialsClient;
- long m_loadFrequencyMs;
- Aws::Auth::AWSCredentials m_credentials;
- };
-
+ long m_loadFrequencyMs;
+ };
+
+ /**
+ * Credentials provider implementation that loads credentials from the Amazon
+ * EC2 Instance Metadata Service.
+ */
+ class AWS_CORE_API InstanceProfileCredentialsProvider : public AWSCredentialsProvider
+ {
+ public:
+ /**
+ * Initializes the provider to refresh credentials form the EC2 instance metadata service every 5 minutes.
+ * Constructs an EC2MetadataClient using the default http stack (most likely what you want).
+ */
+ InstanceProfileCredentialsProvider(long refreshRateMs = REFRESH_THRESHOLD);
+
+ /**
+ * Initializes the provider to refresh credentials form the EC2 instance metadata service every 5 minutes,
+ * uses a supplied EC2MetadataClient.
+ */
+ InstanceProfileCredentialsProvider(const std::shared_ptr<Aws::Config::EC2InstanceProfileConfigLoader>&, long refreshRateMs = REFRESH_THRESHOLD);
+
+ /**
+ * Retrieves the credentials if found, otherwise returns empty credential set.
+ */
+ AWSCredentials GetAWSCredentials() override;
+
+ protected:
+ void Reload() override;
+
+ private:
+ void RefreshIfExpired();
+
+ std::shared_ptr<Aws::Config::AWSProfileConfigLoader> m_ec2MetadataConfigLoader;
+ long m_loadFrequencyMs;
+ };
+
+ /**
+ * ECS credentials provider implementation that loads credentials from the Amazon
+ * ECS metadata service or an arbitrary endpoint.
+ */
+ class AWS_CORE_API TaskRoleCredentialsProvider : public AWSCredentialsProvider
+ {
+ public:
+ /**
+ * Initializes the provider to retrieve credentials from the ECS metadata service every 5 minutes,
+ * or before it expires.
+ * @param resourcePath A path appended to the metadata service endpoint.
+ * @param refreshRateMs The number of milliseconds after which the credentials will be fetched again.
+ */
+ TaskRoleCredentialsProvider(const char* resourcePath, long refreshRateMs = REFRESH_THRESHOLD);
+
+ /**
+ * Initializes the provider to retrieve credentials from a provided endpoint every 5 minutes or before it
+ * expires.
+ * @param endpoint The full URI to resolve to get credentials.
+ * @param token An optional authorization token passed to the URI via the 'Authorization' HTTP header.
+ * @param refreshRateMs The number of milliseconds after which the credentials will be fetched again.
+ */
+ TaskRoleCredentialsProvider(const char* endpoint, const char* token, long refreshRateMs = REFRESH_THRESHOLD);
+
+ /**
+ * Initializes the provider to retrieve credentials using the provided client.
+ * @param client The ECSCredentialsClient instance to use when retrieving credentials.
+ * @param refreshRateMs The number of milliseconds after which the credentials will be fetched again.
+ */
+ TaskRoleCredentialsProvider(const std::shared_ptr<Aws::Internal::ECSCredentialsClient>& client,
+ long refreshRateMs = REFRESH_THRESHOLD);
+ /**
+ * Retrieves the credentials if found, otherwise returns empty credential set.
+ */
+ AWSCredentials GetAWSCredentials() override;
+
+ protected:
+ void Reload() override;
+ private:
+ bool ExpiresSoon() const;
+ void RefreshIfExpired();
+
+ private:
+ std::shared_ptr<Aws::Internal::ECSCredentialsClient> m_ecsCredentialsClient;
+ long m_loadFrequencyMs;
+ Aws::Auth::AWSCredentials m_credentials;
+ };
+
/**
* Process credentials provider that loads credentials by running another command (or program) configured in config file
* The configuration format is as following:
@@ -312,5 +312,5 @@ namespace Aws
Aws::String m_profileToUse;
Aws::Auth::AWSCredentials m_credentials;
};
- } // namespace Auth
-} // namespace Aws
+ } // namespace Auth
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProviderChain.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProviderChain.h
index b45e250b6c..dae8cf5a42 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProviderChain.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/auth/AWSCredentialsProviderChain.h
@@ -2,67 +2,67 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSVector.h>
-#include <aws/core/auth/AWSCredentialsProvider.h>
-#include <memory>
-
-namespace Aws
-{
- namespace Auth
- {
- /**
- * Abstract class for providing chains of credentials providers. When a credentials provider in the chain returns empty credentials,
- * We go on to the next provider until we have either exhausted the installed providers in the chain or something returns non-empty credentials.
- */
- class AWS_CORE_API AWSCredentialsProviderChain : public AWSCredentialsProvider
- {
- public:
- virtual ~AWSCredentialsProviderChain() = default;
-
- /**
- * When a credentials provider in the chain returns empty credentials,
- * We go on to the next provider until we have either exhausted the installed providers in the chain or something returns non-empty credentials.
- */
- virtual AWSCredentials GetAWSCredentials();
-
- /**
- * Gets all providers stored in this chain.
- */
- const Aws::Vector<std::shared_ptr<AWSCredentialsProvider>>& GetProviders() { return m_providerChain; }
-
- protected:
- /**
- * This class is only allowed to be initialized by subclasses.
- */
- AWSCredentialsProviderChain() = default;
-
- /**
- * Adds a provider to the back of the chain.
- */
- void AddProvider(const std::shared_ptr<AWSCredentialsProvider>& provider) { m_providerChain.push_back(provider); }
-
-
- private:
- Aws::Vector<std::shared_ptr<AWSCredentialsProvider> > m_providerChain;
- };
-
- /**
- * Creates an AWSCredentialsProviderChain which uses in order EnvironmentAWSCredentialsProvider, ProfileConfigFileAWSCredentialsProvider,
- * and InstanceProfileCredentialsProvider.
- */
- class AWS_CORE_API DefaultAWSCredentialsProviderChain : public AWSCredentialsProviderChain
- {
- public:
- /**
- * Initializes the provider chain with EnvironmentAWSCredentialsProvider, ProfileConfigFileAWSCredentialsProvider,
- * and InstanceProfileCredentialsProvider in that order.
- */
- DefaultAWSCredentialsProviderChain();
- };
-
- } // namespace Auth
-} // namespace Aws
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSVector.h>
+#include <aws/core/auth/AWSCredentialsProvider.h>
+#include <memory>
+
+namespace Aws
+{
+ namespace Auth
+ {
+ /**
+ * Abstract class for providing chains of credentials providers. When a credentials provider in the chain returns empty credentials,
+ * We go on to the next provider until we have either exhausted the installed providers in the chain or something returns non-empty credentials.
+ */
+ class AWS_CORE_API AWSCredentialsProviderChain : public AWSCredentialsProvider
+ {
+ public:
+ virtual ~AWSCredentialsProviderChain() = default;
+
+ /**
+ * When a credentials provider in the chain returns empty credentials,
+ * We go on to the next provider until we have either exhausted the installed providers in the chain or something returns non-empty credentials.
+ */
+ virtual AWSCredentials GetAWSCredentials();
+
+ /**
+ * Gets all providers stored in this chain.
+ */
+ const Aws::Vector<std::shared_ptr<AWSCredentialsProvider>>& GetProviders() { return m_providerChain; }
+
+ protected:
+ /**
+ * This class is only allowed to be initialized by subclasses.
+ */
+ AWSCredentialsProviderChain() = default;
+
+ /**
+ * Adds a provider to the back of the chain.
+ */
+ void AddProvider(const std::shared_ptr<AWSCredentialsProvider>& provider) { m_providerChain.push_back(provider); }
+
+
+ private:
+ Aws::Vector<std::shared_ptr<AWSCredentialsProvider> > m_providerChain;
+ };
+
+ /**
+ * Creates an AWSCredentialsProviderChain which uses in order EnvironmentAWSCredentialsProvider, ProfileConfigFileAWSCredentialsProvider,
+ * and InstanceProfileCredentialsProvider.
+ */
+ class AWS_CORE_API DefaultAWSCredentialsProviderChain : public AWSCredentialsProviderChain
+ {
+ public:
+ /**
+ * Initializes the provider chain with EnvironmentAWSCredentialsProvider, ProfileConfigFileAWSCredentialsProvider,
+ * and InstanceProfileCredentialsProvider in that order.
+ */
+ DefaultAWSCredentialsProviderChain();
+ };
+
+ } // namespace Auth
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h
index d091e0f29e..186206a66e 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h
@@ -1,129 +1,129 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/client/CoreErrors.h>
-#include <aws/core/http/HttpTypes.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/AmazonWebServiceResult.h>
-#include <aws/core/utils/crypto/Hash.h>
-#include <aws/core/auth/AWSAuthSignerProvider.h>
-#include <memory>
-#include <atomic>
-
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/client/CoreErrors.h>
+#include <aws/core/http/HttpTypes.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/AmazonWebServiceResult.h>
+#include <aws/core/utils/crypto/Hash.h>
+#include <aws/core/auth/AWSAuthSignerProvider.h>
+#include <memory>
+#include <atomic>
+
struct aws_array_list;
-namespace Aws
-{
- namespace Utils
- {
- template<typename R, typename E>
- class Outcome;
-
- namespace Xml
- {
- class XmlDocument;
- } // namespace Xml
-
- namespace Json
- {
- class JsonValue;
- } // namespace Json
-
- namespace RateLimits
- {
- class RateLimiterInterface;
- } // namespace RateLimits
-
- namespace Crypto
- {
- class MD5;
- } // namespace Crypto
- } // namespace Utils
-
- namespace Http
- {
- class HttpClient;
-
- class HttpClientFactory;
-
- class HttpRequest;
-
- class HttpResponse;
-
- class URI;
- } // namespace Http
-
- namespace Auth
- {
- AWS_CORE_API extern const char SIGV4_SIGNER[];
- AWS_CORE_API extern const char NULL_SIGNER[];
- }
-
- class AmazonWebServiceRequest;
-
- namespace Client
- {
- template<typename ERROR_TYPE>
- class AWSError;
- class AWSErrorMarshaller;
- class AWSRestfulJsonErrorMarshaller;
- class AWSAuthSigner;
- struct ClientConfiguration;
- class RetryStrategy;
-
- typedef Utils::Outcome<std::shared_ptr<Aws::Http::HttpResponse>, AWSError<CoreErrors>> HttpResponseOutcome;
- typedef Utils::Outcome<AmazonWebServiceResult<Utils::Stream::ResponseStream>, AWSError<CoreErrors>> StreamOutcome;
-
- /**
- * Abstract AWS Client. Contains most of the functionality necessary to build an http request, get it signed, and send it accross the wire.
- */
- class AWS_CORE_API AWSClient
- {
- public:
- /**
- * configuration will be used for http client settings, retry strategy, throttles, and signing information.
- * supplied signer will be used for all requests, aws sdk clients will use default AuthV4Signer.
- * errorMarshaller tells the client how to convert error payloads into AWSError objects.
- */
- AWSClient(const Aws::Client::ClientConfiguration& configuration,
- const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer,
- const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
-
- /**
- * Configuration will be used for http client settings, retry strategy, throttles, and signing information.
- * Pass a signer provider to determine the proper signer for a given request; AWS services will use
- * SigV4 signer. errorMarshaller tells the client how to convert error payloads into AWSError objects.
- */
- AWSClient(const Aws::Client::ClientConfiguration& configuration,
- const std::shared_ptr<Aws::Auth::AWSAuthSignerProvider>& signerProvider,
- const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
-
- virtual ~AWSClient() { };
-
- /**
+namespace Aws
+{
+ namespace Utils
+ {
+ template<typename R, typename E>
+ class Outcome;
+
+ namespace Xml
+ {
+ class XmlDocument;
+ } // namespace Xml
+
+ namespace Json
+ {
+ class JsonValue;
+ } // namespace Json
+
+ namespace RateLimits
+ {
+ class RateLimiterInterface;
+ } // namespace RateLimits
+
+ namespace Crypto
+ {
+ class MD5;
+ } // namespace Crypto
+ } // namespace Utils
+
+ namespace Http
+ {
+ class HttpClient;
+
+ class HttpClientFactory;
+
+ class HttpRequest;
+
+ class HttpResponse;
+
+ class URI;
+ } // namespace Http
+
+ namespace Auth
+ {
+ AWS_CORE_API extern const char SIGV4_SIGNER[];
+ AWS_CORE_API extern const char NULL_SIGNER[];
+ }
+
+ class AmazonWebServiceRequest;
+
+ namespace Client
+ {
+ template<typename ERROR_TYPE>
+ class AWSError;
+ class AWSErrorMarshaller;
+ class AWSRestfulJsonErrorMarshaller;
+ class AWSAuthSigner;
+ struct ClientConfiguration;
+ class RetryStrategy;
+
+ typedef Utils::Outcome<std::shared_ptr<Aws::Http::HttpResponse>, AWSError<CoreErrors>> HttpResponseOutcome;
+ typedef Utils::Outcome<AmazonWebServiceResult<Utils::Stream::ResponseStream>, AWSError<CoreErrors>> StreamOutcome;
+
+ /**
+ * Abstract AWS Client. Contains most of the functionality necessary to build an http request, get it signed, and send it accross the wire.
+ */
+ class AWS_CORE_API AWSClient
+ {
+ public:
+ /**
+ * configuration will be used for http client settings, retry strategy, throttles, and signing information.
+ * supplied signer will be used for all requests, aws sdk clients will use default AuthV4Signer.
+ * errorMarshaller tells the client how to convert error payloads into AWSError objects.
+ */
+ AWSClient(const Aws::Client::ClientConfiguration& configuration,
+ const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer,
+ const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
+
+ /**
+ * Configuration will be used for http client settings, retry strategy, throttles, and signing information.
+ * Pass a signer provider to determine the proper signer for a given request; AWS services will use
+ * SigV4 signer. errorMarshaller tells the client how to convert error payloads into AWSError objects.
+ */
+ AWSClient(const Aws::Client::ClientConfiguration& configuration,
+ const std::shared_ptr<Aws::Auth::AWSAuthSignerProvider>& signerProvider,
+ const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
+
+ virtual ~AWSClient() { };
+
+ /**
* Generates a signed Uri using the injected signer. for the supplied uri and http method. expirationInSeconds defaults
- * to 0 which is the default 7 days. The implication of this function is using auth signer v4 to sign it.
- */
- Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, long long expirationInSeconds = 0);
-
- /**
+ * to 0 which is the default 7 days. The implication of this function is using auth signer v4 to sign it.
+ */
+ Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, long long expirationInSeconds = 0);
+
+ /**
* Generates a signed Uri using the injected signer. for the supplied uri, http method and customized headers. expirationInSeconds defaults
- * to 0 which is the default 7 days. The implication of this function is using auth signer v4 to sign it.
- */
- Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds = 0);
-
- /**
+ * to 0 which is the default 7 days. The implication of this function is using auth signer v4 to sign it.
+ */
+ Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds = 0);
+
+ /**
* Generates a signed Uri using the injected signer. for the supplied uri and http method and region. expirationInSeconds defaults
* to 0 which is the default 7 days.
*/
- Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, long long expirationInSeconds = 0) const;
-
- /**
+ Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, long long expirationInSeconds = 0) const;
+
+ /**
* Generates a signed Uri using the injected signer. for the supplied uri, http method and customized headers. expirationInSeconds defaults
* to 0 which is the default 7 days.
*/
@@ -133,8 +133,8 @@ namespace Aws
* Generates a signed Uri using the injected signer. for the supplied uri and http method, region, and service name. expirationInSeconds defaults
* to 0 which is the default 7 days.
*/
- Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName, long long expirationInSeconds = 0) const;
-
+ Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName, long long expirationInSeconds = 0) const;
+
/**
* Generates a signed Uri using the injected signer. for the supplied uri, http method and customized headers. expirationInSeconds defaults
* to 0 which is the default 7 days.
@@ -142,25 +142,25 @@ namespace Aws
Aws::String GeneratePresignedUrl(Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName, const Aws::Http::HeaderValueCollection& customizedHeaders, long long expirationInSeconds = 0);
Aws::String GeneratePresignedUrl(const Aws::AmazonWebServiceRequest& request, Aws::Http::URI& uri, Aws::Http::HttpMethod method,
- const Aws::Http::QueryStringParameterCollection& extraParams = Aws::Http::QueryStringParameterCollection(), long long expirationInSeconds = 0) const;
-
- Aws::String GeneratePresignedUrl(const Aws::AmazonWebServiceRequest& request, Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName,
- const Aws::Http::QueryStringParameterCollection& extraParams = Aws::Http::QueryStringParameterCollection(), long long expirationInSeconds = 0) const;
-
- Aws::String GeneratePresignedUrl(const Aws::AmazonWebServiceRequest& request, Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region,
- const Aws::Http::QueryStringParameterCollection& extraParams = Aws::Http::QueryStringParameterCollection(), long long expirationInSeconds = 0) const;
-
- /**
- * Stop all requests immediately.
- * In flight requests will likely fail.
- */
- void DisableRequestProcessing();
-
- /**
- * Enable/ReEnable requests.
- */
- void EnableRequestProcessing();
-
+ const Aws::Http::QueryStringParameterCollection& extraParams = Aws::Http::QueryStringParameterCollection(), long long expirationInSeconds = 0) const;
+
+ Aws::String GeneratePresignedUrl(const Aws::AmazonWebServiceRequest& request, Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region, const char* serviceName,
+ const Aws::Http::QueryStringParameterCollection& extraParams = Aws::Http::QueryStringParameterCollection(), long long expirationInSeconds = 0) const;
+
+ Aws::String GeneratePresignedUrl(const Aws::AmazonWebServiceRequest& request, Aws::Http::URI& uri, Aws::Http::HttpMethod method, const char* region,
+ const Aws::Http::QueryStringParameterCollection& extraParams = Aws::Http::QueryStringParameterCollection(), long long expirationInSeconds = 0) const;
+
+ /**
+ * Stop all requests immediately.
+ * In flight requests will likely fail.
+ */
+ void DisableRequestProcessing();
+
+ /**
+ * Enable/ReEnable requests.
+ */
+ void EnableRequestProcessing();
+
inline virtual const char* GetServiceClientName() const { return m_serviceName.c_str(); }
/**
* service client name is part of userAgent.
@@ -168,106 +168,106 @@ namespace Aws
* Note: this API should only be called in your extended class constructors.
*/
virtual void SetServiceClientName(const Aws::String& name);
-
- protected:
- /**
+
+ protected:
+ /**
* Calls AttemptOneRequest until it either, succeeds, runs out of retries from the retry strategy,
- * or encounters and error that is not retryable.
- */
- HttpResponseOutcome AttemptExhaustively(const Aws::Http::URI& uri,
- const Aws::AmazonWebServiceRequest& request,
- Http::HttpMethod httpMethod,
+ * or encounters and error that is not retryable.
+ */
+ HttpResponseOutcome AttemptExhaustively(const Aws::Http::URI& uri,
+ const Aws::AmazonWebServiceRequest& request,
+ Http::HttpMethod httpMethod,
const char* signerName,
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const;
-
- /**
+
+ /**
* Calls AttemptOneRequest until it either, succeeds, runs out of retries from the retry strategy,
- * or encounters and error that is not retryable. This method is for payloadless requests e.g. GET, DELETE, HEAD
+ * or encounters and error that is not retryable. This method is for payloadless requests e.g. GET, DELETE, HEAD
*
* requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid
* name.
- */
+ */
HttpResponseOutcome AttemptExhaustively(const Aws::Http::URI& uri,
- Http::HttpMethod httpMethod,
- const char* signerName,
+ Http::HttpMethod httpMethod,
+ const char* signerName,
const char* requestName = "",
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const;
-
- /**
- * Build an Http Request from the AmazonWebServiceRequest object. Signs the request, sends it accross the wire
- * then reports the http response.
- */
- HttpResponseOutcome AttemptOneRequest(const std::shared_ptr<Http::HttpRequest>& httpRequest,
- const Aws::AmazonWebServiceRequest& request,
+
+ /**
+ * Build an Http Request from the AmazonWebServiceRequest object. Signs the request, sends it accross the wire
+ * then reports the http response.
+ */
+ HttpResponseOutcome AttemptOneRequest(const std::shared_ptr<Http::HttpRequest>& httpRequest,
+ const Aws::AmazonWebServiceRequest& request,
const char* signerName,
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const;
-
- /**
- * Signs an Http Request, sends it accross the wire
- * then reports the http response. This method is for payloadless requests e.g. GET, DELETE, HEAD
+
+ /**
+ * Signs an Http Request, sends it accross the wire
+ * then reports the http response. This method is for payloadless requests e.g. GET, DELETE, HEAD
*
* requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid
* name.
- */
- HttpResponseOutcome AttemptOneRequest(const std::shared_ptr<Http::HttpRequest>& httpRequest,
- const char* signerName,
+ */
+ HttpResponseOutcome AttemptOneRequest(const std::shared_ptr<Http::HttpRequest>& httpRequest,
+ const char* signerName,
const char* requestName = "",
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const;
-
- /**
- * This is used for structureless response payloads (file streams, binary data etc...). It calls AttemptExhaustively, but upon
- * return transfers ownership of the underlying stream for the http response to the caller.
- */
- StreamOutcome MakeRequestWithUnparsedResponse(const Aws::Http::URI& uri,
- const Aws::AmazonWebServiceRequest& request,
- Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
+
+ /**
+ * This is used for structureless response payloads (file streams, binary data etc...). It calls AttemptExhaustively, but upon
+ * return transfers ownership of the underlying stream for the http response to the caller.
+ */
+ StreamOutcome MakeRequestWithUnparsedResponse(const Aws::Http::URI& uri,
+ const Aws::AmazonWebServiceRequest& request,
+ Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
const char* signerName = Aws::Auth::SIGV4_SIGNER,
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const;
-
- /**
- * This is used for structureless response payloads (file streams, binary data etc...). It calls AttemptExhaustively, but upon
- * return transfers ownership of the underlying stream for the http response to the caller.
+
+ /**
+ * This is used for structureless response payloads (file streams, binary data etc...). It calls AttemptExhaustively, but upon
+ * return transfers ownership of the underlying stream for the http response to the caller.
*
* requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid
* name.
- */
- StreamOutcome MakeRequestWithUnparsedResponse(const Aws::Http::URI& uri,
- Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
- const char* signerName = Aws::Auth::SIGV4_SIGNER,
+ */
+ StreamOutcome MakeRequestWithUnparsedResponse(const Aws::Http::URI& uri,
+ Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
+ const char* signerName = Aws::Auth::SIGV4_SIGNER,
const char* requestName = "",
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const;
-
- /**
- * Abstract. Subclassing clients should override this to tell the client how to marshall error payloads
- */
- virtual AWSError<CoreErrors> BuildAWSError(const std::shared_ptr<Aws::Http::HttpResponse>& response) const = 0;
-
- /**
- * Transforms the AmazonWebServicesResult object into an HttpRequest.
- */
- virtual void BuildHttpRequest(const Aws::AmazonWebServiceRequest& request,
- const std::shared_ptr<Aws::Http::HttpRequest>& httpRequest) const;
-
- /**
- * Gets the underlying ErrorMarshaller for subclasses to use.
- */
- const std::shared_ptr<AWSErrorMarshaller>& GetErrorMarshaller() const
- {
- return m_errorMarshaller;
- }
-
- /**
+
+ /**
+ * Abstract. Subclassing clients should override this to tell the client how to marshall error payloads
+ */
+ virtual AWSError<CoreErrors> BuildAWSError(const std::shared_ptr<Aws::Http::HttpResponse>& response) const = 0;
+
+ /**
+ * Transforms the AmazonWebServicesResult object into an HttpRequest.
+ */
+ virtual void BuildHttpRequest(const Aws::AmazonWebServiceRequest& request,
+ const std::shared_ptr<Aws::Http::HttpRequest>& httpRequest) const;
+
+ /**
+ * Gets the underlying ErrorMarshaller for subclasses to use.
+ */
+ const std::shared_ptr<AWSErrorMarshaller>& GetErrorMarshaller() const
+ {
+ return m_errorMarshaller;
+ }
+
+ /**
* Gets the corresponding signer from the signers map by name.
- */
- Aws::Client::AWSAuthSigner* GetSignerByName(const char* name) const;
+ */
+ Aws::Client::AWSAuthSigner* GetSignerByName(const char* name) const;
protected:
-
+
/**
* Creates an HttpRequest instance with the given URI and sets the proper headers from the
* AmazonWebRequest, and finally signs that request with the given the signer.
@@ -284,154 +284,154 @@ namespace Aws
*/
std::shared_ptr<Aws::Http::HttpResponse> MakeHttpRequest(std::shared_ptr<Aws::Http::HttpRequest>& request) const;
Aws::String m_region;
- private:
- /**
- * Try to adjust signer's clock
- * return true if signer's clock is adjusted, false otherwise.
- */
- bool AdjustClockSkew(HttpResponseOutcome& outcome, const char* signerName) const;
- void AddHeadersToRequest(const std::shared_ptr<Aws::Http::HttpRequest>& httpRequest, const Http::HeaderValueCollection& headerValues) const;
+ private:
+ /**
+ * Try to adjust signer's clock
+ * return true if signer's clock is adjusted, false otherwise.
+ */
+ bool AdjustClockSkew(HttpResponseOutcome& outcome, const char* signerName) const;
+ void AddHeadersToRequest(const std::shared_ptr<Aws::Http::HttpRequest>& httpRequest, const Http::HeaderValueCollection& headerValues) const;
void AddContentBodyToRequest(const std::shared_ptr<Aws::Http::HttpRequest>& httpRequest, const std::shared_ptr<Aws::IOStream>& body,
bool needsContentMd5 = false, bool isChunked = false) const;
- void AddCommonHeaders(Aws::Http::HttpRequest& httpRequest) const;
- void InitializeGlobalStatics();
- std::shared_ptr<Aws::Http::HttpRequest> ConvertToRequestForPresigning(const Aws::AmazonWebServiceRequest& request, Aws::Http::URI& uri,
- Aws::Http::HttpMethod method, const Aws::Http::QueryStringParameterCollection& extraParams) const;
-
- std::shared_ptr<Aws::Http::HttpClient> m_httpClient;
- std::shared_ptr<Aws::Auth::AWSAuthSignerProvider> m_signerProvider;
- std::shared_ptr<AWSErrorMarshaller> m_errorMarshaller;
- std::shared_ptr<RetryStrategy> m_retryStrategy;
- std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> m_writeRateLimiter;
- std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> m_readRateLimiter;
- Aws::String m_userAgent;
+ void AddCommonHeaders(Aws::Http::HttpRequest& httpRequest) const;
+ void InitializeGlobalStatics();
+ std::shared_ptr<Aws::Http::HttpRequest> ConvertToRequestForPresigning(const Aws::AmazonWebServiceRequest& request, Aws::Http::URI& uri,
+ Aws::Http::HttpMethod method, const Aws::Http::QueryStringParameterCollection& extraParams) const;
+
+ std::shared_ptr<Aws::Http::HttpClient> m_httpClient;
+ std::shared_ptr<Aws::Auth::AWSAuthSignerProvider> m_signerProvider;
+ std::shared_ptr<AWSErrorMarshaller> m_errorMarshaller;
+ std::shared_ptr<RetryStrategy> m_retryStrategy;
+ std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> m_writeRateLimiter;
+ std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> m_readRateLimiter;
+ Aws::String m_userAgent;
bool m_customizedUserAgent;
- std::shared_ptr<Aws::Utils::Crypto::Hash> m_hash;
+ std::shared_ptr<Aws::Utils::Crypto::Hash> m_hash;
long m_requestTimeoutMs;
- bool m_enableClockSkewAdjustment;
+ bool m_enableClockSkewAdjustment;
Aws::String m_serviceName;
- };
-
- typedef Utils::Outcome<AmazonWebServiceResult<Utils::Json::JsonValue>, AWSError<CoreErrors>> JsonOutcome;
+ };
+
+ typedef Utils::Outcome<AmazonWebServiceResult<Utils::Json::JsonValue>, AWSError<CoreErrors>> JsonOutcome;
AWS_CORE_API Aws::String GetAuthorizationHeader(const Aws::Http::HttpRequest& httpRequest);
-
- /**
- * AWSClient that handles marshalling json response bodies. You would inherit from this class
- * to create a client that uses Json as its payload format.
- */
- class AWS_CORE_API AWSJsonClient : public AWSClient
- {
- public:
- typedef AWSClient BASECLASS;
-
- /**
- * Simply calls AWSClient constructor.
- */
- AWSJsonClient(const Aws::Client::ClientConfiguration& configuration,
- const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer,
- const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
-
- /**
- * Simply calls AWSClient constructor.
- */
- AWSJsonClient(const Aws::Client::ClientConfiguration& configuration,
- const std::shared_ptr<Aws::Auth::AWSAuthSignerProvider>& signerProvider,
- const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
-
- virtual ~AWSJsonClient() = default;
-
- protected:
- /**
- * Converts/Parses an http response into a meaningful AWSError object using the json message structure.
- */
- virtual AWSError<CoreErrors> BuildAWSError(const std::shared_ptr<Aws::Http::HttpResponse>& response) const override;
-
- /**
- * Returns a Json document or an error from the request. Does some marshalling json and raw streams,
- * then just calls AttemptExhaustively.
- *
- * method defaults to POST
- */
- JsonOutcome MakeRequest(const Aws::Http::URI& uri,
- const Aws::AmazonWebServiceRequest& request,
- Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
+
+ /**
+ * AWSClient that handles marshalling json response bodies. You would inherit from this class
+ * to create a client that uses Json as its payload format.
+ */
+ class AWS_CORE_API AWSJsonClient : public AWSClient
+ {
+ public:
+ typedef AWSClient BASECLASS;
+
+ /**
+ * Simply calls AWSClient constructor.
+ */
+ AWSJsonClient(const Aws::Client::ClientConfiguration& configuration,
+ const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer,
+ const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
+
+ /**
+ * Simply calls AWSClient constructor.
+ */
+ AWSJsonClient(const Aws::Client::ClientConfiguration& configuration,
+ const std::shared_ptr<Aws::Auth::AWSAuthSignerProvider>& signerProvider,
+ const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
+
+ virtual ~AWSJsonClient() = default;
+
+ protected:
+ /**
+ * Converts/Parses an http response into a meaningful AWSError object using the json message structure.
+ */
+ virtual AWSError<CoreErrors> BuildAWSError(const std::shared_ptr<Aws::Http::HttpResponse>& response) const override;
+
+ /**
+ * Returns a Json document or an error from the request. Does some marshalling json and raw streams,
+ * then just calls AttemptExhaustively.
+ *
+ * method defaults to POST
+ */
+ JsonOutcome MakeRequest(const Aws::Http::URI& uri,
+ const Aws::AmazonWebServiceRequest& request,
+ Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
const char* signerName = Aws::Auth::SIGV4_SIGNER,
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const;
-
- /**
- * Returns a Json document or an error from the request. Does some marshalling json and raw streams,
- * then just calls AttemptExhaustively.
- *
+
+ /**
+ * Returns a Json document or an error from the request. Does some marshalling json and raw streams,
+ * then just calls AttemptExhaustively.
+ *
* requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid
* name.
*
- * method defaults to POST
- */
- JsonOutcome MakeRequest(const Aws::Http::URI& uri,
- Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
- const char* signerName = Aws::Auth::SIGV4_SIGNER,
+ * method defaults to POST
+ */
+ JsonOutcome MakeRequest(const Aws::Http::URI& uri,
+ Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
+ const char* signerName = Aws::Auth::SIGV4_SIGNER,
const char* requestName = "",
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const;
JsonOutcome MakeEventStreamRequest(std::shared_ptr<Aws::Http::HttpRequest>& request) const;
- };
-
- typedef Utils::Outcome<AmazonWebServiceResult<Utils::Xml::XmlDocument>, AWSError<CoreErrors>> XmlOutcome;
-
- /**
- * AWSClient that handles marshalling xml response bodies. You would inherit from this class
- * to create a client that uses Xml as its payload format.
- */
- class AWS_CORE_API AWSXMLClient : public AWSClient
- {
- public:
-
- typedef AWSClient BASECLASS;
-
- AWSXMLClient(const Aws::Client::ClientConfiguration& configuration,
- const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer,
- const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
-
- AWSXMLClient(const Aws::Client::ClientConfiguration& configuration,
- const std::shared_ptr<Aws::Auth::AWSAuthSignerProvider>& signerProvider,
- const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
-
- virtual ~AWSXMLClient() = default;
-
- protected:
- /**
- * Converts/Parses an http response into a meaningful AWSError object. Using the XML message structure.
- */
- virtual AWSError<CoreErrors> BuildAWSError(const std::shared_ptr<Aws::Http::HttpResponse>& response) const override;
-
- /**
- * Returns an xml document or an error from the request. Does some marshalling xml and raw streams,
- * then just calls AttemptExhaustively.
- *
- * method defaults to POST
- */
- XmlOutcome MakeRequest(const Aws::Http::URI& uri,
- const Aws::AmazonWebServiceRequest& request,
- Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
+ };
+
+ typedef Utils::Outcome<AmazonWebServiceResult<Utils::Xml::XmlDocument>, AWSError<CoreErrors>> XmlOutcome;
+
+ /**
+ * AWSClient that handles marshalling xml response bodies. You would inherit from this class
+ * to create a client that uses Xml as its payload format.
+ */
+ class AWS_CORE_API AWSXMLClient : public AWSClient
+ {
+ public:
+
+ typedef AWSClient BASECLASS;
+
+ AWSXMLClient(const Aws::Client::ClientConfiguration& configuration,
+ const std::shared_ptr<Aws::Client::AWSAuthSigner>& signer,
+ const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
+
+ AWSXMLClient(const Aws::Client::ClientConfiguration& configuration,
+ const std::shared_ptr<Aws::Auth::AWSAuthSignerProvider>& signerProvider,
+ const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);
+
+ virtual ~AWSXMLClient() = default;
+
+ protected:
+ /**
+ * Converts/Parses an http response into a meaningful AWSError object. Using the XML message structure.
+ */
+ virtual AWSError<CoreErrors> BuildAWSError(const std::shared_ptr<Aws::Http::HttpResponse>& response) const override;
+
+ /**
+ * Returns an xml document or an error from the request. Does some marshalling xml and raw streams,
+ * then just calls AttemptExhaustively.
+ *
+ * method defaults to POST
+ */
+ XmlOutcome MakeRequest(const Aws::Http::URI& uri,
+ const Aws::AmazonWebServiceRequest& request,
+ Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
const char* signerName = Aws::Auth::SIGV4_SIGNER,
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const;
-
-
- /**
- * Returns an xml document or an error from the request. Does some marshalling xml and raw streams,
- * then just calls AttemptExhaustively.
- *
+
+
+ /**
+ * Returns an xml document or an error from the request. Does some marshalling xml and raw streams,
+ * then just calls AttemptExhaustively.
+ *
* requestName is used for metrics and defaults to empty string, to avoid empty names in metrics provide a valid
* name.
*
- * method defaults to POST
- */
- XmlOutcome MakeRequest(const Aws::Http::URI& uri,
- Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
- const char* signerName = Aws::Auth::SIGV4_SIGNER,
+ * method defaults to POST
+ */
+ XmlOutcome MakeRequest(const Aws::Http::URI& uri,
+ Http::HttpMethod method = Http::HttpMethod::HTTP_POST,
+ const char* signerName = Aws::Auth::SIGV4_SIGNER,
const char* requestName = "",
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const;
@@ -457,7 +457,7 @@ namespace Aws
const char* requestName = "",
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const;
- };
-
- } // namespace Client
-} // namespace Aws
+ };
+
+ } // namespace Client
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSError.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSError.h
index 0919684698..c88c1bdd5d 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSError.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSError.h
@@ -2,21 +2,21 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/http/HttpResponse.h>
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/http/HttpResponse.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/json/JsonSerializer.h>
-#include <aws/core/utils/StringUtils.h>
-
-namespace Aws
-{
- namespace Client
- {
- enum class CoreErrors;
+#include <aws/core/utils/StringUtils.h>
+
+namespace Aws
+{
+ namespace Client
+ {
+ enum class CoreErrors;
class XmlErrorMarshaller;
class JsonErrorMarshaller;
@@ -27,35 +27,35 @@ namespace Aws
JSON
};
- /**
- * Container for Error enumerations with additional exception information. Name, message, retryable etc....
- */
- template<typename ERROR_TYPE>
- class AWSError
- {
+ /**
+ * Container for Error enumerations with additional exception information. Name, message, retryable etc....
+ */
+ template<typename ERROR_TYPE>
+ class AWSError
+ {
// Allow ErrorMarshaller to set error payload.
friend class XmlErrorMarshaller;
friend class JsonErrorMarshaller;
template<typename T> friend class AWSError;
- public:
- /**
- * Initializes AWSError object as empty with the error not being retryable.
- */
+ public:
+ /**
+ * Initializes AWSError object as empty with the error not being retryable.
+ */
AWSError() : m_responseCode(Aws::Http::HttpResponseCode::REQUEST_NOT_MADE), m_isRetryable(false) {}
- /**
- * Initializes AWSError object with errorType, exceptionName, message, and retryable flag.
- */
- AWSError(ERROR_TYPE errorType, Aws::String exceptionName, const Aws::String message, bool isRetryable) :
+ /**
+ * Initializes AWSError object with errorType, exceptionName, message, and retryable flag.
+ */
+ AWSError(ERROR_TYPE errorType, Aws::String exceptionName, const Aws::String message, bool isRetryable) :
m_errorType(errorType), m_exceptionName(exceptionName), m_message(message),
m_responseCode(Aws::Http::HttpResponseCode::REQUEST_NOT_MADE), m_isRetryable(isRetryable),
m_errorPayloadType(ErrorPayloadType::NOT_SET) {}
- /**
- * Initializes AWSError object with errorType and retryable flag. ExceptionName and message are empty.
- */
- AWSError(ERROR_TYPE errorType, bool isRetryable) :
+ /**
+ * Initializes AWSError object with errorType and retryable flag. ExceptionName and message are empty.
+ */
+ AWSError(ERROR_TYPE errorType, bool isRetryable) :
m_errorType(errorType), m_responseCode(Aws::Http::HttpResponseCode::REQUEST_NOT_MADE),
m_isRetryable(isRetryable), m_errorPayloadType(ErrorPayloadType::NOT_SET) {}
-
+
AWSError(AWSError&& rhs) = default;
AWSError(const AWSError& rhs) = default;
@@ -66,8 +66,8 @@ namespace Aws
m_requestId(std::move(rhs.m_requestId)), m_responseHeaders(std::move(rhs.m_responseHeaders)),
m_responseCode(rhs.m_responseCode), m_isRetryable(rhs.m_isRetryable), m_errorPayloadType(rhs.m_errorPayloadType),
m_xmlPayload(std::move(rhs.m_xmlPayload)), m_jsonPayload(std::move(rhs.m_jsonPayload))
- {}
-
+ {}
+
template<typename OTHER_ERROR_TYPE>
AWSError(const AWSError<OTHER_ERROR_TYPE>& rhs) :
m_errorType(static_cast<ERROR_TYPE>(rhs.m_errorType)), m_exceptionName(rhs.m_exceptionName),
@@ -77,7 +77,7 @@ namespace Aws
m_xmlPayload(rhs.m_xmlPayload), m_jsonPayload(rhs.m_jsonPayload)
{}
- /**
+ /**
* Copy assignment operator
*/
AWSError& operator=(const AWSError<ERROR_TYPE>&) = default;
@@ -88,26 +88,26 @@ namespace Aws
AWSError& operator=(AWSError<ERROR_TYPE>&& other) = default;
/**
- * Gets underlying errorType.
- */
- inline const ERROR_TYPE GetErrorType() const { return m_errorType; }
- /**
- * Gets the underlying ExceptionName.
- */
- inline const Aws::String& GetExceptionName() const { return m_exceptionName; }
- /**
- *Sets the underlying ExceptionName.
- */
- inline void SetExceptionName(const Aws::String& exceptionName) { m_exceptionName = exceptionName; }
- /**
- * Gets the error message.
- */
- inline const Aws::String& GetMessage() const { return m_message; }
- /**
- * Sets the error message
- */
- inline void SetMessage(const Aws::String& message) { m_message = message; }
- /**
+ * Gets underlying errorType.
+ */
+ inline const ERROR_TYPE GetErrorType() const { return m_errorType; }
+ /**
+ * Gets the underlying ExceptionName.
+ */
+ inline const Aws::String& GetExceptionName() const { return m_exceptionName; }
+ /**
+ *Sets the underlying ExceptionName.
+ */
+ inline void SetExceptionName(const Aws::String& exceptionName) { m_exceptionName = exceptionName; }
+ /**
+ * Gets the error message.
+ */
+ inline const Aws::String& GetMessage() const { return m_message; }
+ /**
+ * Sets the error message
+ */
+ inline void SetMessage(const Aws::String& message) { m_message = message; }
+ /**
* Gets the resolved remote host IP address.
* This value is only available after DNS resolution and with CURL http client right now.
* Otherwise an empty string is returned.
@@ -128,30 +128,30 @@ namespace Aws
*/
inline void SetRequestId(const Aws::String& requestId) { m_requestId = requestId; }
/**
- * Returns whether or not this error is eligible for retry.
- */
- inline bool ShouldRetry() const { return m_isRetryable; }
- /**
- * Gets the response headers from the http response.
- */
- inline const Aws::Http::HeaderValueCollection& GetResponseHeaders() const { return m_responseHeaders; }
- /**
- * Sets the response headers from the http response.
- */
- inline void SetResponseHeaders(const Aws::Http::HeaderValueCollection& headers) { m_responseHeaders = headers; }
- /**
- * Tests whether or not a header exists.
- */
- inline bool ResponseHeaderExists(const Aws::String& headerName) const { return m_responseHeaders.find(Aws::Utils::StringUtils::ToLower(headerName.c_str())) != m_responseHeaders.end(); }
- /**
- * Gets the response code from the http response
- */
- inline Aws::Http::HttpResponseCode GetResponseCode() const { return m_responseCode; }
- /**
- * Sets the response code from the http response
- */
- inline void SetResponseCode(Aws::Http::HttpResponseCode responseCode) { m_responseCode = responseCode; }
-
+ * Returns whether or not this error is eligible for retry.
+ */
+ inline bool ShouldRetry() const { return m_isRetryable; }
+ /**
+ * Gets the response headers from the http response.
+ */
+ inline const Aws::Http::HeaderValueCollection& GetResponseHeaders() const { return m_responseHeaders; }
+ /**
+ * Sets the response headers from the http response.
+ */
+ inline void SetResponseHeaders(const Aws::Http::HeaderValueCollection& headers) { m_responseHeaders = headers; }
+ /**
+ * Tests whether or not a header exists.
+ */
+ inline bool ResponseHeaderExists(const Aws::String& headerName) const { return m_responseHeaders.find(Aws::Utils::StringUtils::ToLower(headerName.c_str())) != m_responseHeaders.end(); }
+ /**
+ * Gets the response code from the http response
+ */
+ inline Aws::Http::HttpResponseCode GetResponseCode() const { return m_responseCode; }
+ /**
+ * Sets the response code from the http response
+ */
+ inline void SetResponseCode(Aws::Http::HttpResponseCode responseCode) { m_responseCode = responseCode; }
+
protected:
inline ErrorPayloadType GetErrorPayloadType() { return m_errorPayloadType; }
inline void SetXmlPayload(const Aws::Utils::Xml::XmlDocument& xmlPayload)
@@ -185,36 +185,36 @@ namespace Aws
return m_jsonPayload;
}
- ERROR_TYPE m_errorType;
- Aws::String m_exceptionName;
- Aws::String m_message;
+ ERROR_TYPE m_errorType;
+ Aws::String m_exceptionName;
+ Aws::String m_message;
Aws::String m_remoteHostIpAddress;
Aws::String m_requestId;
- Aws::Http::HeaderValueCollection m_responseHeaders;
- Aws::Http::HttpResponseCode m_responseCode;
- bool m_isRetryable;
+ Aws::Http::HeaderValueCollection m_responseHeaders;
+ Aws::Http::HttpResponseCode m_responseCode;
+ bool m_isRetryable;
ErrorPayloadType m_errorPayloadType;
Aws::Utils::Xml::XmlDocument m_xmlPayload;
Aws::Utils::Json::JsonValue m_jsonPayload;
- };
-
- template<typename T>
- Aws::OStream& operator << (Aws::OStream& s, const AWSError<T>& e)
- {
- s << "HTTP response code: " << static_cast<int>(e.GetResponseCode()) << "\n"
+ };
+
+ template<typename T>
+ Aws::OStream& operator << (Aws::OStream& s, const AWSError<T>& e)
+ {
+ s << "HTTP response code: " << static_cast<int>(e.GetResponseCode()) << "\n"
<< "Resolved remote host IP address: " << e.GetRemoteHostIpAddress() << "\n"
<< "Request ID: " << e.GetRequestId() << "\n"
- << "Exception name: " << e.GetExceptionName() << "\n"
- << "Error message: " << e.GetMessage() << "\n"
- << e.GetResponseHeaders().size() << " response headers:";
-
- for (auto&& header : e.GetResponseHeaders())
- {
- s << "\n" << header.first << " : " << header.second;
- }
- return s;
- }
-
- } // namespace Client
-} // namespace Aws
+ << "Exception name: " << e.GetExceptionName() << "\n"
+ << "Error message: " << e.GetMessage() << "\n"
+ << e.GetResponseHeaders().size() << " response headers:";
+
+ for (auto&& header : e.GetResponseHeaders())
+ {
+ s << "\n" << header.first << " : " << header.second;
+ }
+ return s;
+ }
+
+ } // namespace Client
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSErrorMarshaller.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSErrorMarshaller.h
index f86076227e..628b9565fd 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSErrorMarshaller.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSErrorMarshaller.h
@@ -2,20 +2,20 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace Http
- {
- class HttpResponse;
- enum class HttpResponseCode;
- }
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace Http
+ {
+ class HttpResponse;
+ enum class HttpResponseCode;
+ }
+
namespace Utils
{
namespace Xml
@@ -28,31 +28,31 @@ namespace Aws
}
}
- namespace Client
- {
- enum class CoreErrors;
-
- template<typename ERROR_TYPE>
- class AWSError;
-
- /**
- * Marshaller for core error types.
- */
- class AWS_CORE_API AWSErrorMarshaller
- {
+ namespace Client
+ {
+ enum class CoreErrors;
+
+ template<typename ERROR_TYPE>
+ class AWSError;
+
+ /**
+ * Marshaller for core error types.
+ */
+ class AWS_CORE_API AWSErrorMarshaller
+ {
public:
- virtual ~AWSErrorMarshaller() {}
-
- /**
- * Converts an exceptionName and message into an Error object, if it can be parsed. Otherwise, it returns
- * and AWSError with CoreErrors::UNKNOWN as the error type.
- */
- virtual AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const = 0;
- /**
- * Attempts to finds an error code by the exception name. Otherwise returns CoreErrors::UNKNOWN as the error type.
- */
- virtual AWSError<CoreErrors> FindErrorByName(const char* exceptionName) const;
- virtual AWSError<CoreErrors> FindErrorByHttpResponseCode(Aws::Http::HttpResponseCode code) const;
+ virtual ~AWSErrorMarshaller() {}
+
+ /**
+ * Converts an exceptionName and message into an Error object, if it can be parsed. Otherwise, it returns
+ * and AWSError with CoreErrors::UNKNOWN as the error type.
+ */
+ virtual AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const = 0;
+ /**
+ * Attempts to finds an error code by the exception name. Otherwise returns CoreErrors::UNKNOWN as the error type.
+ */
+ virtual AWSError<CoreErrors> FindErrorByName(const char* exceptionName) const;
+ virtual AWSError<CoreErrors> FindErrorByHttpResponseCode(Aws::Http::HttpResponseCode code) const;
/**
* Attempts to extract region from error.
*/
@@ -61,37 +61,37 @@ namespace Aws
* Attempts to extract endpoint from error.
*/
virtual Aws::String ExtractEndpoint(const AWSError<CoreErrors>&) const { return {}; }
- protected:
- AWSError<CoreErrors> Marshall(const Aws::String& exceptionName, const Aws::String& message) const;
- };
-
- class AWS_CORE_API JsonErrorMarshaller : public AWSErrorMarshaller
- {
- using AWSErrorMarshaller::Marshall;
+ protected:
+ AWSError<CoreErrors> Marshall(const Aws::String& exceptionName, const Aws::String& message) const;
+ };
+
+ class AWS_CORE_API JsonErrorMarshaller : public AWSErrorMarshaller
+ {
+ using AWSErrorMarshaller::Marshall;
public:
- /**
- * Converts an exceptionName and message into an Error object, if it can be parsed. Otherwise, it returns
- * and AWSError with CoreErrors::UNKNOWN as the error type.
- */
- AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const override;
+ /**
+ * Converts an exceptionName and message into an Error object, if it can be parsed. Otherwise, it returns
+ * and AWSError with CoreErrors::UNKNOWN as the error type.
+ */
+ AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const override;
protected:
const Aws::Utils::Json::JsonValue& GetJsonPayloadFromError(const AWSError<CoreErrors>&) const;
- };
-
- class AWS_CORE_API XmlErrorMarshaller : public AWSErrorMarshaller
- {
- using AWSErrorMarshaller::Marshall;
+ };
+
+ class AWS_CORE_API XmlErrorMarshaller : public AWSErrorMarshaller
+ {
+ using AWSErrorMarshaller::Marshall;
public:
- /**
- * Converts an exceptionName and message into an Error object, if it can be parsed. Otherwise, it returns
- * and AWSError with CoreErrors::UNKNOWN as the error type.
- */
- AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const override;
+ /**
+ * Converts an exceptionName and message into an Error object, if it can be parsed. Otherwise, it returns
+ * and AWSError with CoreErrors::UNKNOWN as the error type.
+ */
+ AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const override;
protected:
const Aws::Utils::Xml::XmlDocument& GetXmlPayloadFromError(const AWSError<CoreErrors>&) const;
- };
-
- } // namespace Client
-} // namespace Aws
+ };
+
+ } // namespace Client
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AsyncCallerContext.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AsyncCallerContext.h
index 933dca67c0..6831791ffc 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AsyncCallerContext.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AsyncCallerContext.h
@@ -2,58 +2,58 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace Client
- {
- /**
- * Call-back context for all async client methods. This allows you to pass a context to your callbacks so that you can identify your requests.
- * It is entirely intended that you override this class in-lieu of using a void* for the user context. The base class just gives you the ability to
- * pass a uuid for your context.
- */
- class AWS_CORE_API AsyncCallerContext
- {
- public:
- /**
- * Initializes object with generated UUID
- */
- AsyncCallerContext();
-
- /**
- * Initializes object with UUID
- */
- AsyncCallerContext(const Aws::String& uuid) : m_uuid(uuid) {}
-
- /**
- * Initializes object with UUID
- */
- AsyncCallerContext(const char* uuid) : m_uuid(uuid) {}
-
- virtual ~AsyncCallerContext() {}
-
- /**
- * Gets underlying UUID
- */
- inline const Aws::String& GetUUID() const { return m_uuid; }
-
- /**
- * Sets underlying UUID
- */
- inline void SetUUID(const Aws::String& value) { m_uuid = value; }
-
- /**
- * Sets underlying UUID
- */
- inline void SetUUID(const char* value) { m_uuid.assign(value); }
-
- private:
- Aws::String m_uuid;
- };
- }
-}
-
+
+#pragma once
+
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace Client
+ {
+ /**
+ * Call-back context for all async client methods. This allows you to pass a context to your callbacks so that you can identify your requests.
+ * It is entirely intended that you override this class in-lieu of using a void* for the user context. The base class just gives you the ability to
+ * pass a uuid for your context.
+ */
+ class AWS_CORE_API AsyncCallerContext
+ {
+ public:
+ /**
+ * Initializes object with generated UUID
+ */
+ AsyncCallerContext();
+
+ /**
+ * Initializes object with UUID
+ */
+ AsyncCallerContext(const Aws::String& uuid) : m_uuid(uuid) {}
+
+ /**
+ * Initializes object with UUID
+ */
+ AsyncCallerContext(const char* uuid) : m_uuid(uuid) {}
+
+ virtual ~AsyncCallerContext() {}
+
+ /**
+ * Gets underlying UUID
+ */
+ inline const Aws::String& GetUUID() const { return m_uuid; }
+
+ /**
+ * Sets underlying UUID
+ */
+ inline void SetUUID(const Aws::String& value) { m_uuid = value; }
+
+ /**
+ * Sets underlying UUID
+ */
+ inline void SetUUID(const char* value) { m_uuid.assign(value); }
+
+ private:
+ Aws::String m_uuid;
+ };
+ }
+}
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h
index 6ffd1fe3fd..ba54baaa83 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h
@@ -2,35 +2,35 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/http/Scheme.h>
-#include <aws/core/Region.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/http/HttpTypes.h>
-#include <memory>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Threading
- {
- class Executor;
- } // namespace Threading
-
- namespace RateLimits
- {
- class RateLimiterInterface;
- } // namespace RateLimits
- } // namespace Utils
- namespace Client
- {
- class RetryStrategy; // forward declare
-
- /**
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/http/Scheme.h>
+#include <aws/core/Region.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/http/HttpTypes.h>
+#include <memory>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Threading
+ {
+ class Executor;
+ } // namespace Threading
+
+ namespace RateLimits
+ {
+ class RateLimiterInterface;
+ } // namespace RateLimits
+ } // namespace Utils
+ namespace Client
+ {
+ class RetryStrategy; // forward declare
+
+ /**
* Sets the behaviors of the underlying HTTP clients handling response with 30x status code.
* By default, HTTP clients will always redirect the 30x response automatically, except when
* specifying aws-global as the client region, then SDK will handle 30x response and redirect
@@ -47,37 +47,37 @@ namespace Aws
* This mutable structure is used to configure any of the AWS clients.
* Default values can only be overwritten prior to passing to the client constructors.
*/
- struct AWS_CORE_API ClientConfiguration
- {
- ClientConfiguration();
+ struct AWS_CORE_API ClientConfiguration
+ {
+ ClientConfiguration();
- /**
+ /**
* Create a configuration based on settings in the aws configuration file for the given profile name.
* The configuration file location can be set via the environment variable AWS_CONFIG_FILE
*/
ClientConfiguration(const char* profileName);
/**
- * User Agent string user for http calls. This is filled in for you in the constructor. Don't override this unless you have a really good reason.
- */
- Aws::String userAgent;
- /**
- * Http scheme to use. E.g. Http or Https. Default HTTPS
- */
- Aws::Http::Scheme scheme;
- /**
- * AWS Region to use in signing requests. Default US_EAST_1
- */
- Aws::String region;
- /**
- * Use dual stack endpoint in the endpoint calculation. It is your responsibility to verify that the service supports ipv6 in the region you select.
- */
- bool useDualStack;
- /**
- * Max concurrent tcp connections for a single http client to use. Default 25.
- */
- unsigned maxConnections;
- /**
+ * User Agent string user for http calls. This is filled in for you in the constructor. Don't override this unless you have a really good reason.
+ */
+ Aws::String userAgent;
+ /**
+ * Http scheme to use. E.g. Http or Https. Default HTTPS
+ */
+ Aws::Http::Scheme scheme;
+ /**
+ * AWS Region to use in signing requests. Default US_EAST_1
+ */
+ Aws::String region;
+ /**
+ * Use dual stack endpoint in the endpoint calculation. It is your responsibility to verify that the service supports ipv6 in the region you select.
+ */
+ bool useDualStack;
+ /**
+ * Max concurrent tcp connections for a single http client to use. Default 25.
+ */
+ unsigned maxConnections;
+ /**
* This is currently only applicable for Curl to set the http request level timeout, including possible dns lookup time, connection establish time, ssl handshake time and actual data transmission time.
* the corresponding Curl option is CURLOPT_TIMEOUT_MS
* defaults to 0, no http request level timeout.
@@ -89,13 +89,13 @@ namespace Aws
* For Curl, it's the low speed time, which contains the time in number milliseconds that transfer speed should be below "lowSpeedLimit" for the library to consider it too slow and abort.
* Note that for Curl this config is converted to seconds by rounding down to the nearest whole second except when the value is greater than 0 and less than 1000. In this case it is set to one second. When it's 0, low speed limit check will be disabled.
* Note that for Windows when this config is 0, the behavior is not specified by Windows.
- */
- long requestTimeoutMs;
- /**
- * Socket connect timeout. Default 1000 ms. Unless you are very far away from your the data center you are talking to. 1000ms is more than sufficient.
- */
- long connectTimeoutMs;
- /**
+ */
+ long requestTimeoutMs;
+ /**
+ * Socket connect timeout. Default 1000 ms. Unless you are very far away from your the data center you are talking to. 1000ms is more than sufficient.
+ */
+ long connectTimeoutMs;
+ /**
* Enable TCP keep-alive. Default true;
* No-op for WinHTTP, WinINet and IXMLHTTPRequest2 client.
*/
@@ -112,34 +112,34 @@ namespace Aws
*/
unsigned long lowSpeedLimit;
/**
- * Strategy to use in case of failed requests. Default is DefaultRetryStrategy (e.g. exponential backoff)
- */
- std::shared_ptr<RetryStrategy> retryStrategy;
- /**
- * Override the http endpoint used to talk to a service.
- */
- Aws::String endpointOverride;
- /**
- * If you have users going through a proxy, set the proxy scheme here. Default HTTP
- */
- Aws::Http::Scheme proxyScheme;
- /**
- * If you have users going through a proxy, set the host here.
- */
- Aws::String proxyHost;
- /**
- * If you have users going through a proxy, set the port here.
- */
- unsigned proxyPort;
- /**
- * If you have users going through a proxy, set the username here.
- */
- Aws::String proxyUserName;
- /**
- * If you have users going through a proxy, set the password here.
- */
- Aws::String proxyPassword;
- /**
+ * Strategy to use in case of failed requests. Default is DefaultRetryStrategy (e.g. exponential backoff)
+ */
+ std::shared_ptr<RetryStrategy> retryStrategy;
+ /**
+ * Override the http endpoint used to talk to a service.
+ */
+ Aws::String endpointOverride;
+ /**
+ * If you have users going through a proxy, set the proxy scheme here. Default HTTP
+ */
+ Aws::Http::Scheme proxyScheme;
+ /**
+ * If you have users going through a proxy, set the host here.
+ */
+ Aws::String proxyHost;
+ /**
+ * If you have users going through a proxy, set the port here.
+ */
+ unsigned proxyPort;
+ /**
+ * If you have users going through a proxy, set the username here.
+ */
+ Aws::String proxyUserName;
+ /**
+ * If you have users going through a proxy, set the password here.
+ */
+ Aws::String proxyPassword;
+ /**
* SSL Certificate file to use for connecting to an HTTPS proxy.
* Used to set CURLOPT_PROXY_SSLCERT in libcurl. Example: client.pem
*/
@@ -165,68 +165,68 @@ namespace Aws
*/
Aws::String proxySSLKeyPassword;
/**
- * Threading Executor implementation. Default uses std::thread::detach()
- */
- std::shared_ptr<Aws::Utils::Threading::Executor> executor;
- /**
- * If you need to test and want to get around TLS validation errors, do that here.
- * you probably shouldn't use this flag in a production scenario.
- */
- bool verifySSL;
- /**
- * If your Certificate Authority path is different from the default, you can tell
- * clients that aren't using the default trust store where to find your CA trust store.
- * If you are on windows or apple, you likely don't want this.
- */
- Aws::String caPath;
- /**
+ * Threading Executor implementation. Default uses std::thread::detach()
+ */
+ std::shared_ptr<Aws::Utils::Threading::Executor> executor;
+ /**
+ * If you need to test and want to get around TLS validation errors, do that here.
+ * you probably shouldn't use this flag in a production scenario.
+ */
+ bool verifySSL;
+ /**
+ * If your Certificate Authority path is different from the default, you can tell
+ * clients that aren't using the default trust store where to find your CA trust store.
+ * If you are on windows or apple, you likely don't want this.
+ */
+ Aws::String caPath;
+ /**
* Same as caPath, but useful if you have users going through a proxy.
* Used to set CURLOPT_PROXY_CAPATH in libcurl.
*/
Aws::String proxyCaPath;
/**
- * If you certificate file is different from the default, you can tell clients that
- * aren't using the default trust store where to find your ca file.
+ * If you certificate file is different from the default, you can tell clients that
+ * aren't using the default trust store where to find your ca file.
* If you are on windows or apple, you likely don't want this.
- */
- Aws::String caFile;
- /**
+ */
+ Aws::String caFile;
+ /**
* Same as caFile, but useful if you have users going through a proxy.
* Used to set CURLOPT_PROXY_CAINFO in libcurl.
*/
Aws::String proxyCaFile;
/**
- * Rate Limiter implementation for outgoing bandwidth. Default is wide-open.
- */
- std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> writeRateLimiter;
- /**
- * Rate Limiter implementation for incoming bandwidth. Default is wide-open.
- */
- std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> readRateLimiter;
- /**
- * Override the http implementation the default factory returns.
- */
- Aws::Http::TransferLibType httpLibOverride;
- /**
+ * Rate Limiter implementation for outgoing bandwidth. Default is wide-open.
+ */
+ std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> writeRateLimiter;
+ /**
+ * Rate Limiter implementation for incoming bandwidth. Default is wide-open.
+ */
+ std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> readRateLimiter;
+ /**
+ * Override the http implementation the default factory returns.
+ */
+ Aws::Http::TransferLibType httpLibOverride;
+ /**
* Sets the behavior how http stack handles 30x redirect codes.
- */
+ */
FollowRedirectsPolicy followRedirects;
-
- /**
- * Only works for Curl http client.
- * Curl will by default add "Expect: 100-Continue" header in a Http request so as to avoid sending http
- * payload to wire if server respond error immediately after receiving the header.
- * Set this option to true will tell Curl to send http request header and body together.
- * This can save one round-trip time and especially useful when the payload is small and network latency is more important.
+
+ /**
+ * Only works for Curl http client.
+ * Curl will by default add "Expect: 100-Continue" header in a Http request so as to avoid sending http
+ * payload to wire if server respond error immediately after receiving the header.
+ * Set this option to true will tell Curl to send http request header and body together.
+ * This can save one round-trip time and especially useful when the payload is small and network latency is more important.
* But be careful when Http request has large payload such S3 PutObject. You don't want to spend long time sending a large payload just getting a error response for server.
- * The default value will be false.
- */
- bool disableExpectHeader;
-
- /**
- * If set to true clock skew will be adjusted after each http attempt, default to true.
- */
- bool enableClockSkewAdjustment;
+ * The default value will be false.
+ */
+ bool disableExpectHeader;
+
+ /**
+ * If set to true clock skew will be adjusted after each http attempt, default to true.
+ */
+ bool enableClockSkewAdjustment;
/**
* Enable host prefix injection.
@@ -249,7 +249,7 @@ namespace Aws
*/
Aws::String profileName;
- };
-
- } // namespace Client
-} // namespace Aws
+ };
+
+ } // namespace Client
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/CoreErrors.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/CoreErrors.h
index b79feb2f78..52ebe51c82 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/CoreErrors.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/CoreErrors.h
@@ -2,66 +2,66 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-
-#include "aws/core/Core_EXPORTS.h"
-
-namespace Aws
-{
+#pragma once
+
+#include "aws/core/Core_EXPORTS.h"
+
+namespace Aws
+{
namespace Http
- {
- enum class HttpResponseCode;
- }
- namespace Client
- {
- template<typename ERROR_TYPE>
- class AWSError;
-
- enum class CoreErrors
- {
- INCOMPLETE_SIGNATURE = 0,
- INTERNAL_FAILURE = 1,
- INVALID_ACTION = 2,
- INVALID_CLIENT_TOKEN_ID = 3,
- INVALID_PARAMETER_COMBINATION = 4,
- INVALID_QUERY_PARAMETER = 5,
- INVALID_PARAMETER_VALUE = 6,
+ {
+ enum class HttpResponseCode;
+ }
+ namespace Client
+ {
+ template<typename ERROR_TYPE>
+ class AWSError;
+
+ enum class CoreErrors
+ {
+ INCOMPLETE_SIGNATURE = 0,
+ INTERNAL_FAILURE = 1,
+ INVALID_ACTION = 2,
+ INVALID_CLIENT_TOKEN_ID = 3,
+ INVALID_PARAMETER_COMBINATION = 4,
+ INVALID_QUERY_PARAMETER = 5,
+ INVALID_PARAMETER_VALUE = 6,
MISSING_ACTION = 7, // SDK should never allow
- MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
+ MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
MISSING_PARAMETER = 9, // SDK should never allow
- OPT_IN_REQUIRED = 10,
- REQUEST_EXPIRED = 11,
- SERVICE_UNAVAILABLE = 12,
- THROTTLING = 13,
- VALIDATION = 14,
- ACCESS_DENIED = 15,
+ OPT_IN_REQUIRED = 10,
+ REQUEST_EXPIRED = 11,
+ SERVICE_UNAVAILABLE = 12,
+ THROTTLING = 13,
+ VALIDATION = 14,
+ ACCESS_DENIED = 15,
RESOURCE_NOT_FOUND = 16, // Shared with multiple services
UNRECOGNIZED_CLIENT = 17, // Most likely caused by an invalid access key or secret key
- MALFORMED_QUERY_STRING = 18, // Where does this come from? (cognito identity uses it)
- SLOW_DOWN = 19,
- REQUEST_TIME_TOO_SKEWED = 20,
- INVALID_SIGNATURE = 21,
- SIGNATURE_DOES_NOT_MATCH = 22,
- INVALID_ACCESS_KEY_ID = 23,
- REQUEST_TIMEOUT = 24,
-
+ MALFORMED_QUERY_STRING = 18, // Where does this come from? (cognito identity uses it)
+ SLOW_DOWN = 19,
+ REQUEST_TIME_TOO_SKEWED = 20,
+ INVALID_SIGNATURE = 21,
+ SIGNATURE_DOES_NOT_MATCH = 22,
+ INVALID_ACCESS_KEY_ID = 23,
+ REQUEST_TIMEOUT = 24,
+
NETWORK_CONNECTION = 99, // General failure to send message to service
-
- // These are needed for logical reasons
+
+ // These are needed for logical reasons
UNKNOWN = 100, // Unknown to the SDK
- CLIENT_SIGNING_FAILURE = 101, // Client failed to sign the request
+ CLIENT_SIGNING_FAILURE = 101, // Client failed to sign the request
USER_CANCELLED = 102, // User cancelled the request
- SERVICE_EXTENSION_START_RANGE = 128
- };
-
- namespace CoreErrorsMapper
- {
- /**
- * Finds a CoreErrors member if possible. Otherwise, returns UNKNOWN
- */
- AWS_CORE_API AWSError<CoreErrors> GetErrorForName(const char* errorName);
+ SERVICE_EXTENSION_START_RANGE = 128
+ };
- /**
+ namespace CoreErrorsMapper
+ {
+ /**
+ * Finds a CoreErrors member if possible. Otherwise, returns UNKNOWN
+ */
+ AWS_CORE_API AWSError<CoreErrors> GetErrorForName(const char* errorName);
+
+ /**
* Build the mapping between predefined exception names and Aws CoreErrors using Aws::Map.
*/
AWS_CORE_API void InitCoreErrorsMapper();
@@ -71,9 +71,9 @@ namespace Aws
*/
AWS_CORE_API void CleanupCoreErrorsMapper();
/**
- * Finds a CoreErrors member if possible by HTTP response code
- */
- AWS_CORE_API AWSError<CoreErrors> GetErrorForHttpResponseCode(Aws::Http::HttpResponseCode code);
- } // namespace CoreErrorsMapper
- } // namespace Client
-} // namespace Aws
+ * Finds a CoreErrors member if possible by HTTP response code
+ */
+ AWS_CORE_API AWSError<CoreErrors> GetErrorForHttpResponseCode(Aws::Http::HttpResponseCode code);
+ } // namespace CoreErrorsMapper
+ } // namespace Client
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/DefaultRetryStrategy.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/DefaultRetryStrategy.h
index 30884b6668..0357c5ed0c 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/DefaultRetryStrategy.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/DefaultRetryStrategy.h
@@ -2,35 +2,35 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/client/RetryStrategy.h>
-
-namespace Aws
-{
-namespace Client
-{
-
-class AWS_CORE_API DefaultRetryStrategy : public RetryStrategy
-{
-public:
-
- DefaultRetryStrategy(long maxRetries = 10, long scaleFactor = 25) :
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/client/RetryStrategy.h>
+
+namespace Aws
+{
+namespace Client
+{
+
+class AWS_CORE_API DefaultRetryStrategy : public RetryStrategy
+{
+public:
+
+ DefaultRetryStrategy(long maxRetries = 10, long scaleFactor = 25) :
m_scaleFactor(scaleFactor), m_maxRetries(maxRetries)
- {}
-
+ {}
+
bool ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override;
-
+
long CalculateDelayBeforeNextRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const override;
-
+
virtual long GetMaxAttempts() const override { return m_maxRetries + 1; }
protected:
- long m_scaleFactor;
- long m_maxRetries;
-};
-
-} // namespace Client
-} // namespace Aws
+ long m_scaleFactor;
+ long m_maxRetries;
+};
+
+} // namespace Client
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/RetryStrategy.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/RetryStrategy.h
index 6c3c380b02..930eaa581d 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/RetryStrategy.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/RetryStrategy.h
@@ -2,15 +2,15 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
#include <aws/core/utils/threading/ReaderWriterLock.h>
#include <memory>
-
-namespace Aws
-{
+
+namespace Aws
+{
namespace Http
{
class HttpResponse;
@@ -22,31 +22,31 @@ namespace Aws
class Outcome;
}
- namespace Client
- {
- enum class CoreErrors;
- template<typename ERROR_TYPE>
- class AWSError;
-
+ namespace Client
+ {
+ enum class CoreErrors;
+ template<typename ERROR_TYPE>
+ class AWSError;
+
typedef Utils::Outcome<std::shared_ptr<Aws::Http::HttpResponse>, AWSError<CoreErrors>> HttpResponseOutcome;
- /**
- * Interface for defining a Retry Strategy. Override this class to provide your own custom retry behavior.
- */
- class AWS_CORE_API RetryStrategy
- {
- public:
+ /**
+ * Interface for defining a Retry Strategy. Override this class to provide your own custom retry behavior.
+ */
+ class AWS_CORE_API RetryStrategy
+ {
+ public:
virtual ~RetryStrategy() = default;
- /**
- * Returns true if the error can be retried given the error and the number of times already tried.
- */
- virtual bool ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const = 0;
-
- /**
+ /**
+ * Returns true if the error can be retried given the error and the number of times already tried.
+ */
+ virtual bool ShouldRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const = 0;
+
+ /**
* Calculates the time in milliseconds the client should sleep before attempting another request based on the error and attemptedRetries count.
- */
- virtual long CalculateDelayBeforeNextRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const = 0;
-
+ */
+ virtual long CalculateDelayBeforeNextRetry(const AWSError<CoreErrors>& error, long attemptedRetries) const = 0;
+
/**
* Gets max number of attempts allowed for an operation.
* Returns non positive value if not defined.
@@ -63,8 +63,8 @@ namespace Aws
*/
virtual void RequestBookkeeping(const HttpResponseOutcome& /* httpResponseOutcome */) {}
virtual void RequestBookkeeping(const HttpResponseOutcome& /* httpResponseOutcome */, const AWSError<CoreErrors>& /* lastError */) {}
- };
-
+ };
+
/**
* The container for retry quotas.
* A failed request will acquire retry quotas to retry.
@@ -117,5 +117,5 @@ namespace Aws
std::shared_ptr<RetryQuotaContainer> m_retryQuotaContainer;
long m_maxAttempts;
};
- } // namespace Client
-} // namespace Aws
+ } // namespace Client
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/config/AWSProfileConfigLoader.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/config/AWSProfileConfigLoader.h
index ff98224e4d..84c62713da 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/config/AWSProfileConfigLoader.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/config/AWSProfileConfigLoader.h
@@ -2,164 +2,164 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/utils/memory/stl/AWSString.h>
+
+#pragma once
+
+#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <aws/core/auth/AWSCredentials.h>
-#include <aws/core/utils/DateTime.h>
+#include <aws/core/utils/DateTime.h>
#include <aws/core/utils/threading/ReaderWriterLock.h>
-
-namespace Aws
-{
- namespace Internal
- {
- class EC2MetadataClient;
- }
-
- namespace Config
- {
- /**
- * Simple data container for a Profile.
- */
- class Profile
- {
- public:
- inline const Aws::String& GetName() const { return m_name; }
- inline void SetName(const Aws::String& value) { m_name = value; }
- inline const Aws::Auth::AWSCredentials& GetCredentials() const { return m_credentials; }
- inline void SetCredentials(const Aws::Auth::AWSCredentials& value) { m_credentials = value; }
- inline const Aws::String& GetRegion() const { return m_region; }
- inline void SetRegion(const Aws::String& value) { m_region = value; }
- inline const Aws::String& GetRoleArn() const { return m_roleArn; }
- inline void SetRoleArn(const Aws::String& value) { m_roleArn = value; }
- inline const Aws::String& GetExternalId() const { return m_externalId; }
- inline void SetExternalId(const Aws::String& value) { m_externalId = value; }
- inline const Aws::String& GetSourceProfile() const { return m_sourceProfile; }
- inline void SetSourceProfile(const Aws::String& value ) { m_sourceProfile = value; }
+
+namespace Aws
+{
+ namespace Internal
+ {
+ class EC2MetadataClient;
+ }
+
+ namespace Config
+ {
+ /**
+ * Simple data container for a Profile.
+ */
+ class Profile
+ {
+ public:
+ inline const Aws::String& GetName() const { return m_name; }
+ inline void SetName(const Aws::String& value) { m_name = value; }
+ inline const Aws::Auth::AWSCredentials& GetCredentials() const { return m_credentials; }
+ inline void SetCredentials(const Aws::Auth::AWSCredentials& value) { m_credentials = value; }
+ inline const Aws::String& GetRegion() const { return m_region; }
+ inline void SetRegion(const Aws::String& value) { m_region = value; }
+ inline const Aws::String& GetRoleArn() const { return m_roleArn; }
+ inline void SetRoleArn(const Aws::String& value) { m_roleArn = value; }
+ inline const Aws::String& GetExternalId() const { return m_externalId; }
+ inline void SetExternalId(const Aws::String& value) { m_externalId = value; }
+ inline const Aws::String& GetSourceProfile() const { return m_sourceProfile; }
+ inline void SetSourceProfile(const Aws::String& value ) { m_sourceProfile = value; }
inline const Aws::String& GetCredentialProcess() const { return m_credentialProcess; }
inline void SetCredentialProcess(const Aws::String& value ) { m_credentialProcess = value; }
- inline void SetAllKeyValPairs(const Aws::Map<Aws::String, Aws::String>& map) { m_allKeyValPairs = map; }
- inline const Aws::String GetValue(const Aws::String& key) const
- {
- auto iter = m_allKeyValPairs.find(key);
+ inline void SetAllKeyValPairs(const Aws::Map<Aws::String, Aws::String>& map) { m_allKeyValPairs = map; }
+ inline const Aws::String GetValue(const Aws::String& key) const
+ {
+ auto iter = m_allKeyValPairs.find(key);
if (iter == m_allKeyValPairs.end()) return {};
- return iter->second;
- }
-
- private:
- Aws::String m_name;
- Aws::String m_region;
- Aws::Auth::AWSCredentials m_credentials;
- Aws::String m_roleArn;
- Aws::String m_externalId;
- Aws::String m_sourceProfile;
+ return iter->second;
+ }
+
+ private:
+ Aws::String m_name;
+ Aws::String m_region;
+ Aws::Auth::AWSCredentials m_credentials;
+ Aws::String m_roleArn;
+ Aws::String m_externalId;
+ Aws::String m_sourceProfile;
Aws::String m_credentialProcess;
- Aws::Map<Aws::String, Aws::String> m_allKeyValPairs;
- };
-
- /**
- * Loads Configuration such as .aws/config, .aws/credentials or ec2 metadata service.
- */
- class AWS_CORE_API AWSProfileConfigLoader
- {
- public:
- virtual ~AWSProfileConfigLoader() = default;
-
- /**
- * Load the configuration
- */
- bool Load();
-
- /**
- * Over writes the entire config source with the newly configured profile data.
- */
- bool PersistProfiles(const Aws::Map<Aws::String, Aws::Config::Profile>& profiles);
-
- /**
- * Gets all profiles from the configuration file.
- */
- inline const Aws::Map<Aws::String, Aws::Config::Profile>& GetProfiles() const { return m_profiles; };
-
- /**
- * the timestamp from the last time the profile information was loaded from file.
- */
- inline const Aws::Utils::DateTime& LastLoadTime() const { return m_lastLoadTime; }
-
+ Aws::Map<Aws::String, Aws::String> m_allKeyValPairs;
+ };
+
+ /**
+ * Loads Configuration such as .aws/config, .aws/credentials or ec2 metadata service.
+ */
+ class AWS_CORE_API AWSProfileConfigLoader
+ {
+ public:
+ virtual ~AWSProfileConfigLoader() = default;
+
+ /**
+ * Load the configuration
+ */
+ bool Load();
+
+ /**
+ * Over writes the entire config source with the newly configured profile data.
+ */
+ bool PersistProfiles(const Aws::Map<Aws::String, Aws::Config::Profile>& profiles);
+
+ /**
+ * Gets all profiles from the configuration file.
+ */
+ inline const Aws::Map<Aws::String, Aws::Config::Profile>& GetProfiles() const { return m_profiles; };
+
+ /**
+ * the timestamp from the last time the profile information was loaded from file.
+ */
+ inline const Aws::Utils::DateTime& LastLoadTime() const { return m_lastLoadTime; }
+
using ProfilesContainer = Aws::Map<Aws::String, Aws::Config::Profile>;
- protected:
- /**
- * Subclasses override this method to implement fetching the profiles.
- */
- virtual bool LoadInternal() = 0;
-
- /**
- * Subclasses override this method to implement persisting the profiles. Default returns false.
- */
- virtual bool PersistInternal(const Aws::Map<Aws::String, Aws::Config::Profile>&) { return false; }
-
+ protected:
+ /**
+ * Subclasses override this method to implement fetching the profiles.
+ */
+ virtual bool LoadInternal() = 0;
+
+ /**
+ * Subclasses override this method to implement persisting the profiles. Default returns false.
+ */
+ virtual bool PersistInternal(const Aws::Map<Aws::String, Aws::Config::Profile>&) { return false; }
+
ProfilesContainer m_profiles;
- Aws::Utils::DateTime m_lastLoadTime;
- };
-
- /**
- * Reads configuration from a config file (e.g. $HOME/.aws/config or $HOME/.aws/credentials
- */
- class AWS_CORE_API AWSConfigFileProfileConfigLoader : public AWSProfileConfigLoader
- {
- public:
- /**
- * fileName - file to load config from
- * useProfilePrefix - whether or not the profiles are prefixed with "profile", credentials file is not
- * while the config file is. Defaults to off.
- */
- AWSConfigFileProfileConfigLoader(const Aws::String& fileName, bool useProfilePrefix = false);
-
- virtual ~AWSConfigFileProfileConfigLoader() = default;
-
- /**
- * File path being used for the config loader.
- */
- const Aws::String& GetFileName() const { return m_fileName; }
-
+ Aws::Utils::DateTime m_lastLoadTime;
+ };
+
+ /**
+ * Reads configuration from a config file (e.g. $HOME/.aws/config or $HOME/.aws/credentials
+ */
+ class AWS_CORE_API AWSConfigFileProfileConfigLoader : public AWSProfileConfigLoader
+ {
+ public:
+ /**
+ * fileName - file to load config from
+ * useProfilePrefix - whether or not the profiles are prefixed with "profile", credentials file is not
+ * while the config file is. Defaults to off.
+ */
+ AWSConfigFileProfileConfigLoader(const Aws::String& fileName, bool useProfilePrefix = false);
+
+ virtual ~AWSConfigFileProfileConfigLoader() = default;
+
+ /**
+ * File path being used for the config loader.
+ */
+ const Aws::String& GetFileName() const { return m_fileName; }
+
/**
* Give loader the ability to change the file path to load config from.
* This can avoid creating new loader object if the file changed.
*/
void SetFileName(const Aws::String& fileName) { m_fileName = fileName; }
- protected:
- virtual bool LoadInternal() override;
- virtual bool PersistInternal(const Aws::Map<Aws::String, Aws::Config::Profile>&) override;
-
- private:
- Aws::String m_fileName;
- bool m_useProfilePrefix;
- };
-
- static const char* const INSTANCE_PROFILE_KEY = "InstanceProfile";
-
- /**
- * Loads configuration from the EC2 Metadata Service
- */
- class AWS_CORE_API EC2InstanceProfileConfigLoader : public AWSProfileConfigLoader
- {
- public:
- /**
- * If client is nullptr, the default EC2MetadataClient will be created.
- */
- EC2InstanceProfileConfigLoader(const std::shared_ptr<Aws::Internal::EC2MetadataClient>& = nullptr);
-
- virtual ~EC2InstanceProfileConfigLoader() = default;
-
- protected:
- virtual bool LoadInternal() override;
-
- private:
- std::shared_ptr<Aws::Internal::EC2MetadataClient> m_ec2metadataClient;
- };
+ protected:
+ virtual bool LoadInternal() override;
+ virtual bool PersistInternal(const Aws::Map<Aws::String, Aws::Config::Profile>&) override;
+
+ private:
+ Aws::String m_fileName;
+ bool m_useProfilePrefix;
+ };
+
+ static const char* const INSTANCE_PROFILE_KEY = "InstanceProfile";
+
+ /**
+ * Loads configuration from the EC2 Metadata Service
+ */
+ class AWS_CORE_API EC2InstanceProfileConfigLoader : public AWSProfileConfigLoader
+ {
+ public:
+ /**
+ * If client is nullptr, the default EC2MetadataClient will be created.
+ */
+ EC2InstanceProfileConfigLoader(const std::shared_ptr<Aws::Internal::EC2MetadataClient>& = nullptr);
+
+ virtual ~EC2InstanceProfileConfigLoader() = default;
+
+ protected:
+ virtual bool LoadInternal() override;
+
+ private:
+ std::shared_ptr<Aws::Internal::EC2MetadataClient> m_ec2metadataClient;
+ };
/**
* Stores the contents of config file and credentials file to avoid multiple file readings.
@@ -246,5 +246,5 @@ namespace Aws
AWS_CORE_API Aws::Map<Aws::String, Aws::Config::Profile> GetCachedCredentialsProfiles();
- }
-}
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/cjson/cJSON.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/cjson/cJSON.h
index a78c8637f2..9a010a67db 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/cjson/cJSON.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/cjson/cJSON.h
@@ -1,108 +1,108 @@
-/*
- Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-*/
-
-#ifndef cJSON__h
-#define cJSON__h
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/* project version */
-#define CJSON_VERSION_MAJOR 1
-#define CJSON_VERSION_MINOR 7
-#define CJSON_VERSION_PATCH 7
-
-#include <stddef.h>
-
-/* cJSON Types: */
-#define cJSON_Invalid (0)
-#define cJSON_False (1 << 0)
-#define cJSON_True (1 << 1)
-#define cJSON_NULL (1 << 2)
-#define cJSON_Number (1 << 3)
-#define cJSON_String (1 << 4)
-#define cJSON_Array (1 << 5)
-#define cJSON_Object (1 << 6)
-#define cJSON_Raw (1 << 7) /* raw json */
-
-#define cJSON_IsReference 256
-#define cJSON_StringIsConst 512
-
-/* The cJSON structure: */
-typedef struct cJSON
-{
- /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
- struct cJSON *next;
- struct cJSON *prev;
- /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
- struct cJSON *child;
-
- /* The type of the item, as above. */
- int type;
-
- /* The item's string, if type==cJSON_String and type == cJSON_Raw */
- char *valuestring;
- /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
- int valueint;
- /* The item's number, if type==cJSON_Number */
- double valuedouble;
-
- /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
- char *string;
-} cJSON;
-
-typedef struct cJSON_Hooks
-{
- void *(*malloc_fn)(size_t sz);
- void (*free_fn)(void *ptr);
-} cJSON_Hooks;
-
-typedef int cJSON_bool;
-
-#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
-#define __WINDOWS__
-#endif
-#ifdef __WINDOWS__
-
-/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 2 define options:
-
-CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols
-CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default)
-CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol
-
-For *nix builds that support visibility attribute, you can define similar behavior by
-
-setting default visibility to hidden by adding
--fvisibility=hidden (for gcc)
-or
--xldscope=hidden (for sun cc)
-to CFLAGS
-
-then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does
-
-*/
-
+/*
+ Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#ifndef cJSON__h
+#define cJSON__h
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* project version */
+#define CJSON_VERSION_MAJOR 1
+#define CJSON_VERSION_MINOR 7
+#define CJSON_VERSION_PATCH 7
+
+#include <stddef.h>
+
+/* cJSON Types: */
+#define cJSON_Invalid (0)
+#define cJSON_False (1 << 0)
+#define cJSON_True (1 << 1)
+#define cJSON_NULL (1 << 2)
+#define cJSON_Number (1 << 3)
+#define cJSON_String (1 << 4)
+#define cJSON_Array (1 << 5)
+#define cJSON_Object (1 << 6)
+#define cJSON_Raw (1 << 7) /* raw json */
+
+#define cJSON_IsReference 256
+#define cJSON_StringIsConst 512
+
+/* The cJSON structure: */
+typedef struct cJSON
+{
+ /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
+ struct cJSON *next;
+ struct cJSON *prev;
+ /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
+ struct cJSON *child;
+
+ /* The type of the item, as above. */
+ int type;
+
+ /* The item's string, if type==cJSON_String and type == cJSON_Raw */
+ char *valuestring;
+ /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
+ int valueint;
+ /* The item's number, if type==cJSON_Number */
+ double valuedouble;
+
+ /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
+ char *string;
+} cJSON;
+
+typedef struct cJSON_Hooks
+{
+ void *(*malloc_fn)(size_t sz);
+ void (*free_fn)(void *ptr);
+} cJSON_Hooks;
+
+typedef int cJSON_bool;
+
+#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
+#define __WINDOWS__
+#endif
+#ifdef __WINDOWS__
+
+/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 2 define options:
+
+CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols
+CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default)
+CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol
+
+For *nix builds that support visibility attribute, you can define similar behavior by
+
+setting default visibility to hidden by adding
+-fvisibility=hidden (for gcc)
+or
+-xldscope=hidden (for sun cc)
+to CFLAGS
+
+then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does
+
+*/
+
/* Decide calling convention based on the cmake parameters defined in C++ SDK. */
#ifdef USE_IMPORT_EXPORT
#ifdef AWS_CORE_EXPORTS
@@ -114,176 +114,176 @@ then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJ
#define CJSON_HIDE_SYMBOLS
#endif // USE_IMPORT_EXPORT
-/* export symbols by default, this is necessary for copy pasting the C and header file */
-#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS)
-#define CJSON_EXPORT_SYMBOLS
-#endif
-
-#if defined(CJSON_HIDE_SYMBOLS)
-#define CJSON_PUBLIC(type) type __stdcall
-#elif defined(CJSON_EXPORT_SYMBOLS)
-#define CJSON_PUBLIC(type) __declspec(dllexport) type __stdcall
-#elif defined(CJSON_IMPORT_SYMBOLS)
-#define CJSON_PUBLIC(type) __declspec(dllimport) type __stdcall
-#endif
-#else /* !WIN32 */
-#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY)
-#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type
-#else
-#define CJSON_PUBLIC(type) type
-#endif
-#endif
-
-/* Limits how deeply nested arrays/objects can be before cJSON rejects to parse them.
- * This is to prevent stack overflows. */
-#ifndef CJSON_NESTING_LIMIT
-#define CJSON_NESTING_LIMIT 1000
-#endif
-
-/* returns the version of cJSON as a string */
-CJSON_PUBLIC(const char*) cJSON_Version(void);
-
-/* Supply malloc, realloc and free functions to cJSON */
-CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks);
-
-/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */
-/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */
-CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value);
-/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
-/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */
-CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated);
-
-/* Render a cJSON entity to text for transfer/storage. */
-CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item);
-/* Render a cJSON entity to text for transfer/storage without any formatting. */
-CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item);
-/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */
-CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt);
-/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */
-/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */
-CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format);
-/* Delete a cJSON entity and all subentities. */
-CJSON_PUBLIC(void) cJSON_Delete(cJSON *c);
-
-/* Returns the number of items in an array (or object). */
-CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array);
-/* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */
-CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index);
-/* Get item "string" from object. Case insensitive. */
-CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string);
-CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string);
-CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string);
-/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
-CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void);
-
-/* Check if the item is a string and return its valuestring */
-CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item);
-
-/* These functions check the type of an item */
-CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item);
-CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item);
-CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item);
-CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item);
-CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item);
-CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item);
-CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item);
-CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item);
-CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item);
-CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item);
-
-/* These calls create a cJSON item of the appropriate type. */
-CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void);
-CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void);
-CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void);
-CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean);
-CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num);
+/* export symbols by default, this is necessary for copy pasting the C and header file */
+#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS)
+#define CJSON_EXPORT_SYMBOLS
+#endif
+
+#if defined(CJSON_HIDE_SYMBOLS)
+#define CJSON_PUBLIC(type) type __stdcall
+#elif defined(CJSON_EXPORT_SYMBOLS)
+#define CJSON_PUBLIC(type) __declspec(dllexport) type __stdcall
+#elif defined(CJSON_IMPORT_SYMBOLS)
+#define CJSON_PUBLIC(type) __declspec(dllimport) type __stdcall
+#endif
+#else /* !WIN32 */
+#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY)
+#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type
+#else
+#define CJSON_PUBLIC(type) type
+#endif
+#endif
+
+/* Limits how deeply nested arrays/objects can be before cJSON rejects to parse them.
+ * This is to prevent stack overflows. */
+#ifndef CJSON_NESTING_LIMIT
+#define CJSON_NESTING_LIMIT 1000
+#endif
+
+/* returns the version of cJSON as a string */
+CJSON_PUBLIC(const char*) cJSON_Version(void);
+
+/* Supply malloc, realloc and free functions to cJSON */
+CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks);
+
+/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */
+/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */
+CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value);
+/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
+/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */
+CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated);
+
+/* Render a cJSON entity to text for transfer/storage. */
+CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item);
+/* Render a cJSON entity to text for transfer/storage without any formatting. */
+CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item);
+/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */
+CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt);
+/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */
+/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */
+CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format);
+/* Delete a cJSON entity and all subentities. */
+CJSON_PUBLIC(void) cJSON_Delete(cJSON *c);
+
+/* Returns the number of items in an array (or object). */
+CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array);
+/* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */
+CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index);
+/* Get item "string" from object. Case insensitive. */
+CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string);
+CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string);
+CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string);
+/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
+CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void);
+
+/* Check if the item is a string and return its valuestring */
+CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item);
+
+/* These functions check the type of an item */
+CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item);
+CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item);
+CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item);
+CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item);
+CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item);
+CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item);
+CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item);
+CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item);
+CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item);
+CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item);
+
+/* These calls create a cJSON item of the appropriate type. */
+CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void);
+CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void);
+CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void);
+CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean);
+CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num);
CJSON_PUBLIC(cJSON *) cJSON_CreateInt64(long long num);
-CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string);
-/* raw json */
-CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw);
-CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void);
-CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void);
-
-/* Create a string where valuestring references a string so
- * it will not be freed by cJSON_Delete */
-CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string);
-/* Create an object/arrray that only references it's elements so
- * they will not be freed by cJSON_Delete */
-CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child);
-CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child);
-
-/* These utilities create an Array of count items. */
-CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count);
-CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count);
-CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count);
-CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count);
-
-/* Append item to the specified array/object. */
-CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item);
-CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item);
-/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object.
- * WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before
- * writing to `item->string` */
-CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item);
-/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
-CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
-CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item);
-
+CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string);
+/* raw json */
+CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw);
+CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void);
+CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void);
+
+/* Create a string where valuestring references a string so
+ * it will not be freed by cJSON_Delete */
+CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string);
+/* Create an object/arrray that only references it's elements so
+ * they will not be freed by cJSON_Delete */
+CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child);
+CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child);
+
+/* These utilities create an Array of count items. */
+CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count);
+CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count);
+CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count);
+CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count);
+
+/* Append item to the specified array/object. */
+CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item);
+CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item);
+/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object.
+ * WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before
+ * writing to `item->string` */
+CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item);
+/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
+CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
+CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item);
+
/* Remove/Detach items from Arrays/Objects. */
-CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item);
-CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which);
-CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which);
-CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string);
-CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string);
-CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string);
-CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string);
-
-/* Update array items. */
-CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */
-CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement);
-CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem);
-CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
-CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem);
-
-/* Duplicate a cJSON item */
-CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse);
-/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will
-need to be released. With recurse!=0, it will duplicate any children connected to the item.
-The item->next and ->prev pointers are always zero on return from Duplicate. */
-/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal.
- * case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */
-CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive);
-
-
-CJSON_PUBLIC(void) cJSON_Minify(char *json);
-
-/* Helper functions for creating and adding items to an object at the same time.
- * They return the added item or NULL on failure. */
-CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name);
-CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name);
-CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name);
-CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean);
-CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number);
-CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string);
-CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw);
-CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name);
-CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name);
-
-/* When assigning an integer value, it needs to be propagated to valuedouble too. */
-#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number))
-/* helper for the cJSON_SetNumberValue macro */
-CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number);
-#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number))
-
-/* Macro for iterating over an array or object */
-#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next)
-
-/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */
-CJSON_PUBLIC(void *) cJSON_malloc(size_t size);
-CJSON_PUBLIC(void) cJSON_free(void *object);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item);
+CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which);
+CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which);
+CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string);
+CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string);
+CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string);
+CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string);
+
+/* Update array items. */
+CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */
+CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement);
+CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem);
+CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
+CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem);
+
+/* Duplicate a cJSON item */
+CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse);
+/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will
+need to be released. With recurse!=0, it will duplicate any children connected to the item.
+The item->next and ->prev pointers are always zero on return from Duplicate. */
+/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal.
+ * case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */
+CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive);
+
+
+CJSON_PUBLIC(void) cJSON_Minify(char *json);
+
+/* Helper functions for creating and adding items to an object at the same time.
+ * They return the added item or NULL on failure. */
+CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name);
+CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name);
+CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name);
+CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean);
+CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number);
+CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string);
+CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw);
+CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name);
+CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name);
+
+/* When assigning an integer value, it needs to be propagated to valuedouble too. */
+#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number))
+/* helper for the cJSON_SetNumberValue macro */
+CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number);
+#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number))
+
+/* Macro for iterating over an array or object */
+#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next)
+
+/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */
+CJSON_PUBLIC(void *) cJSON_malloc(size_t size);
+CJSON_PUBLIC(void) cJSON_free(void *object);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/tinyxml2/tinyxml2.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/tinyxml2/tinyxml2.h
index 401d9c94e9..3721ed1f97 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/tinyxml2/tinyxml2.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/external/tinyxml2/tinyxml2.h
@@ -1,2292 +1,2292 @@
-/*
-Original code by Lee Thomason (www.grinninglizard.com)
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any
-damages arising from the use of this software.
-
-Permission is granted to anyone to use this software for any
-purpose, including commercial applications, and to alter it and
-redistribute it freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must
-not claim that you wrote the original software. If you use this
-software in a product, an acknowledgment in the product documentation
-would be appreciated but is not required.
-
-2. Altered source versions must be plainly marked as such, and
-must not be misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any source
-distribution.
-*/
-/*
-This file has been modified from its original version by Amazon:
- (1) Memory management operations use aws memory management api
+/*
+Original code by Lee Thomason (www.grinninglizard.com)
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must
+not claim that you wrote the original software. If you use this
+software in a product, an acknowledgment in the product documentation
+would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution.
+*/
+/*
+This file has been modified from its original version by Amazon:
+ (1) Memory management operations use aws memory management api
(2) Import-export preprocessor logic tweaked for better integration into core library
- (3) Wrapped everything in Amazon namespace to prevent static linking issues if the user includes a version of this code through another dependency
-*/
-#ifndef TINYXML2_INCLUDED
-#define TINYXML2_INCLUDED
-
-#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__)
-# include <ctype.h>
-# include <limits.h>
-# include <stdio.h>
-# include <stdlib.h>
-# include <string.h>
-# if defined(__PS3__)
-# include <stddef.h>
-# endif
-#else
-# include <cctype>
-# include <climits>
-# include <cstdio>
-# include <cstdlib>
-# include <cstring>
-#endif
-#include <stdint.h>
-
-#include <aws/core/utils/memory/AWSMemory.h>
-
-/*
- TODO: intern strings instead of allocation.
-*/
-/*
- gcc:
- g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe
-
- Formatting, Artistic Style:
- AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h
-*/
-
-#if defined( _DEBUG ) || defined (__DEBUG__)
-# ifndef DEBUG
-# define DEBUG
-# endif
-#endif
-
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable: 4251)
-#endif
-
-#ifdef _WIN32
- #ifdef USE_IMPORT_EXPORT
- #ifdef AWS_CORE_EXPORTS
- #define TINYXML2_LIB __declspec(dllexport)
- #else
- #define TINYXML2_LIB __declspec(dllimport)
- #endif // AWS_CORE_EXPORTS
- #endif // USE_IMPORT_EXPORT
-#elif __GNUC__ >= 4
- #define TINYXML2_LIB __attribute__((visibility("default")))
-#endif // _WIN32
-
-#ifndef TINYXML2_LIB
- #define TINYXML2_LIB
-#endif // TINYXML2_LIB
-
-#if defined(DEBUG)
-# if defined(_MSC_VER)
-# // "(void)0," is for suppressing C4127 warning in "assert(false)", "assert(true)" and the like
-# define TIXMLASSERT( x ) if ( !((void)0,(x))) { __debugbreak(); }
-# elif defined (ANDROID_NDK)
-# include <android/log.h>
-# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); }
-# else
-# include <assert.h>
-# define TIXMLASSERT assert
-# endif
-#else
-# define TIXMLASSERT( x ) {}
-#endif
-
-
-/* Versioning, past 1.0.14:
- http://semver.org/
-*/
-static const int TIXML2_MAJOR_VERSION = 6;
-static const int TIXML2_MINOR_VERSION = 1;
-static const int TIXML2_PATCH_VERSION = 0;
-
-#define TINYXML2_MAJOR_VERSION 6
-#define TINYXML2_MINOR_VERSION 1
-#define TINYXML2_PATCH_VERSION 0
-
-namespace Aws
-{
-namespace External
-{
-namespace tinyxml2
-{
-class XMLDocument;
-class XMLElement;
-class XMLAttribute;
-class XMLComment;
-class XMLText;
-class XMLDeclaration;
-class XMLUnknown;
-class XMLPrinter;
-
-static const char* ALLOCATION_TAG = "AWS::TinyXML";
-
-/*
- A class that wraps strings. Normally stores the start and end
- pointers into the XML file itself, and will apply normalization
- and entity translation if actually read. Can also store (and memory
- manage) a traditional char[]
-*/
-class TINYXML2_LIB StrPair
-{
-public:
- enum {
- NEEDS_ENTITY_PROCESSING = 0x01,
- NEEDS_NEWLINE_NORMALIZATION = 0x02,
- NEEDS_WHITESPACE_COLLAPSING = 0x04,
-
- TEXT_ELEMENT = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,
- TEXT_ELEMENT_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION,
- ATTRIBUTE_NAME = 0,
- ATTRIBUTE_VALUE = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,
- ATTRIBUTE_VALUE_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION,
- COMMENT = NEEDS_NEWLINE_NORMALIZATION
- };
-
- StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {}
- ~StrPair();
-
- void Set( char* start, char* end, int flags ) {
- TIXMLASSERT( start );
- TIXMLASSERT( end );
- Reset();
- _start = start;
- _end = end;
- _flags = flags | NEEDS_FLUSH;
- }
-
- const char* GetStr();
-
- bool Empty() const {
- return _start == _end;
- }
-
- void SetInternedStr( const char* str ) {
- Reset();
- _start = const_cast<char*>(str);
- }
-
- void SetStr( const char* str, int flags=0 );
-
- char* ParseText( char* in, const char* endTag, int strFlags, int* curLineNumPtr );
- char* ParseName( char* in );
-
- void TransferTo( StrPair* other );
- void Reset();
-
-private:
- void CollapseWhitespace();
-
- enum {
- NEEDS_FLUSH = 0x100,
- NEEDS_DELETE = 0x200
- };
-
- int _flags;
- char* _start;
- char* _end;
-
- StrPair( const StrPair& other ); // not supported
- void operator=( StrPair& other ); // not supported, use TransferTo()
-};
-
-
-/*
- A dynamic array of Plain Old Data. Doesn't support constructors, etc.
- Has a small initial memory pool, so that low or no usage will not
- cause a call to new/delete
-*/
-template <class T, int INITIAL_SIZE>
-class DynArray
-{
-public:
- DynArray() :
- _mem( _pool ),
- _allocated( INITIAL_SIZE ),
- _size( 0 )
- {
- }
-
- ~DynArray() {
- if ( _mem != _pool ) {
- Aws::DeleteArray<T>(_mem);
- }
- }
-
- void Clear() {
- _size = 0;
- }
-
- void Push( T t ) {
- TIXMLASSERT( _size < INT_MAX );
- EnsureCapacity( _size+1 );
- _mem[_size] = t;
- ++_size;
- }
-
- T* PushArr( int count ) {
- TIXMLASSERT( count >= 0 );
- TIXMLASSERT( _size <= INT_MAX - count );
- EnsureCapacity( _size+count );
- T* ret = &_mem[_size];
- _size += count;
- return ret;
- }
-
- T Pop() {
- TIXMLASSERT( _size > 0 );
- --_size;
- return _mem[_size];
- }
-
- void PopArr( int count ) {
- TIXMLASSERT( _size >= count );
- _size -= count;
- }
-
- bool Empty() const {
- return _size == 0;
- }
-
- T& operator[](int i) {
- TIXMLASSERT( i>= 0 && i < _size );
- return _mem[i];
- }
-
- const T& operator[](int i) const {
- TIXMLASSERT( i>= 0 && i < _size );
- return _mem[i];
- }
-
- const T& PeekTop() const {
- TIXMLASSERT( _size > 0 );
- return _mem[ _size - 1];
- }
-
- int Size() const {
- TIXMLASSERT( _size >= 0 );
- return _size;
- }
-
- int Capacity() const {
- TIXMLASSERT( _allocated >= INITIAL_SIZE );
- return _allocated;
- }
-
- void SwapRemove(int i) {
- TIXMLASSERT(i >= 0 && i < _size);
- TIXMLASSERT(_size > 0);
- _mem[i] = _mem[_size - 1];
- --_size;
- }
-
- const T* Mem() const {
- TIXMLASSERT( _mem );
- return _mem;
- }
-
- T* Mem() {
- TIXMLASSERT( _mem );
- return _mem;
- }
-
-private:
- DynArray( const DynArray& ); // not supported
- void operator=( const DynArray& ); // not supported
-
- void EnsureCapacity( int cap ) {
- TIXMLASSERT( cap > 0 );
- if ( cap > _allocated ) {
- TIXMLASSERT( cap <= INT_MAX / 2 );
- int newAllocated = cap * 2;
- T* newMem = Aws::NewArray<T>(newAllocated, ALLOCATION_TAG);
- TIXMLASSERT( newAllocated >= _size );
- memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs
- if ( _mem != _pool ) {
- Aws::DeleteArray<T>(_mem);
- }
- _mem = newMem;
- _allocated = newAllocated;
- }
- }
-
- T* _mem;
- T _pool[INITIAL_SIZE];
- int _allocated; // objects allocated
- int _size; // number objects in use
-};
-
-
-/*
- Parent virtual class of a pool for fast allocation
- and deallocation of objects.
-*/
-class MemPool
-{
-public:
- MemPool() {}
- virtual ~MemPool() {}
-
- virtual int ItemSize() const = 0;
- virtual void* Alloc() = 0;
- virtual void Free( void* ) = 0;
- virtual void SetTracked() = 0;
- virtual void Clear() = 0;
-};
-
-
-/*
- Template child class to create pools of the correct type.
-*/
-template< int ITEM_SIZE >
-class MemPoolT : public MemPool
-{
-public:
- MemPoolT() : _blockPtrs(), _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {}
- ~MemPoolT() {
- Clear();
- }
-
- void Clear() {
- // Delete the blocks.
- while( !_blockPtrs.Empty()) {
- Block* lastBlock = _blockPtrs.Pop();
- Aws::Delete(lastBlock);
- }
- _root = 0;
- _currentAllocs = 0;
- _nAllocs = 0;
- _maxAllocs = 0;
- _nUntracked = 0;
- }
-
- virtual int ItemSize() const {
- return ITEM_SIZE;
- }
- int CurrentAllocs() const {
- return _currentAllocs;
- }
-
- virtual void* Alloc() {
- if ( !_root ) {
- // Need a new block.
- Block* block = Aws::New<Block>(ALLOCATION_TAG);
- _blockPtrs.Push( block );
-
- Item* blockItems = block->items;
- for( int i = 0; i < ITEMS_PER_BLOCK - 1; ++i ) {
- blockItems[i].next = &(blockItems[i + 1]);
- }
- blockItems[ITEMS_PER_BLOCK - 1].next = 0;
- _root = blockItems;
- }
- Item* const result = _root;
- TIXMLASSERT( result != 0 );
- _root = _root->next;
-
- ++_currentAllocs;
- if ( _currentAllocs > _maxAllocs ) {
- _maxAllocs = _currentAllocs;
- }
- ++_nAllocs;
- ++_nUntracked;
- return result;
- }
-
- virtual void Free( void* mem ) {
- if ( !mem ) {
- return;
- }
- --_currentAllocs;
- Item* item = static_cast<Item*>( mem );
-#ifdef DEBUG
- memset( item, 0xfe, sizeof( *item ) );
-#endif
- item->next = _root;
- _root = item;
- }
- void Trace( const char* name ) {
- printf( "Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n",
- name, _maxAllocs, _maxAllocs * ITEM_SIZE / 1024, _currentAllocs,
- ITEM_SIZE, _nAllocs, _blockPtrs.Size() );
- }
-
- void SetTracked() {
- --_nUntracked;
- }
-
- int Untracked() const {
- return _nUntracked;
- }
-
- // This number is perf sensitive. 4k seems like a good tradeoff on my machine.
- // The test file is large, 170k.
- // Release: VS2010 gcc(no opt)
- // 1k: 4000
- // 2k: 4000
- // 4k: 3900 21000
- // 16k: 5200
- // 32k: 4300
- // 64k: 4000 21000
- // Declared public because some compilers do not accept to use ITEMS_PER_BLOCK
- // in private part if ITEMS_PER_BLOCK is private
- enum { ITEMS_PER_BLOCK = (4 * 1024) / ITEM_SIZE };
-
-private:
- MemPoolT( const MemPoolT& ); // not supported
- void operator=( const MemPoolT& ); // not supported
-
- union Item {
- Item* next;
- char itemData[ITEM_SIZE];
- };
- struct Block {
- Item items[ITEMS_PER_BLOCK];
- };
- DynArray< Block*, 10 > _blockPtrs;
- Item* _root;
-
- int _currentAllocs;
- int _nAllocs;
- int _maxAllocs;
- int _nUntracked;
-};
-
-
-
-/**
- Implements the interface to the "Visitor pattern" (see the Accept() method.)
- If you call the Accept() method, it requires being passed a XMLVisitor
- class to handle callbacks. For nodes that contain other nodes (Document, Element)
- you will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs
- are simply called with Visit().
-
- If you return 'true' from a Visit method, recursive parsing will continue. If you return
- false, <b>no children of this node or its siblings</b> will be visited.
-
- All flavors of Visit methods have a default implementation that returns 'true' (continue
- visiting). You need to only override methods that are interesting to you.
-
- Generally Accept() is called on the XMLDocument, although all nodes support visiting.
-
- You should never change the document from a callback.
-
- @sa XMLNode::Accept()
-*/
-class TINYXML2_LIB XMLVisitor
-{
-public:
- virtual ~XMLVisitor() {}
-
- /// Visit a document.
- virtual bool VisitEnter( const XMLDocument& /*doc*/ ) {
- return true;
- }
- /// Visit a document.
- virtual bool VisitExit( const XMLDocument& /*doc*/ ) {
- return true;
- }
-
- /// Visit an element.
- virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ ) {
- return true;
- }
- /// Visit an element.
- virtual bool VisitExit( const XMLElement& /*element*/ ) {
- return true;
- }
-
- /// Visit a declaration.
- virtual bool Visit( const XMLDeclaration& /*declaration*/ ) {
- return true;
- }
- /// Visit a text node.
- virtual bool Visit( const XMLText& /*text*/ ) {
- return true;
- }
- /// Visit a comment node.
- virtual bool Visit( const XMLComment& /*comment*/ ) {
- return true;
- }
- /// Visit an unknown node.
- virtual bool Visit( const XMLUnknown& /*unknown*/ ) {
- return true;
- }
-};
-
-// WARNING: must match XMLDocument::_errorNames[]
-enum XMLError {
- XML_SUCCESS = 0,
- XML_NO_ATTRIBUTE,
- XML_WRONG_ATTRIBUTE_TYPE,
- XML_ERROR_FILE_NOT_FOUND,
- XML_ERROR_FILE_COULD_NOT_BE_OPENED,
- XML_ERROR_FILE_READ_ERROR,
- UNUSED_XML_ERROR_ELEMENT_MISMATCH, // remove at next major version
- XML_ERROR_PARSING_ELEMENT,
- XML_ERROR_PARSING_ATTRIBUTE,
- UNUSED_XML_ERROR_IDENTIFYING_TAG, // remove at next major version
- XML_ERROR_PARSING_TEXT,
- XML_ERROR_PARSING_CDATA,
- XML_ERROR_PARSING_COMMENT,
- XML_ERROR_PARSING_DECLARATION,
- XML_ERROR_PARSING_UNKNOWN,
- XML_ERROR_EMPTY_DOCUMENT,
- XML_ERROR_MISMATCHED_ELEMENT,
- XML_ERROR_PARSING,
- XML_CAN_NOT_CONVERT_TEXT,
- XML_NO_TEXT_NODE,
-
- XML_ERROR_COUNT
-};
-
-
-/*
- Utility functionality.
-*/
-class TINYXML2_LIB XMLUtil
-{
-public:
- static const char* SkipWhiteSpace( const char* p, int* curLineNumPtr ) {
- TIXMLASSERT( p );
-
- while( IsWhiteSpace(*p) ) {
- if (curLineNumPtr && *p == '\n') {
- ++(*curLineNumPtr);
- }
- ++p;
- }
- TIXMLASSERT( p );
- return p;
- }
- static char* SkipWhiteSpace( char* p, int* curLineNumPtr ) {
- return const_cast<char*>( SkipWhiteSpace( const_cast<const char*>(p), curLineNumPtr ) );
- }
-
- // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't
- // correct, but simple, and usually works.
- static bool IsWhiteSpace( char p ) {
- return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) );
- }
-
- inline static bool IsNameStartChar( unsigned char ch ) {
- if ( ch >= 128 ) {
- // This is a heuristic guess in attempt to not implement Unicode-aware isalpha()
- return true;
- }
- if ( isalpha( ch ) ) {
- return true;
- }
- return ch == ':' || ch == '_';
- }
-
- inline static bool IsNameChar( unsigned char ch ) {
- return IsNameStartChar( ch )
- || isdigit( ch )
- || ch == '.'
- || ch == '-';
- }
-
- inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) {
- if ( p == q ) {
- return true;
- }
- TIXMLASSERT( p );
- TIXMLASSERT( q );
- TIXMLASSERT( nChar >= 0 );
- return strncmp( p, q, nChar ) == 0;
- }
-
- inline static bool IsUTF8Continuation( char p ) {
- return ( p & 0x80 ) != 0;
- }
-
- static const char* ReadBOM( const char* p, bool* hasBOM );
- // p is the starting location,
- // the UTF-8 value of the entity will be placed in value, and length filled in.
- static const char* GetCharacterRef( const char* p, char* value, int* length );
- static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );
-
- // converts primitive types to strings
- static void ToStr( int v, char* buffer, int bufferSize );
- static void ToStr( unsigned v, char* buffer, int bufferSize );
- static void ToStr( bool v, char* buffer, int bufferSize );
- static void ToStr( float v, char* buffer, int bufferSize );
- static void ToStr( double v, char* buffer, int bufferSize );
- static void ToStr(int64_t v, char* buffer, int bufferSize);
-
- // converts strings to primitive types
- static bool ToInt( const char* str, int* value );
- static bool ToUnsigned( const char* str, unsigned* value );
- static bool ToBool( const char* str, bool* value );
- static bool ToFloat( const char* str, float* value );
- static bool ToDouble( const char* str, double* value );
- static bool ToInt64(const char* str, int64_t* value);
-
- // Changes what is serialized for a boolean value.
- // Default to "true" and "false". Shouldn't be changed
- // unless you have a special testing or compatibility need.
- // Be careful: static, global, & not thread safe.
- // Be sure to set static const memory as parameters.
- static void SetBoolSerialization(const char* writeTrue, const char* writeFalse);
-
-private:
- static const char* writeBoolTrue;
- static const char* writeBoolFalse;
-};
-
-
-/** XMLNode is a base class for every object that is in the
- XML Document Object Model (DOM), except XMLAttributes.
- Nodes have siblings, a parent, and children which can
- be navigated. A node is always in a XMLDocument.
- The type of a XMLNode can be queried, and it can
- be cast to its more defined type.
-
- A XMLDocument allocates memory for all its Nodes.
- When the XMLDocument gets deleted, all its Nodes
- will also be deleted.
-
- @verbatim
- A Document can contain: Element (container or leaf)
- Comment (leaf)
- Unknown (leaf)
- Declaration( leaf )
-
- An Element can contain: Element (container or leaf)
- Text (leaf)
- Attributes (not on tree)
- Comment (leaf)
- Unknown (leaf)
-
- @endverbatim
-*/
-class TINYXML2_LIB XMLNode
-{
- friend class XMLDocument;
- friend class XMLElement;
-public:
-
- /// Get the XMLDocument that owns this XMLNode.
- const XMLDocument* GetDocument() const {
- TIXMLASSERT( _document );
- return _document;
- }
- /// Get the XMLDocument that owns this XMLNode.
- XMLDocument* GetDocument() {
- TIXMLASSERT( _document );
- return _document;
- }
-
- /// Safely cast to an Element, or null.
- virtual XMLElement* ToElement() {
- return 0;
- }
- /// Safely cast to Text, or null.
- virtual XMLText* ToText() {
- return 0;
- }
- /// Safely cast to a Comment, or null.
- virtual XMLComment* ToComment() {
- return 0;
- }
- /// Safely cast to a Document, or null.
- virtual XMLDocument* ToDocument() {
- return 0;
- }
- /// Safely cast to a Declaration, or null.
- virtual XMLDeclaration* ToDeclaration() {
- return 0;
- }
- /// Safely cast to an Unknown, or null.
- virtual XMLUnknown* ToUnknown() {
- return 0;
- }
-
- virtual const XMLElement* ToElement() const {
- return 0;
- }
- virtual const XMLText* ToText() const {
- return 0;
- }
- virtual const XMLComment* ToComment() const {
- return 0;
- }
- virtual const XMLDocument* ToDocument() const {
- return 0;
- }
- virtual const XMLDeclaration* ToDeclaration() const {
- return 0;
- }
- virtual const XMLUnknown* ToUnknown() const {
- return 0;
- }
-
- /** The meaning of 'value' changes for the specific type.
- @verbatim
- Document: empty (NULL is returned, not an empty string)
- Element: name of the element
- Comment: the comment text
- Unknown: the tag contents
- Text: the text string
- @endverbatim
- */
- const char* Value() const;
-
- /** Set the Value of an XML node.
- @sa Value()
- */
- void SetValue( const char* val, bool staticMem=false );
-
- /// Gets the line number the node is in, if the document was parsed from a file.
- int GetLineNum() const { return _parseLineNum; }
-
- /// Get the parent of this node on the DOM.
- const XMLNode* Parent() const {
- return _parent;
- }
-
- XMLNode* Parent() {
- return _parent;
- }
-
- /// Returns true if this node has no children.
- bool NoChildren() const {
- return !_firstChild;
- }
-
- /// Get the first child node, or null if none exists.
- const XMLNode* FirstChild() const {
- return _firstChild;
- }
-
- XMLNode* FirstChild() {
- return _firstChild;
- }
-
- /** Get the first child element, or optionally the first child
- element with the specified name.
- */
- const XMLElement* FirstChildElement( const char* name = 0 ) const;
-
- XMLElement* FirstChildElement( const char* name = 0 ) {
- return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement( name ));
- }
-
- /// Get the last child node, or null if none exists.
- const XMLNode* LastChild() const {
- return _lastChild;
- }
-
- XMLNode* LastChild() {
- return _lastChild;
- }
-
- /** Get the last child element or optionally the last child
- element with the specified name.
- */
- const XMLElement* LastChildElement( const char* name = 0 ) const;
-
- XMLElement* LastChildElement( const char* name = 0 ) {
- return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(name) );
- }
-
- /// Get the previous (left) sibling node of this node.
- const XMLNode* PreviousSibling() const {
- return _prev;
- }
-
- XMLNode* PreviousSibling() {
- return _prev;
- }
-
- /// Get the previous (left) sibling element of this node, with an optionally supplied name.
- const XMLElement* PreviousSiblingElement( const char* name = 0 ) const ;
-
- XMLElement* PreviousSiblingElement( const char* name = 0 ) {
- return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement( name ) );
- }
-
- /// Get the next (right) sibling node of this node.
- const XMLNode* NextSibling() const {
- return _next;
- }
-
- XMLNode* NextSibling() {
- return _next;
- }
-
- /// Get the next (right) sibling element of this node, with an optionally supplied name.
- const XMLElement* NextSiblingElement( const char* name = 0 ) const;
-
- XMLElement* NextSiblingElement( const char* name = 0 ) {
- return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement( name ) );
- }
-
- /**
- Add a child node as the last (right) child.
- If the child node is already part of the document,
- it is moved from its old location to the new location.
- Returns the addThis argument or 0 if the node does not
- belong to the same document.
- */
- XMLNode* InsertEndChild( XMLNode* addThis );
-
- XMLNode* LinkEndChild( XMLNode* addThis ) {
- return InsertEndChild( addThis );
- }
- /**
- Add a child node as the first (left) child.
- If the child node is already part of the document,
- it is moved from its old location to the new location.
- Returns the addThis argument or 0 if the node does not
- belong to the same document.
- */
- XMLNode* InsertFirstChild( XMLNode* addThis );
- /**
- Add a node after the specified child node.
- If the child node is already part of the document,
- it is moved from its old location to the new location.
- Returns the addThis argument or 0 if the afterThis node
- is not a child of this node, or if the node does not
- belong to the same document.
- */
- XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis );
-
- /**
- Delete all the children of this node.
- */
- void DeleteChildren();
-
- /**
- Delete a child of this node.
- */
- void DeleteChild( XMLNode* node );
-
- /**
- Make a copy of this node, but not its children.
- You may pass in a Document pointer that will be
- the owner of the new Node. If the 'document' is
- null, then the node returned will be allocated
- from the current Document. (this->GetDocument())
-
- Note: if called on a XMLDocument, this will return null.
- */
- virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0;
-
- /**
- Make a copy of this node and all its children.
-
- If the 'target' is null, then the nodes will
+ (3) Wrapped everything in Amazon namespace to prevent static linking issues if the user includes a version of this code through another dependency
+*/
+#ifndef TINYXML2_INCLUDED
+#define TINYXML2_INCLUDED
+
+#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__)
+# include <ctype.h>
+# include <limits.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# if defined(__PS3__)
+# include <stddef.h>
+# endif
+#else
+# include <cctype>
+# include <climits>
+# include <cstdio>
+# include <cstdlib>
+# include <cstring>
+#endif
+#include <stdint.h>
+
+#include <aws/core/utils/memory/AWSMemory.h>
+
+/*
+ TODO: intern strings instead of allocation.
+*/
+/*
+ gcc:
+ g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe
+
+ Formatting, Artistic Style:
+ AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h
+*/
+
+#if defined( _DEBUG ) || defined (__DEBUG__)
+# ifndef DEBUG
+# define DEBUG
+# endif
+#endif
+
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable: 4251)
+#endif
+
+#ifdef _WIN32
+ #ifdef USE_IMPORT_EXPORT
+ #ifdef AWS_CORE_EXPORTS
+ #define TINYXML2_LIB __declspec(dllexport)
+ #else
+ #define TINYXML2_LIB __declspec(dllimport)
+ #endif // AWS_CORE_EXPORTS
+ #endif // USE_IMPORT_EXPORT
+#elif __GNUC__ >= 4
+ #define TINYXML2_LIB __attribute__((visibility("default")))
+#endif // _WIN32
+
+#ifndef TINYXML2_LIB
+ #define TINYXML2_LIB
+#endif // TINYXML2_LIB
+
+#if defined(DEBUG)
+# if defined(_MSC_VER)
+# // "(void)0," is for suppressing C4127 warning in "assert(false)", "assert(true)" and the like
+# define TIXMLASSERT( x ) if ( !((void)0,(x))) { __debugbreak(); }
+# elif defined (ANDROID_NDK)
+# include <android/log.h>
+# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); }
+# else
+# include <assert.h>
+# define TIXMLASSERT assert
+# endif
+#else
+# define TIXMLASSERT( x ) {}
+#endif
+
+
+/* Versioning, past 1.0.14:
+ http://semver.org/
+*/
+static const int TIXML2_MAJOR_VERSION = 6;
+static const int TIXML2_MINOR_VERSION = 1;
+static const int TIXML2_PATCH_VERSION = 0;
+
+#define TINYXML2_MAJOR_VERSION 6
+#define TINYXML2_MINOR_VERSION 1
+#define TINYXML2_PATCH_VERSION 0
+
+namespace Aws
+{
+namespace External
+{
+namespace tinyxml2
+{
+class XMLDocument;
+class XMLElement;
+class XMLAttribute;
+class XMLComment;
+class XMLText;
+class XMLDeclaration;
+class XMLUnknown;
+class XMLPrinter;
+
+static const char* ALLOCATION_TAG = "AWS::TinyXML";
+
+/*
+ A class that wraps strings. Normally stores the start and end
+ pointers into the XML file itself, and will apply normalization
+ and entity translation if actually read. Can also store (and memory
+ manage) a traditional char[]
+*/
+class TINYXML2_LIB StrPair
+{
+public:
+ enum {
+ NEEDS_ENTITY_PROCESSING = 0x01,
+ NEEDS_NEWLINE_NORMALIZATION = 0x02,
+ NEEDS_WHITESPACE_COLLAPSING = 0x04,
+
+ TEXT_ELEMENT = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,
+ TEXT_ELEMENT_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION,
+ ATTRIBUTE_NAME = 0,
+ ATTRIBUTE_VALUE = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,
+ ATTRIBUTE_VALUE_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION,
+ COMMENT = NEEDS_NEWLINE_NORMALIZATION
+ };
+
+ StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {}
+ ~StrPair();
+
+ void Set( char* start, char* end, int flags ) {
+ TIXMLASSERT( start );
+ TIXMLASSERT( end );
+ Reset();
+ _start = start;
+ _end = end;
+ _flags = flags | NEEDS_FLUSH;
+ }
+
+ const char* GetStr();
+
+ bool Empty() const {
+ return _start == _end;
+ }
+
+ void SetInternedStr( const char* str ) {
+ Reset();
+ _start = const_cast<char*>(str);
+ }
+
+ void SetStr( const char* str, int flags=0 );
+
+ char* ParseText( char* in, const char* endTag, int strFlags, int* curLineNumPtr );
+ char* ParseName( char* in );
+
+ void TransferTo( StrPair* other );
+ void Reset();
+
+private:
+ void CollapseWhitespace();
+
+ enum {
+ NEEDS_FLUSH = 0x100,
+ NEEDS_DELETE = 0x200
+ };
+
+ int _flags;
+ char* _start;
+ char* _end;
+
+ StrPair( const StrPair& other ); // not supported
+ void operator=( StrPair& other ); // not supported, use TransferTo()
+};
+
+
+/*
+ A dynamic array of Plain Old Data. Doesn't support constructors, etc.
+ Has a small initial memory pool, so that low or no usage will not
+ cause a call to new/delete
+*/
+template <class T, int INITIAL_SIZE>
+class DynArray
+{
+public:
+ DynArray() :
+ _mem( _pool ),
+ _allocated( INITIAL_SIZE ),
+ _size( 0 )
+ {
+ }
+
+ ~DynArray() {
+ if ( _mem != _pool ) {
+ Aws::DeleteArray<T>(_mem);
+ }
+ }
+
+ void Clear() {
+ _size = 0;
+ }
+
+ void Push( T t ) {
+ TIXMLASSERT( _size < INT_MAX );
+ EnsureCapacity( _size+1 );
+ _mem[_size] = t;
+ ++_size;
+ }
+
+ T* PushArr( int count ) {
+ TIXMLASSERT( count >= 0 );
+ TIXMLASSERT( _size <= INT_MAX - count );
+ EnsureCapacity( _size+count );
+ T* ret = &_mem[_size];
+ _size += count;
+ return ret;
+ }
+
+ T Pop() {
+ TIXMLASSERT( _size > 0 );
+ --_size;
+ return _mem[_size];
+ }
+
+ void PopArr( int count ) {
+ TIXMLASSERT( _size >= count );
+ _size -= count;
+ }
+
+ bool Empty() const {
+ return _size == 0;
+ }
+
+ T& operator[](int i) {
+ TIXMLASSERT( i>= 0 && i < _size );
+ return _mem[i];
+ }
+
+ const T& operator[](int i) const {
+ TIXMLASSERT( i>= 0 && i < _size );
+ return _mem[i];
+ }
+
+ const T& PeekTop() const {
+ TIXMLASSERT( _size > 0 );
+ return _mem[ _size - 1];
+ }
+
+ int Size() const {
+ TIXMLASSERT( _size >= 0 );
+ return _size;
+ }
+
+ int Capacity() const {
+ TIXMLASSERT( _allocated >= INITIAL_SIZE );
+ return _allocated;
+ }
+
+ void SwapRemove(int i) {
+ TIXMLASSERT(i >= 0 && i < _size);
+ TIXMLASSERT(_size > 0);
+ _mem[i] = _mem[_size - 1];
+ --_size;
+ }
+
+ const T* Mem() const {
+ TIXMLASSERT( _mem );
+ return _mem;
+ }
+
+ T* Mem() {
+ TIXMLASSERT( _mem );
+ return _mem;
+ }
+
+private:
+ DynArray( const DynArray& ); // not supported
+ void operator=( const DynArray& ); // not supported
+
+ void EnsureCapacity( int cap ) {
+ TIXMLASSERT( cap > 0 );
+ if ( cap > _allocated ) {
+ TIXMLASSERT( cap <= INT_MAX / 2 );
+ int newAllocated = cap * 2;
+ T* newMem = Aws::NewArray<T>(newAllocated, ALLOCATION_TAG);
+ TIXMLASSERT( newAllocated >= _size );
+ memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs
+ if ( _mem != _pool ) {
+ Aws::DeleteArray<T>(_mem);
+ }
+ _mem = newMem;
+ _allocated = newAllocated;
+ }
+ }
+
+ T* _mem;
+ T _pool[INITIAL_SIZE];
+ int _allocated; // objects allocated
+ int _size; // number objects in use
+};
+
+
+/*
+ Parent virtual class of a pool for fast allocation
+ and deallocation of objects.
+*/
+class MemPool
+{
+public:
+ MemPool() {}
+ virtual ~MemPool() {}
+
+ virtual int ItemSize() const = 0;
+ virtual void* Alloc() = 0;
+ virtual void Free( void* ) = 0;
+ virtual void SetTracked() = 0;
+ virtual void Clear() = 0;
+};
+
+
+/*
+ Template child class to create pools of the correct type.
+*/
+template< int ITEM_SIZE >
+class MemPoolT : public MemPool
+{
+public:
+ MemPoolT() : _blockPtrs(), _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {}
+ ~MemPoolT() {
+ Clear();
+ }
+
+ void Clear() {
+ // Delete the blocks.
+ while( !_blockPtrs.Empty()) {
+ Block* lastBlock = _blockPtrs.Pop();
+ Aws::Delete(lastBlock);
+ }
+ _root = 0;
+ _currentAllocs = 0;
+ _nAllocs = 0;
+ _maxAllocs = 0;
+ _nUntracked = 0;
+ }
+
+ virtual int ItemSize() const {
+ return ITEM_SIZE;
+ }
+ int CurrentAllocs() const {
+ return _currentAllocs;
+ }
+
+ virtual void* Alloc() {
+ if ( !_root ) {
+ // Need a new block.
+ Block* block = Aws::New<Block>(ALLOCATION_TAG);
+ _blockPtrs.Push( block );
+
+ Item* blockItems = block->items;
+ for( int i = 0; i < ITEMS_PER_BLOCK - 1; ++i ) {
+ blockItems[i].next = &(blockItems[i + 1]);
+ }
+ blockItems[ITEMS_PER_BLOCK - 1].next = 0;
+ _root = blockItems;
+ }
+ Item* const result = _root;
+ TIXMLASSERT( result != 0 );
+ _root = _root->next;
+
+ ++_currentAllocs;
+ if ( _currentAllocs > _maxAllocs ) {
+ _maxAllocs = _currentAllocs;
+ }
+ ++_nAllocs;
+ ++_nUntracked;
+ return result;
+ }
+
+ virtual void Free( void* mem ) {
+ if ( !mem ) {
+ return;
+ }
+ --_currentAllocs;
+ Item* item = static_cast<Item*>( mem );
+#ifdef DEBUG
+ memset( item, 0xfe, sizeof( *item ) );
+#endif
+ item->next = _root;
+ _root = item;
+ }
+ void Trace( const char* name ) {
+ printf( "Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n",
+ name, _maxAllocs, _maxAllocs * ITEM_SIZE / 1024, _currentAllocs,
+ ITEM_SIZE, _nAllocs, _blockPtrs.Size() );
+ }
+
+ void SetTracked() {
+ --_nUntracked;
+ }
+
+ int Untracked() const {
+ return _nUntracked;
+ }
+
+ // This number is perf sensitive. 4k seems like a good tradeoff on my machine.
+ // The test file is large, 170k.
+ // Release: VS2010 gcc(no opt)
+ // 1k: 4000
+ // 2k: 4000
+ // 4k: 3900 21000
+ // 16k: 5200
+ // 32k: 4300
+ // 64k: 4000 21000
+ // Declared public because some compilers do not accept to use ITEMS_PER_BLOCK
+ // in private part if ITEMS_PER_BLOCK is private
+ enum { ITEMS_PER_BLOCK = (4 * 1024) / ITEM_SIZE };
+
+private:
+ MemPoolT( const MemPoolT& ); // not supported
+ void operator=( const MemPoolT& ); // not supported
+
+ union Item {
+ Item* next;
+ char itemData[ITEM_SIZE];
+ };
+ struct Block {
+ Item items[ITEMS_PER_BLOCK];
+ };
+ DynArray< Block*, 10 > _blockPtrs;
+ Item* _root;
+
+ int _currentAllocs;
+ int _nAllocs;
+ int _maxAllocs;
+ int _nUntracked;
+};
+
+
+
+/**
+ Implements the interface to the "Visitor pattern" (see the Accept() method.)
+ If you call the Accept() method, it requires being passed a XMLVisitor
+ class to handle callbacks. For nodes that contain other nodes (Document, Element)
+ you will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs
+ are simply called with Visit().
+
+ If you return 'true' from a Visit method, recursive parsing will continue. If you return
+ false, <b>no children of this node or its siblings</b> will be visited.
+
+ All flavors of Visit methods have a default implementation that returns 'true' (continue
+ visiting). You need to only override methods that are interesting to you.
+
+ Generally Accept() is called on the XMLDocument, although all nodes support visiting.
+
+ You should never change the document from a callback.
+
+ @sa XMLNode::Accept()
+*/
+class TINYXML2_LIB XMLVisitor
+{
+public:
+ virtual ~XMLVisitor() {}
+
+ /// Visit a document.
+ virtual bool VisitEnter( const XMLDocument& /*doc*/ ) {
+ return true;
+ }
+ /// Visit a document.
+ virtual bool VisitExit( const XMLDocument& /*doc*/ ) {
+ return true;
+ }
+
+ /// Visit an element.
+ virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ ) {
+ return true;
+ }
+ /// Visit an element.
+ virtual bool VisitExit( const XMLElement& /*element*/ ) {
+ return true;
+ }
+
+ /// Visit a declaration.
+ virtual bool Visit( const XMLDeclaration& /*declaration*/ ) {
+ return true;
+ }
+ /// Visit a text node.
+ virtual bool Visit( const XMLText& /*text*/ ) {
+ return true;
+ }
+ /// Visit a comment node.
+ virtual bool Visit( const XMLComment& /*comment*/ ) {
+ return true;
+ }
+ /// Visit an unknown node.
+ virtual bool Visit( const XMLUnknown& /*unknown*/ ) {
+ return true;
+ }
+};
+
+// WARNING: must match XMLDocument::_errorNames[]
+enum XMLError {
+ XML_SUCCESS = 0,
+ XML_NO_ATTRIBUTE,
+ XML_WRONG_ATTRIBUTE_TYPE,
+ XML_ERROR_FILE_NOT_FOUND,
+ XML_ERROR_FILE_COULD_NOT_BE_OPENED,
+ XML_ERROR_FILE_READ_ERROR,
+ UNUSED_XML_ERROR_ELEMENT_MISMATCH, // remove at next major version
+ XML_ERROR_PARSING_ELEMENT,
+ XML_ERROR_PARSING_ATTRIBUTE,
+ UNUSED_XML_ERROR_IDENTIFYING_TAG, // remove at next major version
+ XML_ERROR_PARSING_TEXT,
+ XML_ERROR_PARSING_CDATA,
+ XML_ERROR_PARSING_COMMENT,
+ XML_ERROR_PARSING_DECLARATION,
+ XML_ERROR_PARSING_UNKNOWN,
+ XML_ERROR_EMPTY_DOCUMENT,
+ XML_ERROR_MISMATCHED_ELEMENT,
+ XML_ERROR_PARSING,
+ XML_CAN_NOT_CONVERT_TEXT,
+ XML_NO_TEXT_NODE,
+
+ XML_ERROR_COUNT
+};
+
+
+/*
+ Utility functionality.
+*/
+class TINYXML2_LIB XMLUtil
+{
+public:
+ static const char* SkipWhiteSpace( const char* p, int* curLineNumPtr ) {
+ TIXMLASSERT( p );
+
+ while( IsWhiteSpace(*p) ) {
+ if (curLineNumPtr && *p == '\n') {
+ ++(*curLineNumPtr);
+ }
+ ++p;
+ }
+ TIXMLASSERT( p );
+ return p;
+ }
+ static char* SkipWhiteSpace( char* p, int* curLineNumPtr ) {
+ return const_cast<char*>( SkipWhiteSpace( const_cast<const char*>(p), curLineNumPtr ) );
+ }
+
+ // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't
+ // correct, but simple, and usually works.
+ static bool IsWhiteSpace( char p ) {
+ return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) );
+ }
+
+ inline static bool IsNameStartChar( unsigned char ch ) {
+ if ( ch >= 128 ) {
+ // This is a heuristic guess in attempt to not implement Unicode-aware isalpha()
+ return true;
+ }
+ if ( isalpha( ch ) ) {
+ return true;
+ }
+ return ch == ':' || ch == '_';
+ }
+
+ inline static bool IsNameChar( unsigned char ch ) {
+ return IsNameStartChar( ch )
+ || isdigit( ch )
+ || ch == '.'
+ || ch == '-';
+ }
+
+ inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) {
+ if ( p == q ) {
+ return true;
+ }
+ TIXMLASSERT( p );
+ TIXMLASSERT( q );
+ TIXMLASSERT( nChar >= 0 );
+ return strncmp( p, q, nChar ) == 0;
+ }
+
+ inline static bool IsUTF8Continuation( char p ) {
+ return ( p & 0x80 ) != 0;
+ }
+
+ static const char* ReadBOM( const char* p, bool* hasBOM );
+ // p is the starting location,
+ // the UTF-8 value of the entity will be placed in value, and length filled in.
+ static const char* GetCharacterRef( const char* p, char* value, int* length );
+ static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );
+
+ // converts primitive types to strings
+ static void ToStr( int v, char* buffer, int bufferSize );
+ static void ToStr( unsigned v, char* buffer, int bufferSize );
+ static void ToStr( bool v, char* buffer, int bufferSize );
+ static void ToStr( float v, char* buffer, int bufferSize );
+ static void ToStr( double v, char* buffer, int bufferSize );
+ static void ToStr(int64_t v, char* buffer, int bufferSize);
+
+ // converts strings to primitive types
+ static bool ToInt( const char* str, int* value );
+ static bool ToUnsigned( const char* str, unsigned* value );
+ static bool ToBool( const char* str, bool* value );
+ static bool ToFloat( const char* str, float* value );
+ static bool ToDouble( const char* str, double* value );
+ static bool ToInt64(const char* str, int64_t* value);
+
+ // Changes what is serialized for a boolean value.
+ // Default to "true" and "false". Shouldn't be changed
+ // unless you have a special testing or compatibility need.
+ // Be careful: static, global, & not thread safe.
+ // Be sure to set static const memory as parameters.
+ static void SetBoolSerialization(const char* writeTrue, const char* writeFalse);
+
+private:
+ static const char* writeBoolTrue;
+ static const char* writeBoolFalse;
+};
+
+
+/** XMLNode is a base class for every object that is in the
+ XML Document Object Model (DOM), except XMLAttributes.
+ Nodes have siblings, a parent, and children which can
+ be navigated. A node is always in a XMLDocument.
+ The type of a XMLNode can be queried, and it can
+ be cast to its more defined type.
+
+ A XMLDocument allocates memory for all its Nodes.
+ When the XMLDocument gets deleted, all its Nodes
+ will also be deleted.
+
+ @verbatim
+ A Document can contain: Element (container or leaf)
+ Comment (leaf)
+ Unknown (leaf)
+ Declaration( leaf )
+
+ An Element can contain: Element (container or leaf)
+ Text (leaf)
+ Attributes (not on tree)
+ Comment (leaf)
+ Unknown (leaf)
+
+ @endverbatim
+*/
+class TINYXML2_LIB XMLNode
+{
+ friend class XMLDocument;
+ friend class XMLElement;
+public:
+
+ /// Get the XMLDocument that owns this XMLNode.
+ const XMLDocument* GetDocument() const {
+ TIXMLASSERT( _document );
+ return _document;
+ }
+ /// Get the XMLDocument that owns this XMLNode.
+ XMLDocument* GetDocument() {
+ TIXMLASSERT( _document );
+ return _document;
+ }
+
+ /// Safely cast to an Element, or null.
+ virtual XMLElement* ToElement() {
+ return 0;
+ }
+ /// Safely cast to Text, or null.
+ virtual XMLText* ToText() {
+ return 0;
+ }
+ /// Safely cast to a Comment, or null.
+ virtual XMLComment* ToComment() {
+ return 0;
+ }
+ /// Safely cast to a Document, or null.
+ virtual XMLDocument* ToDocument() {
+ return 0;
+ }
+ /// Safely cast to a Declaration, or null.
+ virtual XMLDeclaration* ToDeclaration() {
+ return 0;
+ }
+ /// Safely cast to an Unknown, or null.
+ virtual XMLUnknown* ToUnknown() {
+ return 0;
+ }
+
+ virtual const XMLElement* ToElement() const {
+ return 0;
+ }
+ virtual const XMLText* ToText() const {
+ return 0;
+ }
+ virtual const XMLComment* ToComment() const {
+ return 0;
+ }
+ virtual const XMLDocument* ToDocument() const {
+ return 0;
+ }
+ virtual const XMLDeclaration* ToDeclaration() const {
+ return 0;
+ }
+ virtual const XMLUnknown* ToUnknown() const {
+ return 0;
+ }
+
+ /** The meaning of 'value' changes for the specific type.
+ @verbatim
+ Document: empty (NULL is returned, not an empty string)
+ Element: name of the element
+ Comment: the comment text
+ Unknown: the tag contents
+ Text: the text string
+ @endverbatim
+ */
+ const char* Value() const;
+
+ /** Set the Value of an XML node.
+ @sa Value()
+ */
+ void SetValue( const char* val, bool staticMem=false );
+
+ /// Gets the line number the node is in, if the document was parsed from a file.
+ int GetLineNum() const { return _parseLineNum; }
+
+ /// Get the parent of this node on the DOM.
+ const XMLNode* Parent() const {
+ return _parent;
+ }
+
+ XMLNode* Parent() {
+ return _parent;
+ }
+
+ /// Returns true if this node has no children.
+ bool NoChildren() const {
+ return !_firstChild;
+ }
+
+ /// Get the first child node, or null if none exists.
+ const XMLNode* FirstChild() const {
+ return _firstChild;
+ }
+
+ XMLNode* FirstChild() {
+ return _firstChild;
+ }
+
+ /** Get the first child element, or optionally the first child
+ element with the specified name.
+ */
+ const XMLElement* FirstChildElement( const char* name = 0 ) const;
+
+ XMLElement* FirstChildElement( const char* name = 0 ) {
+ return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement( name ));
+ }
+
+ /// Get the last child node, or null if none exists.
+ const XMLNode* LastChild() const {
+ return _lastChild;
+ }
+
+ XMLNode* LastChild() {
+ return _lastChild;
+ }
+
+ /** Get the last child element or optionally the last child
+ element with the specified name.
+ */
+ const XMLElement* LastChildElement( const char* name = 0 ) const;
+
+ XMLElement* LastChildElement( const char* name = 0 ) {
+ return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(name) );
+ }
+
+ /// Get the previous (left) sibling node of this node.
+ const XMLNode* PreviousSibling() const {
+ return _prev;
+ }
+
+ XMLNode* PreviousSibling() {
+ return _prev;
+ }
+
+ /// Get the previous (left) sibling element of this node, with an optionally supplied name.
+ const XMLElement* PreviousSiblingElement( const char* name = 0 ) const ;
+
+ XMLElement* PreviousSiblingElement( const char* name = 0 ) {
+ return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement( name ) );
+ }
+
+ /// Get the next (right) sibling node of this node.
+ const XMLNode* NextSibling() const {
+ return _next;
+ }
+
+ XMLNode* NextSibling() {
+ return _next;
+ }
+
+ /// Get the next (right) sibling element of this node, with an optionally supplied name.
+ const XMLElement* NextSiblingElement( const char* name = 0 ) const;
+
+ XMLElement* NextSiblingElement( const char* name = 0 ) {
+ return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement( name ) );
+ }
+
+ /**
+ Add a child node as the last (right) child.
+ If the child node is already part of the document,
+ it is moved from its old location to the new location.
+ Returns the addThis argument or 0 if the node does not
+ belong to the same document.
+ */
+ XMLNode* InsertEndChild( XMLNode* addThis );
+
+ XMLNode* LinkEndChild( XMLNode* addThis ) {
+ return InsertEndChild( addThis );
+ }
+ /**
+ Add a child node as the first (left) child.
+ If the child node is already part of the document,
+ it is moved from its old location to the new location.
+ Returns the addThis argument or 0 if the node does not
+ belong to the same document.
+ */
+ XMLNode* InsertFirstChild( XMLNode* addThis );
+ /**
+ Add a node after the specified child node.
+ If the child node is already part of the document,
+ it is moved from its old location to the new location.
+ Returns the addThis argument or 0 if the afterThis node
+ is not a child of this node, or if the node does not
+ belong to the same document.
+ */
+ XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis );
+
+ /**
+ Delete all the children of this node.
+ */
+ void DeleteChildren();
+
+ /**
+ Delete a child of this node.
+ */
+ void DeleteChild( XMLNode* node );
+
+ /**
+ Make a copy of this node, but not its children.
+ You may pass in a Document pointer that will be
+ the owner of the new Node. If the 'document' is
+ null, then the node returned will be allocated
+ from the current Document. (this->GetDocument())
+
+ Note: if called on a XMLDocument, this will return null.
+ */
+ virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0;
+
+ /**
+ Make a copy of this node and all its children.
+
+ If the 'target' is null, then the nodes will
be allocated in the current document. If 'target'
is specified, the memory will be allocated is the
- specified XMLDocument.
-
+ specified XMLDocument.
+
NOTE: This is probably not the correct tool to
- copy a document, since XMLDocuments can have multiple
- top level XMLNodes. You probably want to use
- XMLDocument::DeepCopy()
- */
- XMLNode* DeepClone( XMLDocument* target ) const;
-
- /**
- Test if 2 nodes are the same, but don't test children.
- The 2 nodes do not need to be in the same Document.
-
- Note: if called on a XMLDocument, this will return false.
- */
- virtual bool ShallowEqual( const XMLNode* compare ) const = 0;
-
- /** Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the
- XML tree will be conditionally visited and the host will be called back
- via the XMLVisitor interface.
-
- This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse
- the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this
- interface versus any other.)
-
- The interface has been based on ideas from:
-
- - http://www.saxproject.org/
- - http://c2.com/cgi/wiki?HierarchicalVisitorPattern
-
- Which are both good references for "visiting".
-
- An example of using Accept():
- @verbatim
- XMLPrinter printer;
- tinyxmlDoc.Accept( &printer );
- const char* xmlcstr = printer.CStr();
- @endverbatim
- */
- virtual bool Accept( XMLVisitor* visitor ) const = 0;
-
+ copy a document, since XMLDocuments can have multiple
+ top level XMLNodes. You probably want to use
+ XMLDocument::DeepCopy()
+ */
+ XMLNode* DeepClone( XMLDocument* target ) const;
+
+ /**
+ Test if 2 nodes are the same, but don't test children.
+ The 2 nodes do not need to be in the same Document.
+
+ Note: if called on a XMLDocument, this will return false.
+ */
+ virtual bool ShallowEqual( const XMLNode* compare ) const = 0;
+
+ /** Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the
+ XML tree will be conditionally visited and the host will be called back
+ via the XMLVisitor interface.
+
+ This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse
+ the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this
+ interface versus any other.)
+
+ The interface has been based on ideas from:
+
+ - http://www.saxproject.org/
+ - http://c2.com/cgi/wiki?HierarchicalVisitorPattern
+
+ Which are both good references for "visiting".
+
+ An example of using Accept():
+ @verbatim
+ XMLPrinter printer;
+ tinyxmlDoc.Accept( &printer );
+ const char* xmlcstr = printer.CStr();
+ @endverbatim
+ */
+ virtual bool Accept( XMLVisitor* visitor ) const = 0;
+
/**
Set user data into the XMLNode. TinyXML-2 in
- no way processes or interprets user data.
- It is initially 0.
- */
- void SetUserData(void* userData) { _userData = userData; }
-
- /**
- Get user data set into the XMLNode. TinyXML-2 in
- no way processes or interprets user data.
- It is initially 0.
- */
- void* GetUserData() const { return _userData; }
-
-protected:
- XMLNode( XMLDocument* );
- virtual ~XMLNode();
-
- virtual char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr);
-
- XMLDocument* _document;
- XMLNode* _parent;
- mutable StrPair _value;
- int _parseLineNum;
-
- XMLNode* _firstChild;
- XMLNode* _lastChild;
-
- XMLNode* _prev;
- XMLNode* _next;
-
- void* _userData;
-
-private:
- MemPool* _memPool;
- void Unlink( XMLNode* child );
- static void DeleteNode( XMLNode* node );
- void InsertChildPreamble( XMLNode* insertThis ) const;
- const XMLElement* ToElementWithName( const char* name ) const;
-
- XMLNode( const XMLNode& ); // not supported
- XMLNode& operator=( const XMLNode& ); // not supported
-};
-
-
-/** XML text.
-
- Note that a text node can have child element nodes, for example:
- @verbatim
- <root>This is <b>bold</b></root>
- @endverbatim
-
- A text node can have 2 ways to output the next. "normal" output
- and CDATA. It will default to the mode it was parsed from the XML file and
- you generally want to leave it alone, but you can change the output mode with
- SetCData() and query it with CData().
-*/
-class TINYXML2_LIB XMLText : public XMLNode
-{
- friend class XMLDocument;
-public:
- virtual bool Accept( XMLVisitor* visitor ) const;
-
- virtual XMLText* ToText() {
- return this;
- }
- virtual const XMLText* ToText() const {
- return this;
- }
-
- /// Declare whether this should be CDATA or standard text.
- void SetCData( bool isCData ) {
- _isCData = isCData;
- }
- /// Returns true if this is a CDATA text element.
- bool CData() const {
- return _isCData;
- }
-
- virtual XMLNode* ShallowClone( XMLDocument* document ) const;
- virtual bool ShallowEqual( const XMLNode* compare ) const;
-
-protected:
- XMLText( XMLDocument* doc ) : XMLNode( doc ), _isCData( false ) {}
- virtual ~XMLText() {}
-
- char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );
-
-private:
- bool _isCData;
-
- XMLText( const XMLText& ); // not supported
- XMLText& operator=( const XMLText& ); // not supported
-};
-
-
-/** An XML Comment. */
-class TINYXML2_LIB XMLComment : public XMLNode
-{
- friend class XMLDocument;
-public:
- virtual XMLComment* ToComment() {
- return this;
- }
- virtual const XMLComment* ToComment() const {
- return this;
- }
-
- virtual bool Accept( XMLVisitor* visitor ) const;
-
- virtual XMLNode* ShallowClone( XMLDocument* document ) const;
- virtual bool ShallowEqual( const XMLNode* compare ) const;
-
-protected:
- XMLComment( XMLDocument* doc );
- virtual ~XMLComment();
-
- char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr);
-
-private:
- XMLComment( const XMLComment& ); // not supported
- XMLComment& operator=( const XMLComment& ); // not supported
-};
-
-
-/** In correct XML the declaration is the first entry in the file.
- @verbatim
- <?xml version="1.0" standalone="yes"?>
- @endverbatim
-
- TinyXML-2 will happily read or write files without a declaration,
- however.
-
- The text of the declaration isn't interpreted. It is parsed
- and written as a string.
-*/
-class TINYXML2_LIB XMLDeclaration : public XMLNode
-{
- friend class XMLDocument;
-public:
- virtual XMLDeclaration* ToDeclaration() {
- return this;
- }
- virtual const XMLDeclaration* ToDeclaration() const {
- return this;
- }
-
- virtual bool Accept( XMLVisitor* visitor ) const;
-
- virtual XMLNode* ShallowClone( XMLDocument* document ) const;
- virtual bool ShallowEqual( const XMLNode* compare ) const;
-
-protected:
- XMLDeclaration( XMLDocument* doc );
- virtual ~XMLDeclaration();
-
- char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );
-
-private:
- XMLDeclaration( const XMLDeclaration& ); // not supported
- XMLDeclaration& operator=( const XMLDeclaration& ); // not supported
-};
-
-
-/** Any tag that TinyXML-2 doesn't recognize is saved as an
- unknown. It is a tag of text, but should not be modified.
- It will be written back to the XML, unchanged, when the file
- is saved.
-
- DTD tags get thrown into XMLUnknowns.
-*/
-class TINYXML2_LIB XMLUnknown : public XMLNode
-{
- friend class XMLDocument;
-public:
- virtual XMLUnknown* ToUnknown() {
- return this;
- }
- virtual const XMLUnknown* ToUnknown() const {
- return this;
- }
-
- virtual bool Accept( XMLVisitor* visitor ) const;
-
- virtual XMLNode* ShallowClone( XMLDocument* document ) const;
- virtual bool ShallowEqual( const XMLNode* compare ) const;
-
-protected:
- XMLUnknown( XMLDocument* doc );
- virtual ~XMLUnknown();
-
- char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );
-
-private:
- XMLUnknown( const XMLUnknown& ); // not supported
- XMLUnknown& operator=( const XMLUnknown& ); // not supported
-};
-
-
-
-/** An attribute is a name-value pair. Elements have an arbitrary
- number of attributes, each with a unique name.
-
- @note The attributes are not XMLNodes. You may only query the
- Next() attribute in a list.
-*/
-class TINYXML2_LIB XMLAttribute
-{
- friend class XMLElement;
-public:
- /// The name of the attribute.
- const char* Name() const;
-
- /// The value of the attribute.
- const char* Value() const;
-
- /// Gets the line number the attribute is in, if the document was parsed from a file.
- int GetLineNum() const { return _parseLineNum; }
-
- /// The next attribute in the list.
- const XMLAttribute* Next() const {
- return _next;
- }
-
- /** IntValue interprets the attribute as an integer, and returns the value.
- If the value isn't an integer, 0 will be returned. There is no error checking;
- use QueryIntValue() if you need error checking.
- */
- int IntValue() const {
- int i = 0;
- QueryIntValue(&i);
- return i;
- }
-
- int64_t Int64Value() const {
- int64_t i = 0;
- QueryInt64Value(&i);
- return i;
- }
-
- /// Query as an unsigned integer. See IntValue()
- unsigned UnsignedValue() const {
- unsigned i=0;
- QueryUnsignedValue( &i );
- return i;
- }
- /// Query as a boolean. See IntValue()
- bool BoolValue() const {
- bool b=false;
- QueryBoolValue( &b );
- return b;
- }
- /// Query as a double. See IntValue()
- double DoubleValue() const {
- double d=0;
- QueryDoubleValue( &d );
- return d;
- }
- /// Query as a float. See IntValue()
- float FloatValue() const {
- float f=0;
- QueryFloatValue( &f );
- return f;
- }
-
- /** QueryIntValue interprets the attribute as an integer, and returns the value
- in the provided parameter. The function will return XML_SUCCESS on success,
- and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.
- */
- XMLError QueryIntValue( int* value ) const;
- /// See QueryIntValue
- XMLError QueryUnsignedValue( unsigned int* value ) const;
- /// See QueryIntValue
- XMLError QueryInt64Value(int64_t* value) const;
- /// See QueryIntValue
- XMLError QueryBoolValue( bool* value ) const;
- /// See QueryIntValue
- XMLError QueryDoubleValue( double* value ) const;
- /// See QueryIntValue
- XMLError QueryFloatValue( float* value ) const;
-
- /// Set the attribute to a string value.
- void SetAttribute( const char* value );
- /// Set the attribute to value.
- void SetAttribute( int value );
- /// Set the attribute to value.
- void SetAttribute( unsigned value );
- /// Set the attribute to value.
- void SetAttribute(int64_t value);
- /// Set the attribute to value.
- void SetAttribute( bool value );
- /// Set the attribute to value.
- void SetAttribute( double value );
- /// Set the attribute to value.
- void SetAttribute( float value );
-
-private:
- enum { BUF_SIZE = 200 };
-
- XMLAttribute() : _name(), _value(),_parseLineNum( 0 ), _next( 0 ), _memPool( 0 ) {}
- virtual ~XMLAttribute() {}
-
- XMLAttribute( const XMLAttribute& ); // not supported
- void operator=( const XMLAttribute& ); // not supported
- void SetName( const char* name );
-
- char* ParseDeep( char* p, bool processEntities, int* curLineNumPtr );
-
- mutable StrPair _name;
- mutable StrPair _value;
- int _parseLineNum;
- XMLAttribute* _next;
- MemPool* _memPool;
-};
-
-
-/** The element is a container class. It has a value, the element name,
- and can contain other elements, text, comments, and unknowns.
- Elements also contain an arbitrary number of attributes.
-*/
-class TINYXML2_LIB XMLElement : public XMLNode
-{
- friend class XMLDocument;
-public:
- /// Get the name of an element (which is the Value() of the node.)
- const char* Name() const {
- return Value();
- }
- /// Set the name of the element.
- void SetName( const char* str, bool staticMem=false ) {
- SetValue( str, staticMem );
- }
-
- virtual XMLElement* ToElement() {
- return this;
- }
- virtual const XMLElement* ToElement() const {
- return this;
- }
- virtual bool Accept( XMLVisitor* visitor ) const;
-
- /** Given an attribute name, Attribute() returns the value
- for the attribute of that name, or null if none
- exists. For example:
-
- @verbatim
- const char* value = ele->Attribute( "foo" );
- @endverbatim
-
- The 'value' parameter is normally null. However, if specified,
- the attribute will only be returned if the 'name' and 'value'
- match. This allow you to write code:
-
- @verbatim
- if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar();
- @endverbatim
-
- rather than:
- @verbatim
- if ( ele->Attribute( "foo" ) ) {
- if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar();
- }
- @endverbatim
- */
- const char* Attribute( const char* name, const char* value=0 ) const;
-
- /** Given an attribute name, IntAttribute() returns the value
- of the attribute interpreted as an integer. The default
- value will be returned if the attribute isn't present,
- or if there is an error. (For a method with error
- checking, see QueryIntAttribute()).
- */
- int IntAttribute(const char* name, int defaultValue = 0) const;
- /// See IntAttribute()
- unsigned UnsignedAttribute(const char* name, unsigned defaultValue = 0) const;
- /// See IntAttribute()
- int64_t Int64Attribute(const char* name, int64_t defaultValue = 0) const;
- /// See IntAttribute()
- bool BoolAttribute(const char* name, bool defaultValue = false) const;
- /// See IntAttribute()
- double DoubleAttribute(const char* name, double defaultValue = 0) const;
- /// See IntAttribute()
- float FloatAttribute(const char* name, float defaultValue = 0) const;
-
- /** Given an attribute name, QueryIntAttribute() returns
- XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion
- can't be performed, or XML_NO_ATTRIBUTE if the attribute
- doesn't exist. If successful, the result of the conversion
- will be written to 'value'. If not successful, nothing will
- be written to 'value'. This allows you to provide default
- value:
-
- @verbatim
- int value = 10;
- QueryIntAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10
- @endverbatim
- */
- XMLError QueryIntAttribute( const char* name, int* value ) const {
- const XMLAttribute* a = FindAttribute( name );
- if ( !a ) {
- return XML_NO_ATTRIBUTE;
- }
- return a->QueryIntValue( value );
- }
-
- /// See QueryIntAttribute()
- XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const {
- const XMLAttribute* a = FindAttribute( name );
- if ( !a ) {
- return XML_NO_ATTRIBUTE;
- }
- return a->QueryUnsignedValue( value );
- }
-
- /// See QueryIntAttribute()
- XMLError QueryInt64Attribute(const char* name, int64_t* value) const {
- const XMLAttribute* a = FindAttribute(name);
- if (!a) {
- return XML_NO_ATTRIBUTE;
- }
- return a->QueryInt64Value(value);
- }
-
- /// See QueryIntAttribute()
- XMLError QueryBoolAttribute( const char* name, bool* value ) const {
- const XMLAttribute* a = FindAttribute( name );
- if ( !a ) {
- return XML_NO_ATTRIBUTE;
- }
- return a->QueryBoolValue( value );
- }
- /// See QueryIntAttribute()
- XMLError QueryDoubleAttribute( const char* name, double* value ) const {
- const XMLAttribute* a = FindAttribute( name );
- if ( !a ) {
- return XML_NO_ATTRIBUTE;
- }
- return a->QueryDoubleValue( value );
- }
- /// See QueryIntAttribute()
- XMLError QueryFloatAttribute( const char* name, float* value ) const {
- const XMLAttribute* a = FindAttribute( name );
- if ( !a ) {
- return XML_NO_ATTRIBUTE;
- }
- return a->QueryFloatValue( value );
- }
-
-
- /** Given an attribute name, QueryAttribute() returns
- XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion
- can't be performed, or XML_NO_ATTRIBUTE if the attribute
- doesn't exist. It is overloaded for the primitive types,
- and is a generally more convenient replacement of
- QueryIntAttribute() and related functions.
-
- If successful, the result of the conversion
- will be written to 'value'. If not successful, nothing will
- be written to 'value'. This allows you to provide default
- value:
-
- @verbatim
- int value = 10;
- QueryAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10
- @endverbatim
- */
- int QueryAttribute( const char* name, int* value ) const {
- return QueryIntAttribute( name, value );
- }
-
- int QueryAttribute( const char* name, unsigned int* value ) const {
- return QueryUnsignedAttribute( name, value );
- }
-
- int QueryAttribute(const char* name, int64_t* value) const {
- return QueryInt64Attribute(name, value);
- }
-
- int QueryAttribute( const char* name, bool* value ) const {
- return QueryBoolAttribute( name, value );
- }
-
- int QueryAttribute( const char* name, double* value ) const {
- return QueryDoubleAttribute( name, value );
- }
-
- int QueryAttribute( const char* name, float* value ) const {
- return QueryFloatAttribute( name, value );
- }
-
- /// Sets the named attribute to value.
- void SetAttribute( const char* name, const char* value ) {
- XMLAttribute* a = FindOrCreateAttribute( name );
- a->SetAttribute( value );
- }
- /// Sets the named attribute to value.
- void SetAttribute( const char* name, int value ) {
- XMLAttribute* a = FindOrCreateAttribute( name );
- a->SetAttribute( value );
- }
- /// Sets the named attribute to value.
- void SetAttribute( const char* name, unsigned value ) {
- XMLAttribute* a = FindOrCreateAttribute( name );
- a->SetAttribute( value );
- }
-
- /// Sets the named attribute to value.
- void SetAttribute(const char* name, int64_t value) {
- XMLAttribute* a = FindOrCreateAttribute(name);
- a->SetAttribute(value);
- }
-
- /// Sets the named attribute to value.
- void SetAttribute( const char* name, bool value ) {
- XMLAttribute* a = FindOrCreateAttribute( name );
- a->SetAttribute( value );
- }
- /// Sets the named attribute to value.
- void SetAttribute( const char* name, double value ) {
- XMLAttribute* a = FindOrCreateAttribute( name );
- a->SetAttribute( value );
- }
- /// Sets the named attribute to value.
- void SetAttribute( const char* name, float value ) {
- XMLAttribute* a = FindOrCreateAttribute( name );
- a->SetAttribute( value );
- }
-
- /**
- Delete an attribute.
- */
- void DeleteAttribute( const char* name );
-
- /// Return the first attribute in the list.
- const XMLAttribute* FirstAttribute() const {
- return _rootAttribute;
- }
- /// Query a specific attribute in the list.
- const XMLAttribute* FindAttribute( const char* name ) const;
-
- /** Convenience function for easy access to the text inside an element. Although easy
- and concise, GetText() is limited compared to getting the XMLText child
- and accessing it directly.
-
- If the first child of 'this' is a XMLText, the GetText()
- returns the character string of the Text node, else null is returned.
-
- This is a convenient method for getting the text of simple contained text:
- @verbatim
- <foo>This is text</foo>
- const char* str = fooElement->GetText();
- @endverbatim
-
- 'str' will be a pointer to "This is text".
-
- Note that this function can be misleading. If the element foo was created from
- this XML:
- @verbatim
- <foo><b>This is text</b></foo>
- @endverbatim
-
- then the value of str would be null. The first child node isn't a text node, it is
- another element. From this XML:
- @verbatim
- <foo>This is <b>text</b></foo>
- @endverbatim
- GetText() will return "This is ".
- */
- const char* GetText() const;
-
- /** Convenience function for easy access to the text inside an element. Although easy
- and concise, SetText() is limited compared to creating an XMLText child
- and mutating it directly.
-
- If the first child of 'this' is a XMLText, SetText() sets its value to
- the given string, otherwise it will create a first child that is an XMLText.
-
- This is a convenient method for setting the text of simple contained text:
- @verbatim
- <foo>This is text</foo>
- fooElement->SetText( "Hullaballoo!" );
- <foo>Hullaballoo!</foo>
- @endverbatim
-
- Note that this function can be misleading. If the element foo was created from
- this XML:
- @verbatim
- <foo><b>This is text</b></foo>
- @endverbatim
-
- then it will not change "This is text", but rather prefix it with a text element:
- @verbatim
- <foo>Hullaballoo!<b>This is text</b></foo>
- @endverbatim
-
- For this XML:
- @verbatim
- <foo />
- @endverbatim
- SetText() will generate
- @verbatim
- <foo>Hullaballoo!</foo>
- @endverbatim
- */
- void SetText( const char* inText );
- /// Convenience method for setting text inside an element. See SetText() for important limitations.
- void SetText( int value );
- /// Convenience method for setting text inside an element. See SetText() for important limitations.
+ no way processes or interprets user data.
+ It is initially 0.
+ */
+ void SetUserData(void* userData) { _userData = userData; }
+
+ /**
+ Get user data set into the XMLNode. TinyXML-2 in
+ no way processes or interprets user data.
+ It is initially 0.
+ */
+ void* GetUserData() const { return _userData; }
+
+protected:
+ XMLNode( XMLDocument* );
+ virtual ~XMLNode();
+
+ virtual char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr);
+
+ XMLDocument* _document;
+ XMLNode* _parent;
+ mutable StrPair _value;
+ int _parseLineNum;
+
+ XMLNode* _firstChild;
+ XMLNode* _lastChild;
+
+ XMLNode* _prev;
+ XMLNode* _next;
+
+ void* _userData;
+
+private:
+ MemPool* _memPool;
+ void Unlink( XMLNode* child );
+ static void DeleteNode( XMLNode* node );
+ void InsertChildPreamble( XMLNode* insertThis ) const;
+ const XMLElement* ToElementWithName( const char* name ) const;
+
+ XMLNode( const XMLNode& ); // not supported
+ XMLNode& operator=( const XMLNode& ); // not supported
+};
+
+
+/** XML text.
+
+ Note that a text node can have child element nodes, for example:
+ @verbatim
+ <root>This is <b>bold</b></root>
+ @endverbatim
+
+ A text node can have 2 ways to output the next. "normal" output
+ and CDATA. It will default to the mode it was parsed from the XML file and
+ you generally want to leave it alone, but you can change the output mode with
+ SetCData() and query it with CData().
+*/
+class TINYXML2_LIB XMLText : public XMLNode
+{
+ friend class XMLDocument;
+public:
+ virtual bool Accept( XMLVisitor* visitor ) const;
+
+ virtual XMLText* ToText() {
+ return this;
+ }
+ virtual const XMLText* ToText() const {
+ return this;
+ }
+
+ /// Declare whether this should be CDATA or standard text.
+ void SetCData( bool isCData ) {
+ _isCData = isCData;
+ }
+ /// Returns true if this is a CDATA text element.
+ bool CData() const {
+ return _isCData;
+ }
+
+ virtual XMLNode* ShallowClone( XMLDocument* document ) const;
+ virtual bool ShallowEqual( const XMLNode* compare ) const;
+
+protected:
+ XMLText( XMLDocument* doc ) : XMLNode( doc ), _isCData( false ) {}
+ virtual ~XMLText() {}
+
+ char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );
+
+private:
+ bool _isCData;
+
+ XMLText( const XMLText& ); // not supported
+ XMLText& operator=( const XMLText& ); // not supported
+};
+
+
+/** An XML Comment. */
+class TINYXML2_LIB XMLComment : public XMLNode
+{
+ friend class XMLDocument;
+public:
+ virtual XMLComment* ToComment() {
+ return this;
+ }
+ virtual const XMLComment* ToComment() const {
+ return this;
+ }
+
+ virtual bool Accept( XMLVisitor* visitor ) const;
+
+ virtual XMLNode* ShallowClone( XMLDocument* document ) const;
+ virtual bool ShallowEqual( const XMLNode* compare ) const;
+
+protected:
+ XMLComment( XMLDocument* doc );
+ virtual ~XMLComment();
+
+ char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr);
+
+private:
+ XMLComment( const XMLComment& ); // not supported
+ XMLComment& operator=( const XMLComment& ); // not supported
+};
+
+
+/** In correct XML the declaration is the first entry in the file.
+ @verbatim
+ <?xml version="1.0" standalone="yes"?>
+ @endverbatim
+
+ TinyXML-2 will happily read or write files without a declaration,
+ however.
+
+ The text of the declaration isn't interpreted. It is parsed
+ and written as a string.
+*/
+class TINYXML2_LIB XMLDeclaration : public XMLNode
+{
+ friend class XMLDocument;
+public:
+ virtual XMLDeclaration* ToDeclaration() {
+ return this;
+ }
+ virtual const XMLDeclaration* ToDeclaration() const {
+ return this;
+ }
+
+ virtual bool Accept( XMLVisitor* visitor ) const;
+
+ virtual XMLNode* ShallowClone( XMLDocument* document ) const;
+ virtual bool ShallowEqual( const XMLNode* compare ) const;
+
+protected:
+ XMLDeclaration( XMLDocument* doc );
+ virtual ~XMLDeclaration();
+
+ char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );
+
+private:
+ XMLDeclaration( const XMLDeclaration& ); // not supported
+ XMLDeclaration& operator=( const XMLDeclaration& ); // not supported
+};
+
+
+/** Any tag that TinyXML-2 doesn't recognize is saved as an
+ unknown. It is a tag of text, but should not be modified.
+ It will be written back to the XML, unchanged, when the file
+ is saved.
+
+ DTD tags get thrown into XMLUnknowns.
+*/
+class TINYXML2_LIB XMLUnknown : public XMLNode
+{
+ friend class XMLDocument;
+public:
+ virtual XMLUnknown* ToUnknown() {
+ return this;
+ }
+ virtual const XMLUnknown* ToUnknown() const {
+ return this;
+ }
+
+ virtual bool Accept( XMLVisitor* visitor ) const;
+
+ virtual XMLNode* ShallowClone( XMLDocument* document ) const;
+ virtual bool ShallowEqual( const XMLNode* compare ) const;
+
+protected:
+ XMLUnknown( XMLDocument* doc );
+ virtual ~XMLUnknown();
+
+ char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );
+
+private:
+ XMLUnknown( const XMLUnknown& ); // not supported
+ XMLUnknown& operator=( const XMLUnknown& ); // not supported
+};
+
+
+
+/** An attribute is a name-value pair. Elements have an arbitrary
+ number of attributes, each with a unique name.
+
+ @note The attributes are not XMLNodes. You may only query the
+ Next() attribute in a list.
+*/
+class TINYXML2_LIB XMLAttribute
+{
+ friend class XMLElement;
+public:
+ /// The name of the attribute.
+ const char* Name() const;
+
+ /// The value of the attribute.
+ const char* Value() const;
+
+ /// Gets the line number the attribute is in, if the document was parsed from a file.
+ int GetLineNum() const { return _parseLineNum; }
+
+ /// The next attribute in the list.
+ const XMLAttribute* Next() const {
+ return _next;
+ }
+
+ /** IntValue interprets the attribute as an integer, and returns the value.
+ If the value isn't an integer, 0 will be returned. There is no error checking;
+ use QueryIntValue() if you need error checking.
+ */
+ int IntValue() const {
+ int i = 0;
+ QueryIntValue(&i);
+ return i;
+ }
+
+ int64_t Int64Value() const {
+ int64_t i = 0;
+ QueryInt64Value(&i);
+ return i;
+ }
+
+ /// Query as an unsigned integer. See IntValue()
+ unsigned UnsignedValue() const {
+ unsigned i=0;
+ QueryUnsignedValue( &i );
+ return i;
+ }
+ /// Query as a boolean. See IntValue()
+ bool BoolValue() const {
+ bool b=false;
+ QueryBoolValue( &b );
+ return b;
+ }
+ /// Query as a double. See IntValue()
+ double DoubleValue() const {
+ double d=0;
+ QueryDoubleValue( &d );
+ return d;
+ }
+ /// Query as a float. See IntValue()
+ float FloatValue() const {
+ float f=0;
+ QueryFloatValue( &f );
+ return f;
+ }
+
+ /** QueryIntValue interprets the attribute as an integer, and returns the value
+ in the provided parameter. The function will return XML_SUCCESS on success,
+ and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.
+ */
+ XMLError QueryIntValue( int* value ) const;
+ /// See QueryIntValue
+ XMLError QueryUnsignedValue( unsigned int* value ) const;
+ /// See QueryIntValue
+ XMLError QueryInt64Value(int64_t* value) const;
+ /// See QueryIntValue
+ XMLError QueryBoolValue( bool* value ) const;
+ /// See QueryIntValue
+ XMLError QueryDoubleValue( double* value ) const;
+ /// See QueryIntValue
+ XMLError QueryFloatValue( float* value ) const;
+
+ /// Set the attribute to a string value.
+ void SetAttribute( const char* value );
+ /// Set the attribute to value.
+ void SetAttribute( int value );
+ /// Set the attribute to value.
+ void SetAttribute( unsigned value );
+ /// Set the attribute to value.
+ void SetAttribute(int64_t value);
+ /// Set the attribute to value.
+ void SetAttribute( bool value );
+ /// Set the attribute to value.
+ void SetAttribute( double value );
+ /// Set the attribute to value.
+ void SetAttribute( float value );
+
+private:
+ enum { BUF_SIZE = 200 };
+
+ XMLAttribute() : _name(), _value(),_parseLineNum( 0 ), _next( 0 ), _memPool( 0 ) {}
+ virtual ~XMLAttribute() {}
+
+ XMLAttribute( const XMLAttribute& ); // not supported
+ void operator=( const XMLAttribute& ); // not supported
+ void SetName( const char* name );
+
+ char* ParseDeep( char* p, bool processEntities, int* curLineNumPtr );
+
+ mutable StrPair _name;
+ mutable StrPair _value;
+ int _parseLineNum;
+ XMLAttribute* _next;
+ MemPool* _memPool;
+};
+
+
+/** The element is a container class. It has a value, the element name,
+ and can contain other elements, text, comments, and unknowns.
+ Elements also contain an arbitrary number of attributes.
+*/
+class TINYXML2_LIB XMLElement : public XMLNode
+{
+ friend class XMLDocument;
+public:
+ /// Get the name of an element (which is the Value() of the node.)
+ const char* Name() const {
+ return Value();
+ }
+ /// Set the name of the element.
+ void SetName( const char* str, bool staticMem=false ) {
+ SetValue( str, staticMem );
+ }
+
+ virtual XMLElement* ToElement() {
+ return this;
+ }
+ virtual const XMLElement* ToElement() const {
+ return this;
+ }
+ virtual bool Accept( XMLVisitor* visitor ) const;
+
+ /** Given an attribute name, Attribute() returns the value
+ for the attribute of that name, or null if none
+ exists. For example:
+
+ @verbatim
+ const char* value = ele->Attribute( "foo" );
+ @endverbatim
+
+ The 'value' parameter is normally null. However, if specified,
+ the attribute will only be returned if the 'name' and 'value'
+ match. This allow you to write code:
+
+ @verbatim
+ if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar();
+ @endverbatim
+
+ rather than:
+ @verbatim
+ if ( ele->Attribute( "foo" ) ) {
+ if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar();
+ }
+ @endverbatim
+ */
+ const char* Attribute( const char* name, const char* value=0 ) const;
+
+ /** Given an attribute name, IntAttribute() returns the value
+ of the attribute interpreted as an integer. The default
+ value will be returned if the attribute isn't present,
+ or if there is an error. (For a method with error
+ checking, see QueryIntAttribute()).
+ */
+ int IntAttribute(const char* name, int defaultValue = 0) const;
+ /// See IntAttribute()
+ unsigned UnsignedAttribute(const char* name, unsigned defaultValue = 0) const;
+ /// See IntAttribute()
+ int64_t Int64Attribute(const char* name, int64_t defaultValue = 0) const;
+ /// See IntAttribute()
+ bool BoolAttribute(const char* name, bool defaultValue = false) const;
+ /// See IntAttribute()
+ double DoubleAttribute(const char* name, double defaultValue = 0) const;
+ /// See IntAttribute()
+ float FloatAttribute(const char* name, float defaultValue = 0) const;
+
+ /** Given an attribute name, QueryIntAttribute() returns
+ XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion
+ can't be performed, or XML_NO_ATTRIBUTE if the attribute
+ doesn't exist. If successful, the result of the conversion
+ will be written to 'value'. If not successful, nothing will
+ be written to 'value'. This allows you to provide default
+ value:
+
+ @verbatim
+ int value = 10;
+ QueryIntAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10
+ @endverbatim
+ */
+ XMLError QueryIntAttribute( const char* name, int* value ) const {
+ const XMLAttribute* a = FindAttribute( name );
+ if ( !a ) {
+ return XML_NO_ATTRIBUTE;
+ }
+ return a->QueryIntValue( value );
+ }
+
+ /// See QueryIntAttribute()
+ XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const {
+ const XMLAttribute* a = FindAttribute( name );
+ if ( !a ) {
+ return XML_NO_ATTRIBUTE;
+ }
+ return a->QueryUnsignedValue( value );
+ }
+
+ /// See QueryIntAttribute()
+ XMLError QueryInt64Attribute(const char* name, int64_t* value) const {
+ const XMLAttribute* a = FindAttribute(name);
+ if (!a) {
+ return XML_NO_ATTRIBUTE;
+ }
+ return a->QueryInt64Value(value);
+ }
+
+ /// See QueryIntAttribute()
+ XMLError QueryBoolAttribute( const char* name, bool* value ) const {
+ const XMLAttribute* a = FindAttribute( name );
+ if ( !a ) {
+ return XML_NO_ATTRIBUTE;
+ }
+ return a->QueryBoolValue( value );
+ }
+ /// See QueryIntAttribute()
+ XMLError QueryDoubleAttribute( const char* name, double* value ) const {
+ const XMLAttribute* a = FindAttribute( name );
+ if ( !a ) {
+ return XML_NO_ATTRIBUTE;
+ }
+ return a->QueryDoubleValue( value );
+ }
+ /// See QueryIntAttribute()
+ XMLError QueryFloatAttribute( const char* name, float* value ) const {
+ const XMLAttribute* a = FindAttribute( name );
+ if ( !a ) {
+ return XML_NO_ATTRIBUTE;
+ }
+ return a->QueryFloatValue( value );
+ }
+
+
+ /** Given an attribute name, QueryAttribute() returns
+ XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion
+ can't be performed, or XML_NO_ATTRIBUTE if the attribute
+ doesn't exist. It is overloaded for the primitive types,
+ and is a generally more convenient replacement of
+ QueryIntAttribute() and related functions.
+
+ If successful, the result of the conversion
+ will be written to 'value'. If not successful, nothing will
+ be written to 'value'. This allows you to provide default
+ value:
+
+ @verbatim
+ int value = 10;
+ QueryAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10
+ @endverbatim
+ */
+ int QueryAttribute( const char* name, int* value ) const {
+ return QueryIntAttribute( name, value );
+ }
+
+ int QueryAttribute( const char* name, unsigned int* value ) const {
+ return QueryUnsignedAttribute( name, value );
+ }
+
+ int QueryAttribute(const char* name, int64_t* value) const {
+ return QueryInt64Attribute(name, value);
+ }
+
+ int QueryAttribute( const char* name, bool* value ) const {
+ return QueryBoolAttribute( name, value );
+ }
+
+ int QueryAttribute( const char* name, double* value ) const {
+ return QueryDoubleAttribute( name, value );
+ }
+
+ int QueryAttribute( const char* name, float* value ) const {
+ return QueryFloatAttribute( name, value );
+ }
+
+ /// Sets the named attribute to value.
+ void SetAttribute( const char* name, const char* value ) {
+ XMLAttribute* a = FindOrCreateAttribute( name );
+ a->SetAttribute( value );
+ }
+ /// Sets the named attribute to value.
+ void SetAttribute( const char* name, int value ) {
+ XMLAttribute* a = FindOrCreateAttribute( name );
+ a->SetAttribute( value );
+ }
+ /// Sets the named attribute to value.
+ void SetAttribute( const char* name, unsigned value ) {
+ XMLAttribute* a = FindOrCreateAttribute( name );
+ a->SetAttribute( value );
+ }
+
+ /// Sets the named attribute to value.
+ void SetAttribute(const char* name, int64_t value) {
+ XMLAttribute* a = FindOrCreateAttribute(name);
+ a->SetAttribute(value);
+ }
+
+ /// Sets the named attribute to value.
+ void SetAttribute( const char* name, bool value ) {
+ XMLAttribute* a = FindOrCreateAttribute( name );
+ a->SetAttribute( value );
+ }
+ /// Sets the named attribute to value.
+ void SetAttribute( const char* name, double value ) {
+ XMLAttribute* a = FindOrCreateAttribute( name );
+ a->SetAttribute( value );
+ }
+ /// Sets the named attribute to value.
+ void SetAttribute( const char* name, float value ) {
+ XMLAttribute* a = FindOrCreateAttribute( name );
+ a->SetAttribute( value );
+ }
+
+ /**
+ Delete an attribute.
+ */
+ void DeleteAttribute( const char* name );
+
+ /// Return the first attribute in the list.
+ const XMLAttribute* FirstAttribute() const {
+ return _rootAttribute;
+ }
+ /// Query a specific attribute in the list.
+ const XMLAttribute* FindAttribute( const char* name ) const;
+
+ /** Convenience function for easy access to the text inside an element. Although easy
+ and concise, GetText() is limited compared to getting the XMLText child
+ and accessing it directly.
+
+ If the first child of 'this' is a XMLText, the GetText()
+ returns the character string of the Text node, else null is returned.
+
+ This is a convenient method for getting the text of simple contained text:
+ @verbatim
+ <foo>This is text</foo>
+ const char* str = fooElement->GetText();
+ @endverbatim
+
+ 'str' will be a pointer to "This is text".
+
+ Note that this function can be misleading. If the element foo was created from
+ this XML:
+ @verbatim
+ <foo><b>This is text</b></foo>
+ @endverbatim
+
+ then the value of str would be null. The first child node isn't a text node, it is
+ another element. From this XML:
+ @verbatim
+ <foo>This is <b>text</b></foo>
+ @endverbatim
+ GetText() will return "This is ".
+ */
+ const char* GetText() const;
+
+ /** Convenience function for easy access to the text inside an element. Although easy
+ and concise, SetText() is limited compared to creating an XMLText child
+ and mutating it directly.
+
+ If the first child of 'this' is a XMLText, SetText() sets its value to
+ the given string, otherwise it will create a first child that is an XMLText.
+
+ This is a convenient method for setting the text of simple contained text:
+ @verbatim
+ <foo>This is text</foo>
+ fooElement->SetText( "Hullaballoo!" );
+ <foo>Hullaballoo!</foo>
+ @endverbatim
+
+ Note that this function can be misleading. If the element foo was created from
+ this XML:
+ @verbatim
+ <foo><b>This is text</b></foo>
+ @endverbatim
+
+ then it will not change "This is text", but rather prefix it with a text element:
+ @verbatim
+ <foo>Hullaballoo!<b>This is text</b></foo>
+ @endverbatim
+
+ For this XML:
+ @verbatim
+ <foo />
+ @endverbatim
+ SetText() will generate
+ @verbatim
+ <foo>Hullaballoo!</foo>
+ @endverbatim
+ */
+ void SetText( const char* inText );
+ /// Convenience method for setting text inside an element. See SetText() for important limitations.
+ void SetText( int value );
+ /// Convenience method for setting text inside an element. See SetText() for important limitations.
void SetText( unsigned value );
- /// Convenience method for setting text inside an element. See SetText() for important limitations.
- void SetText(int64_t value);
- /// Convenience method for setting text inside an element. See SetText() for important limitations.
+ /// Convenience method for setting text inside an element. See SetText() for important limitations.
+ void SetText(int64_t value);
+ /// Convenience method for setting text inside an element. See SetText() for important limitations.
void SetText( bool value );
- /// Convenience method for setting text inside an element. See SetText() for important limitations.
+ /// Convenience method for setting text inside an element. See SetText() for important limitations.
void SetText( double value );
- /// Convenience method for setting text inside an element. See SetText() for important limitations.
+ /// Convenience method for setting text inside an element. See SetText() for important limitations.
void SetText( float value );
-
- /**
- Convenience method to query the value of a child text node. This is probably best
- shown by example. Given you have a document is this form:
- @verbatim
- <point>
- <x>1</x>
- <y>1.4</y>
- </point>
- @endverbatim
-
- The QueryIntText() and similar functions provide a safe and easier way to get to the
- "value" of x and y.
-
- @verbatim
- int x = 0;
- float y = 0; // types of x and y are contrived for example
- const XMLElement* xElement = pointElement->FirstChildElement( "x" );
- const XMLElement* yElement = pointElement->FirstChildElement( "y" );
- xElement->QueryIntText( &x );
- yElement->QueryFloatText( &y );
- @endverbatim
-
- @returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted
- to the requested type, and XML_NO_TEXT_NODE if there is no child text to query.
-
- */
- XMLError QueryIntText( int* ival ) const;
- /// See QueryIntText()
- XMLError QueryUnsignedText( unsigned* uval ) const;
- /// See QueryIntText()
- XMLError QueryInt64Text(int64_t* uval) const;
- /// See QueryIntText()
- XMLError QueryBoolText( bool* bval ) const;
- /// See QueryIntText()
- XMLError QueryDoubleText( double* dval ) const;
- /// See QueryIntText()
- XMLError QueryFloatText( float* fval ) const;
-
- int IntText(int defaultValue = 0) const;
-
- /// See QueryIntText()
- unsigned UnsignedText(unsigned defaultValue = 0) const;
- /// See QueryIntText()
- int64_t Int64Text(int64_t defaultValue = 0) const;
- /// See QueryIntText()
- bool BoolText(bool defaultValue = false) const;
- /// See QueryIntText()
- double DoubleText(double defaultValue = 0) const;
- /// See QueryIntText()
- float FloatText(float defaultValue = 0) const;
-
- // internal:
- enum ElementClosingType {
- OPEN, // <foo>
- CLOSED, // <foo/>
- CLOSING // </foo>
- };
- ElementClosingType ClosingType() const {
- return _closingType;
- }
- virtual XMLNode* ShallowClone( XMLDocument* document ) const;
- virtual bool ShallowEqual( const XMLNode* compare ) const;
-
-protected:
- char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );
-
-private:
- XMLElement( XMLDocument* doc );
- virtual ~XMLElement();
- XMLElement( const XMLElement& ); // not supported
- void operator=( const XMLElement& ); // not supported
-
- XMLAttribute* FindAttribute( const char* name ) {
- return const_cast<XMLAttribute*>(const_cast<const XMLElement*>(this)->FindAttribute( name ));
- }
- XMLAttribute* FindOrCreateAttribute( const char* name );
- //void LinkAttribute( XMLAttribute* attrib );
- char* ParseAttributes( char* p, int* curLineNumPtr );
- static void DeleteAttribute( XMLAttribute* attribute );
- XMLAttribute* CreateAttribute();
-
- enum { BUF_SIZE = 200 };
- ElementClosingType _closingType;
- // The attribute list is ordered; there is no 'lastAttribute'
- // because the list needs to be scanned for dupes before adding
- // a new attribute.
- XMLAttribute* _rootAttribute;
-};
-
-
-enum Whitespace {
- PRESERVE_WHITESPACE,
- COLLAPSE_WHITESPACE
-};
-
-
-/** A Document binds together all the functionality.
- It can be saved, loaded, and printed to the screen.
- All Nodes are connected and allocated to a Document.
- If the Document is deleted, all its Nodes are also deleted.
-*/
-class TINYXML2_LIB XMLDocument : public XMLNode
-{
- friend class XMLElement;
- // Gives access to SetError, but over-access for everything else.
- // Wishing C++ had "internal" scope.
+
+ /**
+ Convenience method to query the value of a child text node. This is probably best
+ shown by example. Given you have a document is this form:
+ @verbatim
+ <point>
+ <x>1</x>
+ <y>1.4</y>
+ </point>
+ @endverbatim
+
+ The QueryIntText() and similar functions provide a safe and easier way to get to the
+ "value" of x and y.
+
+ @verbatim
+ int x = 0;
+ float y = 0; // types of x and y are contrived for example
+ const XMLElement* xElement = pointElement->FirstChildElement( "x" );
+ const XMLElement* yElement = pointElement->FirstChildElement( "y" );
+ xElement->QueryIntText( &x );
+ yElement->QueryFloatText( &y );
+ @endverbatim
+
+ @returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted
+ to the requested type, and XML_NO_TEXT_NODE if there is no child text to query.
+
+ */
+ XMLError QueryIntText( int* ival ) const;
+ /// See QueryIntText()
+ XMLError QueryUnsignedText( unsigned* uval ) const;
+ /// See QueryIntText()
+ XMLError QueryInt64Text(int64_t* uval) const;
+ /// See QueryIntText()
+ XMLError QueryBoolText( bool* bval ) const;
+ /// See QueryIntText()
+ XMLError QueryDoubleText( double* dval ) const;
+ /// See QueryIntText()
+ XMLError QueryFloatText( float* fval ) const;
+
+ int IntText(int defaultValue = 0) const;
+
+ /// See QueryIntText()
+ unsigned UnsignedText(unsigned defaultValue = 0) const;
+ /// See QueryIntText()
+ int64_t Int64Text(int64_t defaultValue = 0) const;
+ /// See QueryIntText()
+ bool BoolText(bool defaultValue = false) const;
+ /// See QueryIntText()
+ double DoubleText(double defaultValue = 0) const;
+ /// See QueryIntText()
+ float FloatText(float defaultValue = 0) const;
+
+ // internal:
+ enum ElementClosingType {
+ OPEN, // <foo>
+ CLOSED, // <foo/>
+ CLOSING // </foo>
+ };
+ ElementClosingType ClosingType() const {
+ return _closingType;
+ }
+ virtual XMLNode* ShallowClone( XMLDocument* document ) const;
+ virtual bool ShallowEqual( const XMLNode* compare ) const;
+
+protected:
+ char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );
+
+private:
+ XMLElement( XMLDocument* doc );
+ virtual ~XMLElement();
+ XMLElement( const XMLElement& ); // not supported
+ void operator=( const XMLElement& ); // not supported
+
+ XMLAttribute* FindAttribute( const char* name ) {
+ return const_cast<XMLAttribute*>(const_cast<const XMLElement*>(this)->FindAttribute( name ));
+ }
+ XMLAttribute* FindOrCreateAttribute( const char* name );
+ //void LinkAttribute( XMLAttribute* attrib );
+ char* ParseAttributes( char* p, int* curLineNumPtr );
+ static void DeleteAttribute( XMLAttribute* attribute );
+ XMLAttribute* CreateAttribute();
+
+ enum { BUF_SIZE = 200 };
+ ElementClosingType _closingType;
+ // The attribute list is ordered; there is no 'lastAttribute'
+ // because the list needs to be scanned for dupes before adding
+ // a new attribute.
+ XMLAttribute* _rootAttribute;
+};
+
+
+enum Whitespace {
+ PRESERVE_WHITESPACE,
+ COLLAPSE_WHITESPACE
+};
+
+
+/** A Document binds together all the functionality.
+ It can be saved, loaded, and printed to the screen.
+ All Nodes are connected and allocated to a Document.
+ If the Document is deleted, all its Nodes are also deleted.
+*/
+class TINYXML2_LIB XMLDocument : public XMLNode
+{
+ friend class XMLElement;
+ // Gives access to SetError, but over-access for everything else.
+ // Wishing C++ had "internal" scope.
friend class XMLNode;
- friend class XMLText;
- friend class XMLComment;
- friend class XMLDeclaration;
- friend class XMLUnknown;
-public:
- /// constructor
- XMLDocument( bool processEntities = true, Whitespace whitespaceMode = PRESERVE_WHITESPACE );
- ~XMLDocument();
-
- virtual XMLDocument* ToDocument() {
- TIXMLASSERT( this == _document );
- return this;
- }
- virtual const XMLDocument* ToDocument() const {
- TIXMLASSERT( this == _document );
- return this;
- }
-
- /**
- Parse an XML file from a character string.
- Returns XML_SUCCESS (0) on success, or
- an errorID.
-
- You may optionally pass in the 'nBytes', which is
- the number of bytes which will be parsed. If not
- specified, TinyXML-2 will assume 'xml' points to a
- null terminated string.
- */
- XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) );
-
- /**
- Load an XML file from disk.
- Returns XML_SUCCESS (0) on success, or
- an errorID.
- */
- XMLError LoadFile( const char* filename );
-
- /**
- Load an XML file from disk. You are responsible
+ friend class XMLText;
+ friend class XMLComment;
+ friend class XMLDeclaration;
+ friend class XMLUnknown;
+public:
+ /// constructor
+ XMLDocument( bool processEntities = true, Whitespace whitespaceMode = PRESERVE_WHITESPACE );
+ ~XMLDocument();
+
+ virtual XMLDocument* ToDocument() {
+ TIXMLASSERT( this == _document );
+ return this;
+ }
+ virtual const XMLDocument* ToDocument() const {
+ TIXMLASSERT( this == _document );
+ return this;
+ }
+
+ /**
+ Parse an XML file from a character string.
+ Returns XML_SUCCESS (0) on success, or
+ an errorID.
+
+ You may optionally pass in the 'nBytes', which is
+ the number of bytes which will be parsed. If not
+ specified, TinyXML-2 will assume 'xml' points to a
+ null terminated string.
+ */
+ XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) );
+
+ /**
+ Load an XML file from disk.
+ Returns XML_SUCCESS (0) on success, or
+ an errorID.
+ */
+ XMLError LoadFile( const char* filename );
+
+ /**
+ Load an XML file from disk. You are responsible
+ for providing and closing the FILE*.
+
+ NOTE: The file should be opened as binary ("rb")
+ not text in order for TinyXML-2 to correctly
+ do newline normalization.
+
+ Returns XML_SUCCESS (0) on success, or
+ an errorID.
+ */
+ XMLError LoadFile( FILE* );
+
+ /**
+ Save the XML file to disk.
+ Returns XML_SUCCESS (0) on success, or
+ an errorID.
+ */
+ XMLError SaveFile( const char* filename, bool compact = false );
+
+ /**
+ Save the XML file to disk. You are responsible
for providing and closing the FILE*.
- NOTE: The file should be opened as binary ("rb")
- not text in order for TinyXML-2 to correctly
- do newline normalization.
-
- Returns XML_SUCCESS (0) on success, or
- an errorID.
- */
- XMLError LoadFile( FILE* );
-
- /**
- Save the XML file to disk.
- Returns XML_SUCCESS (0) on success, or
- an errorID.
- */
- XMLError SaveFile( const char* filename, bool compact = false );
-
- /**
- Save the XML file to disk. You are responsible
- for providing and closing the FILE*.
-
- Returns XML_SUCCESS (0) on success, or
- an errorID.
- */
- XMLError SaveFile( FILE* fp, bool compact = false );
-
- bool ProcessEntities() const {
- return _processEntities;
- }
- Whitespace WhitespaceMode() const {
- return _whitespaceMode;
- }
-
- /**
- Returns true if this document has a leading Byte Order Mark of UTF8.
- */
- bool HasBOM() const {
- return _writeBOM;
- }
- /** Sets whether to write the BOM when writing the file.
- */
- void SetBOM( bool useBOM ) {
- _writeBOM = useBOM;
- }
-
- /** Return the root element of DOM. Equivalent to FirstChildElement().
- To get the first node, use FirstChild().
- */
- XMLElement* RootElement() {
- return FirstChildElement();
- }
- const XMLElement* RootElement() const {
- return FirstChildElement();
- }
-
- /** Print the Document. If the Printer is not provided, it will
- print to stdout. If you provide Printer, this can print to a file:
- @verbatim
- XMLPrinter printer( fp );
- doc.Print( &printer );
- @endverbatim
-
- Or you can use a printer to print to memory:
- @verbatim
- XMLPrinter printer;
- doc.Print( &printer );
- // printer.CStr() has a const char* to the XML
- @endverbatim
- */
- void Print( XMLPrinter* streamer=0 ) const;
- virtual bool Accept( XMLVisitor* visitor ) const;
-
- /**
- Create a new Element associated with
- this Document. The memory for the Element
- is managed by the Document.
- */
- XMLElement* NewElement( const char* name );
- /**
- Create a new Comment associated with
- this Document. The memory for the Comment
- is managed by the Document.
- */
- XMLComment* NewComment( const char* comment );
- /**
- Create a new Text associated with
- this Document. The memory for the Text
- is managed by the Document.
- */
- XMLText* NewText( const char* text );
- /**
- Create a new Declaration associated with
- this Document. The memory for the object
- is managed by the Document.
-
- If the 'text' param is null, the standard
- declaration is used.:
- @verbatim
- <?xml version="1.0" encoding="UTF-8"?>
- @endverbatim
- */
- XMLDeclaration* NewDeclaration( const char* text=0 );
- /**
- Create a new Unknown associated with
- this Document. The memory for the object
- is managed by the Document.
- */
- XMLUnknown* NewUnknown( const char* text );
-
- /**
- Delete a node associated with this document.
- It will be unlinked from the DOM.
- */
- void DeleteNode( XMLNode* node );
-
- void ClearError() {
- SetError(XML_SUCCESS, 0, 0);
- }
-
- /// Return true if there was an error parsing the document.
- bool Error() const {
- return _errorID != XML_SUCCESS;
- }
- /// Return the errorID.
- XMLError ErrorID() const {
- return _errorID;
- }
- const char* ErrorName() const;
- static const char* ErrorIDToName(XMLError errorID);
-
+ Returns XML_SUCCESS (0) on success, or
+ an errorID.
+ */
+ XMLError SaveFile( FILE* fp, bool compact = false );
+
+ bool ProcessEntities() const {
+ return _processEntities;
+ }
+ Whitespace WhitespaceMode() const {
+ return _whitespaceMode;
+ }
+
+ /**
+ Returns true if this document has a leading Byte Order Mark of UTF8.
+ */
+ bool HasBOM() const {
+ return _writeBOM;
+ }
+ /** Sets whether to write the BOM when writing the file.
+ */
+ void SetBOM( bool useBOM ) {
+ _writeBOM = useBOM;
+ }
+
+ /** Return the root element of DOM. Equivalent to FirstChildElement().
+ To get the first node, use FirstChild().
+ */
+ XMLElement* RootElement() {
+ return FirstChildElement();
+ }
+ const XMLElement* RootElement() const {
+ return FirstChildElement();
+ }
+
+ /** Print the Document. If the Printer is not provided, it will
+ print to stdout. If you provide Printer, this can print to a file:
+ @verbatim
+ XMLPrinter printer( fp );
+ doc.Print( &printer );
+ @endverbatim
+
+ Or you can use a printer to print to memory:
+ @verbatim
+ XMLPrinter printer;
+ doc.Print( &printer );
+ // printer.CStr() has a const char* to the XML
+ @endverbatim
+ */
+ void Print( XMLPrinter* streamer=0 ) const;
+ virtual bool Accept( XMLVisitor* visitor ) const;
+
+ /**
+ Create a new Element associated with
+ this Document. The memory for the Element
+ is managed by the Document.
+ */
+ XMLElement* NewElement( const char* name );
+ /**
+ Create a new Comment associated with
+ this Document. The memory for the Comment
+ is managed by the Document.
+ */
+ XMLComment* NewComment( const char* comment );
+ /**
+ Create a new Text associated with
+ this Document. The memory for the Text
+ is managed by the Document.
+ */
+ XMLText* NewText( const char* text );
+ /**
+ Create a new Declaration associated with
+ this Document. The memory for the object
+ is managed by the Document.
+
+ If the 'text' param is null, the standard
+ declaration is used.:
+ @verbatim
+ <?xml version="1.0" encoding="UTF-8"?>
+ @endverbatim
+ */
+ XMLDeclaration* NewDeclaration( const char* text=0 );
+ /**
+ Create a new Unknown associated with
+ this Document. The memory for the object
+ is managed by the Document.
+ */
+ XMLUnknown* NewUnknown( const char* text );
+
+ /**
+ Delete a node associated with this document.
+ It will be unlinked from the DOM.
+ */
+ void DeleteNode( XMLNode* node );
+
+ void ClearError() {
+ SetError(XML_SUCCESS, 0, 0);
+ }
+
+ /// Return true if there was an error parsing the document.
+ bool Error() const {
+ return _errorID != XML_SUCCESS;
+ }
+ /// Return the errorID.
+ XMLError ErrorID() const {
+ return _errorID;
+ }
+ const char* ErrorName() const;
+ static const char* ErrorIDToName(XMLError errorID);
+
/** Returns a "long form" error description. A hopefully helpful
- diagnostic with location, line number, and/or additional info.
- */
- const char* ErrorStr() const;
-
- /// A (trivial) utility function that prints the ErrorStr() to stdout.
- void PrintError() const;
-
+ diagnostic with location, line number, and/or additional info.
+ */
+ const char* ErrorStr() const;
+
+ /// A (trivial) utility function that prints the ErrorStr() to stdout.
+ void PrintError() const;
+
/// Return the line where the error occurred, or zero if unknown.
- int ErrorLineNum() const
- {
- return _errorLineNum;
- }
-
- /// Clear the document, resetting it to the initial state.
- void Clear();
-
- /**
- Copies this document to a target document.
- The target will be completely cleared before the copy.
- If you want to copy a sub-tree, see XMLNode::DeepClone().
-
- NOTE: that the 'target' must be non-null.
- */
- void DeepCopy(XMLDocument* target) const;
-
- // internal
- char* Identify( char* p, XMLNode** node );
-
- // internal
- void MarkInUse(XMLNode*);
-
- virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const {
- return 0;
- }
- virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const {
- return false;
- }
-
-private:
- XMLDocument( const XMLDocument& ); // not supported
- void operator=( const XMLDocument& ); // not supported
-
- bool _writeBOM;
- bool _processEntities;
- XMLError _errorID;
- Whitespace _whitespaceMode;
- mutable StrPair _errorStr;
- int _errorLineNum;
- char* _charBuffer;
- int _parseCurLineNum;
- // Memory tracking does add some overhead.
- // However, the code assumes that you don't
- // have a bunch of unlinked nodes around.
- // Therefore it takes less memory to track
- // in the document vs. a linked list in the XMLNode,
- // and the performance is the same.
- DynArray<XMLNode*, 10> _unlinked;
-
- MemPoolT< sizeof(XMLElement) > _elementPool;
- MemPoolT< sizeof(XMLAttribute) > _attributePool;
- MemPoolT< sizeof(XMLText) > _textPool;
- MemPoolT< sizeof(XMLComment) > _commentPool;
-
- static const char* _errorNames[XML_ERROR_COUNT];
-
- void Parse();
-
- void SetError( XMLError error, int lineNum, const char* format, ... );
-
- template<class NodeType, int PoolElementSize>
- NodeType* CreateUnlinkedNode( MemPoolT<PoolElementSize>& pool );
-};
-
-template<class NodeType, int PoolElementSize>
-inline NodeType* XMLDocument::CreateUnlinkedNode( MemPoolT<PoolElementSize>& pool )
-{
- TIXMLASSERT( sizeof( NodeType ) == PoolElementSize );
- TIXMLASSERT( sizeof( NodeType ) == pool.ItemSize() );
- NodeType* returnNode = new (pool.Alloc()) NodeType( this );
- TIXMLASSERT( returnNode );
- returnNode->_memPool = &pool;
-
- _unlinked.Push(returnNode);
- return returnNode;
-}
-
-/**
- A XMLHandle is a class that wraps a node pointer with null checks; this is
- an incredibly useful thing. Note that XMLHandle is not part of the TinyXML-2
- DOM structure. It is a separate utility class.
-
- Take an example:
- @verbatim
- <Document>
- <Element attributeA = "valueA">
- <Child attributeB = "value1" />
- <Child attributeB = "value2" />
- </Element>
- </Document>
- @endverbatim
-
- Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very
- easy to write a *lot* of code that looks like:
-
- @verbatim
- XMLElement* root = document.FirstChildElement( "Document" );
- if ( root )
- {
- XMLElement* element = root->FirstChildElement( "Element" );
- if ( element )
- {
- XMLElement* child = element->FirstChildElement( "Child" );
- if ( child )
- {
- XMLElement* child2 = child->NextSiblingElement( "Child" );
- if ( child2 )
- {
- // Finally do something useful.
- @endverbatim
-
- And that doesn't even cover "else" cases. XMLHandle addresses the verbosity
- of such code. A XMLHandle checks for null pointers so it is perfectly safe
- and correct to use:
-
- @verbatim
- XMLHandle docHandle( &document );
- XMLElement* child2 = docHandle.FirstChildElement( "Document" ).FirstChildElement( "Element" ).FirstChildElement().NextSiblingElement();
- if ( child2 )
- {
- // do something useful
- @endverbatim
-
- Which is MUCH more concise and useful.
-
- It is also safe to copy handles - internally they are nothing more than node pointers.
- @verbatim
- XMLHandle handleCopy = handle;
- @endverbatim
-
- See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects.
-*/
-class TINYXML2_LIB XMLHandle
-{
-public:
- /// Create a handle from any node (at any depth of the tree.) This can be a null pointer.
- XMLHandle( XMLNode* node ) : _node( node ) {
- }
- /// Create a handle from a node.
- XMLHandle( XMLNode& node ) : _node( &node ) {
- }
- /// Copy constructor
- XMLHandle( const XMLHandle& ref ) : _node( ref._node ) {
- }
- /// Assignment
- XMLHandle& operator=( const XMLHandle& ref ) {
- _node = ref._node;
- return *this;
- }
-
- /// Get the first child of this handle.
- XMLHandle FirstChild() {
- return XMLHandle( _node ? _node->FirstChild() : 0 );
- }
- /// Get the first child element of this handle.
- XMLHandle FirstChildElement( const char* name = 0 ) {
- return XMLHandle( _node ? _node->FirstChildElement( name ) : 0 );
- }
- /// Get the last child of this handle.
- XMLHandle LastChild() {
- return XMLHandle( _node ? _node->LastChild() : 0 );
- }
- /// Get the last child element of this handle.
- XMLHandle LastChildElement( const char* name = 0 ) {
- return XMLHandle( _node ? _node->LastChildElement( name ) : 0 );
- }
- /// Get the previous sibling of this handle.
- XMLHandle PreviousSibling() {
- return XMLHandle( _node ? _node->PreviousSibling() : 0 );
- }
- /// Get the previous sibling element of this handle.
- XMLHandle PreviousSiblingElement( const char* name = 0 ) {
- return XMLHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );
- }
- /// Get the next sibling of this handle.
- XMLHandle NextSibling() {
- return XMLHandle( _node ? _node->NextSibling() : 0 );
- }
- /// Get the next sibling element of this handle.
- XMLHandle NextSiblingElement( const char* name = 0 ) {
- return XMLHandle( _node ? _node->NextSiblingElement( name ) : 0 );
- }
-
- /// Safe cast to XMLNode. This can return null.
- XMLNode* ToNode() {
- return _node;
- }
- /// Safe cast to XMLElement. This can return null.
- XMLElement* ToElement() {
- return ( _node ? _node->ToElement() : 0 );
- }
- /// Safe cast to XMLText. This can return null.
- XMLText* ToText() {
- return ( _node ? _node->ToText() : 0 );
- }
- /// Safe cast to XMLUnknown. This can return null.
- XMLUnknown* ToUnknown() {
- return ( _node ? _node->ToUnknown() : 0 );
- }
- /// Safe cast to XMLDeclaration. This can return null.
- XMLDeclaration* ToDeclaration() {
- return ( _node ? _node->ToDeclaration() : 0 );
- }
-
-private:
- XMLNode* _node;
-};
-
-
-/**
- A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the
- same in all regards, except for the 'const' qualifiers. See XMLHandle for API.
-*/
-class TINYXML2_LIB XMLConstHandle
-{
-public:
- XMLConstHandle( const XMLNode* node ) : _node( node ) {
- }
- XMLConstHandle( const XMLNode& node ) : _node( &node ) {
- }
- XMLConstHandle( const XMLConstHandle& ref ) : _node( ref._node ) {
- }
-
- XMLConstHandle& operator=( const XMLConstHandle& ref ) {
- _node = ref._node;
- return *this;
- }
-
- const XMLConstHandle FirstChild() const {
- return XMLConstHandle( _node ? _node->FirstChild() : 0 );
- }
- const XMLConstHandle FirstChildElement( const char* name = 0 ) const {
- return XMLConstHandle( _node ? _node->FirstChildElement( name ) : 0 );
- }
- const XMLConstHandle LastChild() const {
- return XMLConstHandle( _node ? _node->LastChild() : 0 );
- }
- const XMLConstHandle LastChildElement( const char* name = 0 ) const {
- return XMLConstHandle( _node ? _node->LastChildElement( name ) : 0 );
- }
- const XMLConstHandle PreviousSibling() const {
- return XMLConstHandle( _node ? _node->PreviousSibling() : 0 );
- }
- const XMLConstHandle PreviousSiblingElement( const char* name = 0 ) const {
- return XMLConstHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );
- }
- const XMLConstHandle NextSibling() const {
- return XMLConstHandle( _node ? _node->NextSibling() : 0 );
- }
- const XMLConstHandle NextSiblingElement( const char* name = 0 ) const {
- return XMLConstHandle( _node ? _node->NextSiblingElement( name ) : 0 );
- }
-
-
- const XMLNode* ToNode() const {
- return _node;
- }
- const XMLElement* ToElement() const {
- return ( _node ? _node->ToElement() : 0 );
- }
- const XMLText* ToText() const {
- return ( _node ? _node->ToText() : 0 );
- }
- const XMLUnknown* ToUnknown() const {
- return ( _node ? _node->ToUnknown() : 0 );
- }
- const XMLDeclaration* ToDeclaration() const {
- return ( _node ? _node->ToDeclaration() : 0 );
- }
-
-private:
- const XMLNode* _node;
-};
-
-
-/**
- Printing functionality. The XMLPrinter gives you more
- options than the XMLDocument::Print() method.
-
- It can:
- -# Print to memory.
- -# Print to a file you provide.
- -# Print XML without a XMLDocument.
-
- Print to Memory
-
- @verbatim
- XMLPrinter printer;
- doc.Print( &printer );
- SomeFunction( printer.CStr() );
- @endverbatim
-
- Print to a File
-
- You provide the file pointer.
- @verbatim
- XMLPrinter printer( fp );
- doc.Print( &printer );
- @endverbatim
-
- Print without a XMLDocument
-
- When loading, an XML parser is very useful. However, sometimes
- when saving, it just gets in the way. The code is often set up
- for streaming, and constructing the DOM is just overhead.
-
- The Printer supports the streaming case. The following code
- prints out a trivially simple XML file without ever creating
- an XML document.
-
- @verbatim
- XMLPrinter printer( fp );
- printer.OpenElement( "foo" );
- printer.PushAttribute( "foo", "bar" );
- printer.CloseElement();
- @endverbatim
-*/
-class TINYXML2_LIB XMLPrinter : public XMLVisitor
-{
-public:
- /** Construct the printer. If the FILE* is specified,
- this will print to the FILE. Else it will print
- to memory, and the result is available in CStr().
- If 'compact' is set to true, then output is created
- with only required whitespace and newlines.
- */
- XMLPrinter( FILE* file=0, bool compact = false, int depth = 0 );
- virtual ~XMLPrinter() {}
-
- /** If streaming, write the BOM and declaration. */
- void PushHeader( bool writeBOM, bool writeDeclaration );
- /** If streaming, start writing an element.
- The element must be closed with CloseElement()
- */
- void OpenElement( const char* name, bool compactMode=false );
- /// If streaming, add an attribute to an open element.
- void PushAttribute( const char* name, const char* value );
- void PushAttribute( const char* name, int value );
- void PushAttribute( const char* name, unsigned value );
- void PushAttribute(const char* name, int64_t value);
- void PushAttribute( const char* name, bool value );
- void PushAttribute( const char* name, double value );
- /// If streaming, close the Element.
- virtual void CloseElement( bool compactMode=false );
-
- /// Add a text node.
- void PushText( const char* text, bool cdata=false );
- /// Add a text node from an integer.
- void PushText( int value );
- /// Add a text node from an unsigned.
- void PushText( unsigned value );
- /// Add a text node from an unsigned.
- void PushText(int64_t value);
- /// Add a text node from a bool.
- void PushText( bool value );
- /// Add a text node from a float.
- void PushText( float value );
- /// Add a text node from a double.
- void PushText( double value );
-
- /// Add a comment
- void PushComment( const char* comment );
-
- void PushDeclaration( const char* value );
- void PushUnknown( const char* value );
-
- virtual bool VisitEnter( const XMLDocument& /*doc*/ );
- virtual bool VisitExit( const XMLDocument& /*doc*/ ) {
- return true;
- }
-
- virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute );
- virtual bool VisitExit( const XMLElement& element );
-
- virtual bool Visit( const XMLText& text );
- virtual bool Visit( const XMLComment& comment );
- virtual bool Visit( const XMLDeclaration& declaration );
- virtual bool Visit( const XMLUnknown& unknown );
-
- /**
- If in print to memory mode, return a pointer to
- the XML file in memory.
- */
- const char* CStr() const {
- return _buffer.Mem();
- }
- /**
- If in print to memory mode, return the size
- of the XML file in memory. (Note the size returned
- includes the terminating null.)
- */
- int CStrSize() const {
- return _buffer.Size();
- }
- /**
- If in print to memory mode, reset the buffer to the
- beginning.
- */
- void ClearBuffer() {
- _buffer.Clear();
- _buffer.Push(0);
- _firstElement = true;
- }
-
-protected:
- virtual bool CompactMode( const XMLElement& ) { return _compactMode; }
-
- /** Prints out the space before an element. You may override to change
- the space and tabs used. A PrintSpace() override should call Print().
- */
- virtual void PrintSpace( int depth );
- void Print( const char* format, ... );
- void Write( const char* data, size_t size );
- inline void Write( const char* data ) { Write( data, strlen( data ) ); }
- void Putc( char ch );
-
- void SealElementIfJustOpened();
- bool _elementJustOpened;
- DynArray< const char*, 10 > _stack;
-
-private:
- void PrintString( const char*, bool restrictedEntitySet ); // prints out, after detecting entities.
-
- bool _firstElement;
- FILE* _fp;
- int _depth;
- int _textDepth;
- bool _processEntities;
- bool _compactMode;
-
- enum {
- ENTITY_RANGE = 64,
- BUF_SIZE = 200
- };
- bool _entityFlag[ENTITY_RANGE];
- bool _restrictedEntityFlag[ENTITY_RANGE];
-
- DynArray< char, 20 > _buffer;
-
- // Prohibit cloning, intentionally not implemented
- XMLPrinter( const XMLPrinter& );
- XMLPrinter& operator=( const XMLPrinter& );
-};
-
-
-} // tinyxml2
-} // namespace External
-} // namespace Aws
-
-#if defined(_MSC_VER)
-# pragma warning(pop)
-#endif
-
-#endif // TINYXML2_INCLUDED \ No newline at end of file
+ int ErrorLineNum() const
+ {
+ return _errorLineNum;
+ }
+
+ /// Clear the document, resetting it to the initial state.
+ void Clear();
+
+ /**
+ Copies this document to a target document.
+ The target will be completely cleared before the copy.
+ If you want to copy a sub-tree, see XMLNode::DeepClone().
+
+ NOTE: that the 'target' must be non-null.
+ */
+ void DeepCopy(XMLDocument* target) const;
+
+ // internal
+ char* Identify( char* p, XMLNode** node );
+
+ // internal
+ void MarkInUse(XMLNode*);
+
+ virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const {
+ return 0;
+ }
+ virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const {
+ return false;
+ }
+
+private:
+ XMLDocument( const XMLDocument& ); // not supported
+ void operator=( const XMLDocument& ); // not supported
+
+ bool _writeBOM;
+ bool _processEntities;
+ XMLError _errorID;
+ Whitespace _whitespaceMode;
+ mutable StrPair _errorStr;
+ int _errorLineNum;
+ char* _charBuffer;
+ int _parseCurLineNum;
+ // Memory tracking does add some overhead.
+ // However, the code assumes that you don't
+ // have a bunch of unlinked nodes around.
+ // Therefore it takes less memory to track
+ // in the document vs. a linked list in the XMLNode,
+ // and the performance is the same.
+ DynArray<XMLNode*, 10> _unlinked;
+
+ MemPoolT< sizeof(XMLElement) > _elementPool;
+ MemPoolT< sizeof(XMLAttribute) > _attributePool;
+ MemPoolT< sizeof(XMLText) > _textPool;
+ MemPoolT< sizeof(XMLComment) > _commentPool;
+
+ static const char* _errorNames[XML_ERROR_COUNT];
+
+ void Parse();
+
+ void SetError( XMLError error, int lineNum, const char* format, ... );
+
+ template<class NodeType, int PoolElementSize>
+ NodeType* CreateUnlinkedNode( MemPoolT<PoolElementSize>& pool );
+};
+
+template<class NodeType, int PoolElementSize>
+inline NodeType* XMLDocument::CreateUnlinkedNode( MemPoolT<PoolElementSize>& pool )
+{
+ TIXMLASSERT( sizeof( NodeType ) == PoolElementSize );
+ TIXMLASSERT( sizeof( NodeType ) == pool.ItemSize() );
+ NodeType* returnNode = new (pool.Alloc()) NodeType( this );
+ TIXMLASSERT( returnNode );
+ returnNode->_memPool = &pool;
+
+ _unlinked.Push(returnNode);
+ return returnNode;
+}
+
+/**
+ A XMLHandle is a class that wraps a node pointer with null checks; this is
+ an incredibly useful thing. Note that XMLHandle is not part of the TinyXML-2
+ DOM structure. It is a separate utility class.
+
+ Take an example:
+ @verbatim
+ <Document>
+ <Element attributeA = "valueA">
+ <Child attributeB = "value1" />
+ <Child attributeB = "value2" />
+ </Element>
+ </Document>
+ @endverbatim
+
+ Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very
+ easy to write a *lot* of code that looks like:
+
+ @verbatim
+ XMLElement* root = document.FirstChildElement( "Document" );
+ if ( root )
+ {
+ XMLElement* element = root->FirstChildElement( "Element" );
+ if ( element )
+ {
+ XMLElement* child = element->FirstChildElement( "Child" );
+ if ( child )
+ {
+ XMLElement* child2 = child->NextSiblingElement( "Child" );
+ if ( child2 )
+ {
+ // Finally do something useful.
+ @endverbatim
+
+ And that doesn't even cover "else" cases. XMLHandle addresses the verbosity
+ of such code. A XMLHandle checks for null pointers so it is perfectly safe
+ and correct to use:
+
+ @verbatim
+ XMLHandle docHandle( &document );
+ XMLElement* child2 = docHandle.FirstChildElement( "Document" ).FirstChildElement( "Element" ).FirstChildElement().NextSiblingElement();
+ if ( child2 )
+ {
+ // do something useful
+ @endverbatim
+
+ Which is MUCH more concise and useful.
+
+ It is also safe to copy handles - internally they are nothing more than node pointers.
+ @verbatim
+ XMLHandle handleCopy = handle;
+ @endverbatim
+
+ See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects.
+*/
+class TINYXML2_LIB XMLHandle
+{
+public:
+ /// Create a handle from any node (at any depth of the tree.) This can be a null pointer.
+ XMLHandle( XMLNode* node ) : _node( node ) {
+ }
+ /// Create a handle from a node.
+ XMLHandle( XMLNode& node ) : _node( &node ) {
+ }
+ /// Copy constructor
+ XMLHandle( const XMLHandle& ref ) : _node( ref._node ) {
+ }
+ /// Assignment
+ XMLHandle& operator=( const XMLHandle& ref ) {
+ _node = ref._node;
+ return *this;
+ }
+
+ /// Get the first child of this handle.
+ XMLHandle FirstChild() {
+ return XMLHandle( _node ? _node->FirstChild() : 0 );
+ }
+ /// Get the first child element of this handle.
+ XMLHandle FirstChildElement( const char* name = 0 ) {
+ return XMLHandle( _node ? _node->FirstChildElement( name ) : 0 );
+ }
+ /// Get the last child of this handle.
+ XMLHandle LastChild() {
+ return XMLHandle( _node ? _node->LastChild() : 0 );
+ }
+ /// Get the last child element of this handle.
+ XMLHandle LastChildElement( const char* name = 0 ) {
+ return XMLHandle( _node ? _node->LastChildElement( name ) : 0 );
+ }
+ /// Get the previous sibling of this handle.
+ XMLHandle PreviousSibling() {
+ return XMLHandle( _node ? _node->PreviousSibling() : 0 );
+ }
+ /// Get the previous sibling element of this handle.
+ XMLHandle PreviousSiblingElement( const char* name = 0 ) {
+ return XMLHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );
+ }
+ /// Get the next sibling of this handle.
+ XMLHandle NextSibling() {
+ return XMLHandle( _node ? _node->NextSibling() : 0 );
+ }
+ /// Get the next sibling element of this handle.
+ XMLHandle NextSiblingElement( const char* name = 0 ) {
+ return XMLHandle( _node ? _node->NextSiblingElement( name ) : 0 );
+ }
+
+ /// Safe cast to XMLNode. This can return null.
+ XMLNode* ToNode() {
+ return _node;
+ }
+ /// Safe cast to XMLElement. This can return null.
+ XMLElement* ToElement() {
+ return ( _node ? _node->ToElement() : 0 );
+ }
+ /// Safe cast to XMLText. This can return null.
+ XMLText* ToText() {
+ return ( _node ? _node->ToText() : 0 );
+ }
+ /// Safe cast to XMLUnknown. This can return null.
+ XMLUnknown* ToUnknown() {
+ return ( _node ? _node->ToUnknown() : 0 );
+ }
+ /// Safe cast to XMLDeclaration. This can return null.
+ XMLDeclaration* ToDeclaration() {
+ return ( _node ? _node->ToDeclaration() : 0 );
+ }
+
+private:
+ XMLNode* _node;
+};
+
+
+/**
+ A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the
+ same in all regards, except for the 'const' qualifiers. See XMLHandle for API.
+*/
+class TINYXML2_LIB XMLConstHandle
+{
+public:
+ XMLConstHandle( const XMLNode* node ) : _node( node ) {
+ }
+ XMLConstHandle( const XMLNode& node ) : _node( &node ) {
+ }
+ XMLConstHandle( const XMLConstHandle& ref ) : _node( ref._node ) {
+ }
+
+ XMLConstHandle& operator=( const XMLConstHandle& ref ) {
+ _node = ref._node;
+ return *this;
+ }
+
+ const XMLConstHandle FirstChild() const {
+ return XMLConstHandle( _node ? _node->FirstChild() : 0 );
+ }
+ const XMLConstHandle FirstChildElement( const char* name = 0 ) const {
+ return XMLConstHandle( _node ? _node->FirstChildElement( name ) : 0 );
+ }
+ const XMLConstHandle LastChild() const {
+ return XMLConstHandle( _node ? _node->LastChild() : 0 );
+ }
+ const XMLConstHandle LastChildElement( const char* name = 0 ) const {
+ return XMLConstHandle( _node ? _node->LastChildElement( name ) : 0 );
+ }
+ const XMLConstHandle PreviousSibling() const {
+ return XMLConstHandle( _node ? _node->PreviousSibling() : 0 );
+ }
+ const XMLConstHandle PreviousSiblingElement( const char* name = 0 ) const {
+ return XMLConstHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );
+ }
+ const XMLConstHandle NextSibling() const {
+ return XMLConstHandle( _node ? _node->NextSibling() : 0 );
+ }
+ const XMLConstHandle NextSiblingElement( const char* name = 0 ) const {
+ return XMLConstHandle( _node ? _node->NextSiblingElement( name ) : 0 );
+ }
+
+
+ const XMLNode* ToNode() const {
+ return _node;
+ }
+ const XMLElement* ToElement() const {
+ return ( _node ? _node->ToElement() : 0 );
+ }
+ const XMLText* ToText() const {
+ return ( _node ? _node->ToText() : 0 );
+ }
+ const XMLUnknown* ToUnknown() const {
+ return ( _node ? _node->ToUnknown() : 0 );
+ }
+ const XMLDeclaration* ToDeclaration() const {
+ return ( _node ? _node->ToDeclaration() : 0 );
+ }
+
+private:
+ const XMLNode* _node;
+};
+
+
+/**
+ Printing functionality. The XMLPrinter gives you more
+ options than the XMLDocument::Print() method.
+
+ It can:
+ -# Print to memory.
+ -# Print to a file you provide.
+ -# Print XML without a XMLDocument.
+
+ Print to Memory
+
+ @verbatim
+ XMLPrinter printer;
+ doc.Print( &printer );
+ SomeFunction( printer.CStr() );
+ @endverbatim
+
+ Print to a File
+
+ You provide the file pointer.
+ @verbatim
+ XMLPrinter printer( fp );
+ doc.Print( &printer );
+ @endverbatim
+
+ Print without a XMLDocument
+
+ When loading, an XML parser is very useful. However, sometimes
+ when saving, it just gets in the way. The code is often set up
+ for streaming, and constructing the DOM is just overhead.
+
+ The Printer supports the streaming case. The following code
+ prints out a trivially simple XML file without ever creating
+ an XML document.
+
+ @verbatim
+ XMLPrinter printer( fp );
+ printer.OpenElement( "foo" );
+ printer.PushAttribute( "foo", "bar" );
+ printer.CloseElement();
+ @endverbatim
+*/
+class TINYXML2_LIB XMLPrinter : public XMLVisitor
+{
+public:
+ /** Construct the printer. If the FILE* is specified,
+ this will print to the FILE. Else it will print
+ to memory, and the result is available in CStr().
+ If 'compact' is set to true, then output is created
+ with only required whitespace and newlines.
+ */
+ XMLPrinter( FILE* file=0, bool compact = false, int depth = 0 );
+ virtual ~XMLPrinter() {}
+
+ /** If streaming, write the BOM and declaration. */
+ void PushHeader( bool writeBOM, bool writeDeclaration );
+ /** If streaming, start writing an element.
+ The element must be closed with CloseElement()
+ */
+ void OpenElement( const char* name, bool compactMode=false );
+ /// If streaming, add an attribute to an open element.
+ void PushAttribute( const char* name, const char* value );
+ void PushAttribute( const char* name, int value );
+ void PushAttribute( const char* name, unsigned value );
+ void PushAttribute(const char* name, int64_t value);
+ void PushAttribute( const char* name, bool value );
+ void PushAttribute( const char* name, double value );
+ /// If streaming, close the Element.
+ virtual void CloseElement( bool compactMode=false );
+
+ /// Add a text node.
+ void PushText( const char* text, bool cdata=false );
+ /// Add a text node from an integer.
+ void PushText( int value );
+ /// Add a text node from an unsigned.
+ void PushText( unsigned value );
+ /// Add a text node from an unsigned.
+ void PushText(int64_t value);
+ /// Add a text node from a bool.
+ void PushText( bool value );
+ /// Add a text node from a float.
+ void PushText( float value );
+ /// Add a text node from a double.
+ void PushText( double value );
+
+ /// Add a comment
+ void PushComment( const char* comment );
+
+ void PushDeclaration( const char* value );
+ void PushUnknown( const char* value );
+
+ virtual bool VisitEnter( const XMLDocument& /*doc*/ );
+ virtual bool VisitExit( const XMLDocument& /*doc*/ ) {
+ return true;
+ }
+
+ virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute );
+ virtual bool VisitExit( const XMLElement& element );
+
+ virtual bool Visit( const XMLText& text );
+ virtual bool Visit( const XMLComment& comment );
+ virtual bool Visit( const XMLDeclaration& declaration );
+ virtual bool Visit( const XMLUnknown& unknown );
+
+ /**
+ If in print to memory mode, return a pointer to
+ the XML file in memory.
+ */
+ const char* CStr() const {
+ return _buffer.Mem();
+ }
+ /**
+ If in print to memory mode, return the size
+ of the XML file in memory. (Note the size returned
+ includes the terminating null.)
+ */
+ int CStrSize() const {
+ return _buffer.Size();
+ }
+ /**
+ If in print to memory mode, reset the buffer to the
+ beginning.
+ */
+ void ClearBuffer() {
+ _buffer.Clear();
+ _buffer.Push(0);
+ _firstElement = true;
+ }
+
+protected:
+ virtual bool CompactMode( const XMLElement& ) { return _compactMode; }
+
+ /** Prints out the space before an element. You may override to change
+ the space and tabs used. A PrintSpace() override should call Print().
+ */
+ virtual void PrintSpace( int depth );
+ void Print( const char* format, ... );
+ void Write( const char* data, size_t size );
+ inline void Write( const char* data ) { Write( data, strlen( data ) ); }
+ void Putc( char ch );
+
+ void SealElementIfJustOpened();
+ bool _elementJustOpened;
+ DynArray< const char*, 10 > _stack;
+
+private:
+ void PrintString( const char*, bool restrictedEntitySet ); // prints out, after detecting entities.
+
+ bool _firstElement;
+ FILE* _fp;
+ int _depth;
+ int _textDepth;
+ bool _processEntities;
+ bool _compactMode;
+
+ enum {
+ ENTITY_RANGE = 64,
+ BUF_SIZE = 200
+ };
+ bool _entityFlag[ENTITY_RANGE];
+ bool _restrictedEntityFlag[ENTITY_RANGE];
+
+ DynArray< char, 20 > _buffer;
+
+ // Prohibit cloning, intentionally not implemented
+ XMLPrinter( const XMLPrinter& );
+ XMLPrinter& operator=( const XMLPrinter& );
+};
+
+
+} // tinyxml2
+} // namespace External
+} // namespace Aws
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif
+
+#endif // TINYXML2_INCLUDED \ No newline at end of file
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClient.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClient.h
index 4730d48f7e..4c292064d7 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClient.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClient.h
@@ -2,80 +2,80 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <memory>
-#include <atomic>
-#include <mutex>
-#include <condition_variable>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace RateLimits
- {
- class RateLimiterInterface;
- } // namespace RateLimits
- } // namespace Utils
-
- namespace Http
- {
- class HttpRequest;
- class HttpResponse;
-
- /**
- * Abstract HttpClient. All it does is make HttpRequests and return their response.
- */
- class AWS_CORE_API HttpClient
- {
- public:
- HttpClient();
- virtual ~HttpClient() {}
-
- /**
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <memory>
+#include <atomic>
+#include <mutex>
+#include <condition_variable>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace RateLimits
+ {
+ class RateLimiterInterface;
+ } // namespace RateLimits
+ } // namespace Utils
+
+ namespace Http
+ {
+ class HttpRequest;
+ class HttpResponse;
+
+ /**
+ * Abstract HttpClient. All it does is make HttpRequests and return their response.
+ */
+ class AWS_CORE_API HttpClient
+ {
+ public:
+ HttpClient();
+ virtual ~HttpClient() {}
+
+ /**
* Takes an http request, makes it, and returns the newly allocated HttpResponse.
- */
+ */
virtual std::shared_ptr<HttpResponse> MakeRequest(const std::shared_ptr<HttpRequest>& request,
- Aws::Utils::RateLimits::RateLimiterInterface* readLimiter = nullptr,
- Aws::Utils::RateLimits::RateLimiterInterface* writeLimiter = nullptr) const = 0;
-
- /**
+ Aws::Utils::RateLimits::RateLimiterInterface* readLimiter = nullptr,
+ Aws::Utils::RateLimits::RateLimiterInterface* writeLimiter = nullptr) const = 0;
+
+ /**
* If yes, the http client supports transfer-encoding:chunked.
- */
+ */
virtual bool SupportsChunkedTransferEncoding() const { return true; }
-
- /**
- * Stops all requests in progress and prevents any others from initiating.
- */
- void DisableRequestProcessing();
- /**
- * Enables/ReEnables request processing.
- */
- void EnableRequestProcessing();
- /**
- * Returns true if request processing is enabled.
- */
- bool IsRequestProcessingEnabled() const;
- /**
- * Sleeps current thread for sleepTime.
- */
- void RetryRequestSleep(std::chrono::milliseconds sleepTime);
-
- bool ContinueRequest(const Aws::Http::HttpRequest&) const;
-
- private:
-
- std::atomic< bool > m_disableRequestProcessing;
-
- std::mutex m_requestProcessingSignalLock;
- std::condition_variable m_requestProcessingSignal;
- };
-
- } // namespace Http
-} // namespace Aws
-
-
+
+ /**
+ * Stops all requests in progress and prevents any others from initiating.
+ */
+ void DisableRequestProcessing();
+ /**
+ * Enables/ReEnables request processing.
+ */
+ void EnableRequestProcessing();
+ /**
+ * Returns true if request processing is enabled.
+ */
+ bool IsRequestProcessingEnabled() const;
+ /**
+ * Sleeps current thread for sleepTime.
+ */
+ void RetryRequestSleep(std::chrono::milliseconds sleepTime);
+
+ bool ContinueRequest(const Aws::Http::HttpRequest&) const;
+
+ private:
+
+ std::atomic< bool > m_disableRequestProcessing;
+
+ std::mutex m_requestProcessingSignalLock;
+ std::condition_variable m_requestProcessingSignal;
+ };
+
+ } // namespace Http
+} // namespace Aws
+
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClientFactory.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClientFactory.h
index 651275eb6c..a82a773c04 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClientFactory.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpClientFactory.h
@@ -2,64 +2,64 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/http/HttpTypes.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-
-namespace Aws
-{
- namespace Client
- {
- struct ClientConfiguration;
- } // namespace Client
- namespace Http
- {
- class URI;
- class HttpClient;
- class HttpRequest;
-
- /**
- * Interface and default implementation of client for Http stack
- */
- class AWS_CORE_API HttpClientFactory
- {
- public:
- virtual ~HttpClientFactory() {}
-
- /**
- * Creates a shared_ptr of HttpClient with the relevant settings from clientConfiguration
- */
- virtual std::shared_ptr<HttpClient> CreateHttpClient(const Aws::Client::ClientConfiguration& clientConfiguration) const = 0;
- /**
- * Creates a shared_ptr of HttpRequest with uri, method, and closure for how to create a response stream.
- */
- virtual std::shared_ptr<HttpRequest> CreateHttpRequest(const Aws::String& uri, HttpMethod method, const Aws::IOStreamFactory& streamFactory) const = 0;
- /**
- * Creates a shared_ptr of HttpRequest with uri, method, and closure for how to create a response stream.
- */
- virtual std::shared_ptr<HttpRequest> CreateHttpRequest(const URI& uri, HttpMethod method, const Aws::IOStreamFactory& streamFactory) const = 0;
-
- virtual void InitStaticState() {}
- virtual void CleanupStaticState() {}
- };
-
- /**
- * libCurl infects everything with its global state. If it is being used then we automatically initialize and clean it up.
- * If this is a problem for you, set this to false. If you manually initialize libcurl please add the option CURL_GLOBAL_ALL to your init call.
- */
- AWS_CORE_API void SetInitCleanupCurlFlag(bool initCleanupFlag);
- AWS_CORE_API void SetInstallSigPipeHandlerFlag(bool installHandler);
- AWS_CORE_API void InitHttp();
- AWS_CORE_API void CleanupHttp();
- AWS_CORE_API void SetHttpClientFactory(const std::shared_ptr<HttpClientFactory>& factory);
- AWS_CORE_API std::shared_ptr<HttpClient> CreateHttpClient(const Aws::Client::ClientConfiguration& clientConfiguration);
- AWS_CORE_API std::shared_ptr<HttpRequest> CreateHttpRequest(const Aws::String& uri, HttpMethod method, const Aws::IOStreamFactory& streamFactory);
- AWS_CORE_API std::shared_ptr<HttpRequest> CreateHttpRequest(const URI& uri, HttpMethod method, const Aws::IOStreamFactory& streamFactory);
-
- } // namespace Http
-} // namespace Aws
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/http/HttpTypes.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+
+namespace Aws
+{
+ namespace Client
+ {
+ struct ClientConfiguration;
+ } // namespace Client
+ namespace Http
+ {
+ class URI;
+ class HttpClient;
+ class HttpRequest;
+
+ /**
+ * Interface and default implementation of client for Http stack
+ */
+ class AWS_CORE_API HttpClientFactory
+ {
+ public:
+ virtual ~HttpClientFactory() {}
+
+ /**
+ * Creates a shared_ptr of HttpClient with the relevant settings from clientConfiguration
+ */
+ virtual std::shared_ptr<HttpClient> CreateHttpClient(const Aws::Client::ClientConfiguration& clientConfiguration) const = 0;
+ /**
+ * Creates a shared_ptr of HttpRequest with uri, method, and closure for how to create a response stream.
+ */
+ virtual std::shared_ptr<HttpRequest> CreateHttpRequest(const Aws::String& uri, HttpMethod method, const Aws::IOStreamFactory& streamFactory) const = 0;
+ /**
+ * Creates a shared_ptr of HttpRequest with uri, method, and closure for how to create a response stream.
+ */
+ virtual std::shared_ptr<HttpRequest> CreateHttpRequest(const URI& uri, HttpMethod method, const Aws::IOStreamFactory& streamFactory) const = 0;
+
+ virtual void InitStaticState() {}
+ virtual void CleanupStaticState() {}
+ };
+
+ /**
+ * libCurl infects everything with its global state. If it is being used then we automatically initialize and clean it up.
+ * If this is a problem for you, set this to false. If you manually initialize libcurl please add the option CURL_GLOBAL_ALL to your init call.
+ */
+ AWS_CORE_API void SetInitCleanupCurlFlag(bool initCleanupFlag);
+ AWS_CORE_API void SetInstallSigPipeHandlerFlag(bool installHandler);
+ AWS_CORE_API void InitHttp();
+ AWS_CORE_API void CleanupHttp();
+ AWS_CORE_API void SetHttpClientFactory(const std::shared_ptr<HttpClientFactory>& factory);
+ AWS_CORE_API std::shared_ptr<HttpClient> CreateHttpClient(const Aws::Client::ClientConfiguration& clientConfiguration);
+ AWS_CORE_API std::shared_ptr<HttpRequest> CreateHttpRequest(const Aws::String& uri, HttpMethod method, const Aws::IOStreamFactory& streamFactory);
+ AWS_CORE_API std::shared_ptr<HttpRequest> CreateHttpRequest(const URI& uri, HttpMethod method, const Aws::IOStreamFactory& streamFactory);
+
+ } // namespace Http
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpRequest.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpRequest.h
index a62f03c30f..ab71a3a29b 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpRequest.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpRequest.h
@@ -2,24 +2,24 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/http/URI.h>
-#include <aws/core/http/HttpTypes.h>
-#include <aws/core/utils/memory/AWSMemory.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-#include <aws/core/utils/stream/ResponseStream.h>
-#include <aws/core/monitoring/HttpClientMetrics.h>
-#include <memory>
-#include <functional>
-
-namespace Aws
-{
- namespace Http
- {
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/http/URI.h>
+#include <aws/core/http/HttpTypes.h>
+#include <aws/core/utils/memory/AWSMemory.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+#include <aws/core/utils/stream/ResponseStream.h>
+#include <aws/core/monitoring/HttpClientMetrics.h>
+#include <memory>
+#include <functional>
+
+namespace Aws
+{
+ namespace Http
+ {
extern AWS_CORE_API const char DATE_HEADER[];
extern AWS_CORE_API const char AWS_DATE_HEADER[];
extern AWS_CORE_API const char AWS_SECURITY_TOKEN[];
@@ -42,327 +42,327 @@ namespace Aws
extern AWS_CORE_API const char SDK_INVOCATION_ID_HEADER[];
extern AWS_CORE_API const char SDK_REQUEST_HEADER[];
extern AWS_CORE_API const char CHUNKED_VALUE[];
-
- class HttpRequest;
- class HttpResponse;
-
- /**
+
+ class HttpRequest;
+ class HttpResponse;
+
+ /**
* closure type for receiving notifications that data has been received.
- */
- typedef std::function<void(const HttpRequest*, HttpResponse*, long long)> DataReceivedEventHandler;
- /**
- * closure type for receiving notifications that data has been sent.
- */
- typedef std::function<void(const HttpRequest*, long long)> DataSentEventHandler;
- /**
- * Closure type for handling whether or not a request should be canceled.
- */
- typedef std::function<bool(const HttpRequest*)> ContinueRequestHandler;
-
- /**
- * Abstract class for representing an HttpRequest.
- */
- class AWS_CORE_API HttpRequest
- {
- public:
- /**
- * Initializes an HttpRequest object with uri and http method.
- */
- HttpRequest(const URI& uri, HttpMethod method) :
+ */
+ typedef std::function<void(const HttpRequest*, HttpResponse*, long long)> DataReceivedEventHandler;
+ /**
+ * closure type for receiving notifications that data has been sent.
+ */
+ typedef std::function<void(const HttpRequest*, long long)> DataSentEventHandler;
+ /**
+ * Closure type for handling whether or not a request should be canceled.
+ */
+ typedef std::function<bool(const HttpRequest*)> ContinueRequestHandler;
+
+ /**
+ * Abstract class for representing an HttpRequest.
+ */
+ class AWS_CORE_API HttpRequest
+ {
+ public:
+ /**
+ * Initializes an HttpRequest object with uri and http method.
+ */
+ HttpRequest(const URI& uri, HttpMethod method) :
m_uri(uri), m_method(method), m_isEvenStreamRequest(false)
- {}
-
- virtual ~HttpRequest() {}
-
- /**
- * Get All headers for this request.
- */
- virtual HeaderValueCollection GetHeaders() const = 0;
- /**
+ {}
+
+ virtual ~HttpRequest() {}
+
+ /**
+ * Get All headers for this request.
+ */
+ virtual HeaderValueCollection GetHeaders() const = 0;
+ /**
* Get the value for a Header based on its name. (in default StandardHttpRequest implementation, an empty string will be returned if headerName doesn't exist)
- */
- virtual const Aws::String& GetHeaderValue(const char* headerName) const = 0;
- /**
- * Add a header pair
- */
- virtual void SetHeaderValue(const char* headerName, const Aws::String& headerValue) = 0;
- /**
- * Creates a shared_ptr of HttpRequest with uri, method, and closure for how to create a response stream.
- */
- virtual void SetHeaderValue(const Aws::String& headerName, const Aws::String& headerValue) = 0;
- /**
- * Deletes a header from the request by name.
- */
- virtual void DeleteHeader(const char* headerName) = 0;
- /**
- * Adds a content body stream to the request. This stream will be used to send the body to the endpoint.
- */
- virtual void AddContentBody(const std::shared_ptr<Aws::IOStream>& strContent) = 0;
- /**
- * Gets the content body stream that will be used for this request.
- */
- virtual const std::shared_ptr<Aws::IOStream>& GetContentBody() const = 0;
- /**
- * Returns true if a header exists in the request with name
- */
- virtual bool HasHeader(const char* name) const = 0;
- /**
- * Get size in bytes of the request when as it will be going accross the wire.
- */
- virtual int64_t GetSize() const = 0;
- /**
- * Gets the factory for creating the stream that will be used in the http response.
- */
- virtual const Aws::IOStreamFactory& GetResponseStreamFactory() const = 0;
- /**
- * Sets the factory for creating the stream that will be used in the http response.
- */
- virtual void SetResponseStreamFactory(const Aws::IOStreamFactory& factory) = 0;
- /**
- * Gets underlying URI object with mutation access.
- */
- inline URI& GetUri()
- {
- return m_uri;
- }
- /**
- * Gets the underlying URI object.
- */
- const URI& GetUri() const { return m_uri; }
- /**
- * Converts the URI into a string and returns it. If includeQueryString is set to true, the query string
+ */
+ virtual const Aws::String& GetHeaderValue(const char* headerName) const = 0;
+ /**
+ * Add a header pair
+ */
+ virtual void SetHeaderValue(const char* headerName, const Aws::String& headerValue) = 0;
+ /**
+ * Creates a shared_ptr of HttpRequest with uri, method, and closure for how to create a response stream.
+ */
+ virtual void SetHeaderValue(const Aws::String& headerName, const Aws::String& headerValue) = 0;
+ /**
+ * Deletes a header from the request by name.
+ */
+ virtual void DeleteHeader(const char* headerName) = 0;
+ /**
+ * Adds a content body stream to the request. This stream will be used to send the body to the endpoint.
+ */
+ virtual void AddContentBody(const std::shared_ptr<Aws::IOStream>& strContent) = 0;
+ /**
+ * Gets the content body stream that will be used for this request.
+ */
+ virtual const std::shared_ptr<Aws::IOStream>& GetContentBody() const = 0;
+ /**
+ * Returns true if a header exists in the request with name
+ */
+ virtual bool HasHeader(const char* name) const = 0;
+ /**
+ * Get size in bytes of the request when as it will be going accross the wire.
+ */
+ virtual int64_t GetSize() const = 0;
+ /**
+ * Gets the factory for creating the stream that will be used in the http response.
+ */
+ virtual const Aws::IOStreamFactory& GetResponseStreamFactory() const = 0;
+ /**
+ * Sets the factory for creating the stream that will be used in the http response.
+ */
+ virtual void SetResponseStreamFactory(const Aws::IOStreamFactory& factory) = 0;
+ /**
+ * Gets underlying URI object with mutation access.
+ */
+ inline URI& GetUri()
+ {
+ return m_uri;
+ }
+ /**
+ * Gets the underlying URI object.
+ */
+ const URI& GetUri() const { return m_uri; }
+ /**
+ * Converts the URI into a string and returns it. If includeQueryString is set to true, the query string
* will be included in the returned value.
- */
- inline Aws::String GetURIString(bool includeQueryString = true) const
- {
- return m_uri.GetURIString(includeQueryString);
- }
- /**
- * Get the http method for this request.
- */
- inline HttpMethod GetMethod() const
- {
- return m_method;
- }
- /**
- * Gets the query string from the URI on this request.
- */
- inline const Aws::String& GetQueryString() const
- {
- return m_uri.GetQueryString();
- }
- /**
- * Normalizes the URI for use with signing.
- */
- inline void CanonicalizeRequest()
- {
- m_uri.CanonicalizeQueryString();
- }
- /**
- * Gets the query string for the underlying URI as a key value mapping
- */
- inline QueryStringParameterCollection GetQueryStringParameters() const
- {
- return m_uri.GetQueryStringParameters();
- }
- /**
- * Adds a query string parameter to the underlying URI by key and value.
- */
- inline void AddQueryStringParameter(const char* key, const Aws::String& value)
- {
- m_uri.AddQueryStringParameter(key, value);
- }
-
+ */
+ inline Aws::String GetURIString(bool includeQueryString = true) const
+ {
+ return m_uri.GetURIString(includeQueryString);
+ }
+ /**
+ * Get the http method for this request.
+ */
+ inline HttpMethod GetMethod() const
+ {
+ return m_method;
+ }
+ /**
+ * Gets the query string from the URI on this request.
+ */
+ inline const Aws::String& GetQueryString() const
+ {
+ return m_uri.GetQueryString();
+ }
+ /**
+ * Normalizes the URI for use with signing.
+ */
+ inline void CanonicalizeRequest()
+ {
+ m_uri.CanonicalizeQueryString();
+ }
+ /**
+ * Gets the query string for the underlying URI as a key value mapping
+ */
+ inline QueryStringParameterCollection GetQueryStringParameters() const
+ {
+ return m_uri.GetQueryStringParameters();
+ }
+ /**
+ * Adds a query string parameter to the underlying URI by key and value.
+ */
+ inline void AddQueryStringParameter(const char* key, const Aws::String& value)
+ {
+ m_uri.AddQueryStringParameter(key, value);
+ }
+
inline bool HasDate() const
- {
- return HasHeader(DATE_HEADER);
- }
- /**
- * Gets date header.
- */
- inline const Aws::String& GetDate() const
- {
- return GetHeaderValue(DATE_HEADER);
- }
- /**
- * Gets date header.
- */
- inline void SetDate(const Aws::String& value)
- {
- SetHeaderValue(DATE_HEADER, value);
- }
-
- inline bool HasAccept() const
- {
- return HasHeader(ACCEPT_HEADER);
- }
- /**
- * Gets accept header.
- */
- inline const Aws::String& GetAccept() const
- {
- return GetHeaderValue(ACCEPT_HEADER);
- }
- /**
- * Gets accept header.
- */
- inline void SetAccept(const Aws::String& value)
- {
- SetHeaderValue(ACCEPT_HEADER, value);
- }
-
- inline bool HasAcceptCharSet() const
- {
- return HasHeader(ACCEPT_CHAR_SET_HEADER);
- }
- /**
- * Gets Accept CharSet header.
- */
- inline const Aws::String& GetAcceptCharSet() const
- {
- return GetHeaderValue(ACCEPT_CHAR_SET_HEADER);
- }
- /**
- * Sets Accept CharSet header.
- */
- inline void SetAcceptCharSet(const Aws::String& value)
- {
- SetHeaderValue(ACCEPT_CHAR_SET_HEADER, value);
- }
-
- inline bool HasAcceptEncoding() const
- {
- return HasHeader(ACCEPT_ENCODING_HEADER);
- }
- /**
- * Gets accept encoding header.
- */
- inline const Aws::String& GetAcceptEncoding() const
- {
- return GetHeaderValue(ACCEPT_ENCODING_HEADER);
- }
- /**
- * Sets accept encoding header.
- */
- inline void SetAcceptEncoding(const Aws::String& value)
- {
- SetHeaderValue(ACCEPT_ENCODING_HEADER, value);
- }
-
- inline bool HasAuthorization() const
- {
- return HasHeader(AUTHORIZATION_HEADER);
- }
- /**
- * Gets authorization encoding header.
- */
- inline const Aws::String& GetAuthorization() const
- {
- return GetHeaderValue(AUTHORIZATION_HEADER);
- }
- /**
- * Set authorization header.
- */
- inline void SetAuthorization(const Aws::String& value)
- {
- SetHeaderValue(AUTHORIZATION_HEADER, value);
- }
-
- inline bool HasAwsAuthorization() const
- {
- return HasHeader(AWS_AUTHORIZATION_HEADER);
- }
- /**
- * Gets aws authorization header.
- */
- inline const Aws::String& GetAwsAuthorization() const
- {
- return GetHeaderValue(AWS_AUTHORIZATION_HEADER);
- }
- /**
- * Sets aws authorization header.
- */
- inline void SetAwsAuthorization(const Aws::String& value)
- {
- SetHeaderValue(AWS_AUTHORIZATION_HEADER, value);
- }
-
- inline bool HasAwsSessionToken() const
- {
- return HasHeader(AWS_SECURITY_TOKEN);
- }
- /**
- * Gets session token header.
- */
- inline const Aws::String& GetAwsSessionToken() const
- {
- return GetHeaderValue(AWS_SECURITY_TOKEN);
- }
- /**
- * Sets session token header.
- */
- inline void SetAwsSessionToken(const Aws::String& value)
- {
- SetHeaderValue(AWS_SECURITY_TOKEN, value);
- }
-
- inline bool HasCookie() const
- {
- return HasHeader(COOKIE_HEADER);
- }
- /**
- * Gets cookie header.
- */
- inline const Aws::String& GetCookie() const
- {
- return GetHeaderValue(COOKIE_HEADER);
- }
- /**
- * Sets cookie header.
- */
- inline void SetCookie(const Aws::String& value)
- {
- SetHeaderValue(COOKIE_HEADER, value);
- }
-
- inline bool HasContentLength() const
- {
- return HasHeader(CONTENT_LENGTH_HEADER);
- }
- /**
- * Gets content-length header.
- */
- inline const Aws::String& GetContentLength() const
- {
- return GetHeaderValue(CONTENT_LENGTH_HEADER);
- }
- /**
- * Sets content-length header.
- */
- inline void SetContentLength(const Aws::String& value)
- {
- SetHeaderValue(CONTENT_LENGTH_HEADER, value);
- }
-
- inline bool HasContentType() const
- {
- return HasHeader(CONTENT_TYPE_HEADER);
- }
- /**
- * Gets content-type header.
- */
- inline const Aws::String& GetContentType() const
- {
- return GetHeaderValue(CONTENT_TYPE_HEADER);
- }
- /**
- * sets content-type header.
- */
- inline void SetContentType(const Aws::String& value)
- {
- SetHeaderValue(CONTENT_TYPE_HEADER, value);
- }
-
+ {
+ return HasHeader(DATE_HEADER);
+ }
+ /**
+ * Gets date header.
+ */
+ inline const Aws::String& GetDate() const
+ {
+ return GetHeaderValue(DATE_HEADER);
+ }
+ /**
+ * Gets date header.
+ */
+ inline void SetDate(const Aws::String& value)
+ {
+ SetHeaderValue(DATE_HEADER, value);
+ }
+
+ inline bool HasAccept() const
+ {
+ return HasHeader(ACCEPT_HEADER);
+ }
+ /**
+ * Gets accept header.
+ */
+ inline const Aws::String& GetAccept() const
+ {
+ return GetHeaderValue(ACCEPT_HEADER);
+ }
+ /**
+ * Gets accept header.
+ */
+ inline void SetAccept(const Aws::String& value)
+ {
+ SetHeaderValue(ACCEPT_HEADER, value);
+ }
+
+ inline bool HasAcceptCharSet() const
+ {
+ return HasHeader(ACCEPT_CHAR_SET_HEADER);
+ }
+ /**
+ * Gets Accept CharSet header.
+ */
+ inline const Aws::String& GetAcceptCharSet() const
+ {
+ return GetHeaderValue(ACCEPT_CHAR_SET_HEADER);
+ }
+ /**
+ * Sets Accept CharSet header.
+ */
+ inline void SetAcceptCharSet(const Aws::String& value)
+ {
+ SetHeaderValue(ACCEPT_CHAR_SET_HEADER, value);
+ }
+
+ inline bool HasAcceptEncoding() const
+ {
+ return HasHeader(ACCEPT_ENCODING_HEADER);
+ }
+ /**
+ * Gets accept encoding header.
+ */
+ inline const Aws::String& GetAcceptEncoding() const
+ {
+ return GetHeaderValue(ACCEPT_ENCODING_HEADER);
+ }
+ /**
+ * Sets accept encoding header.
+ */
+ inline void SetAcceptEncoding(const Aws::String& value)
+ {
+ SetHeaderValue(ACCEPT_ENCODING_HEADER, value);
+ }
+
+ inline bool HasAuthorization() const
+ {
+ return HasHeader(AUTHORIZATION_HEADER);
+ }
+ /**
+ * Gets authorization encoding header.
+ */
+ inline const Aws::String& GetAuthorization() const
+ {
+ return GetHeaderValue(AUTHORIZATION_HEADER);
+ }
+ /**
+ * Set authorization header.
+ */
+ inline void SetAuthorization(const Aws::String& value)
+ {
+ SetHeaderValue(AUTHORIZATION_HEADER, value);
+ }
+
+ inline bool HasAwsAuthorization() const
+ {
+ return HasHeader(AWS_AUTHORIZATION_HEADER);
+ }
+ /**
+ * Gets aws authorization header.
+ */
+ inline const Aws::String& GetAwsAuthorization() const
+ {
+ return GetHeaderValue(AWS_AUTHORIZATION_HEADER);
+ }
+ /**
+ * Sets aws authorization header.
+ */
+ inline void SetAwsAuthorization(const Aws::String& value)
+ {
+ SetHeaderValue(AWS_AUTHORIZATION_HEADER, value);
+ }
+
+ inline bool HasAwsSessionToken() const
+ {
+ return HasHeader(AWS_SECURITY_TOKEN);
+ }
+ /**
+ * Gets session token header.
+ */
+ inline const Aws::String& GetAwsSessionToken() const
+ {
+ return GetHeaderValue(AWS_SECURITY_TOKEN);
+ }
+ /**
+ * Sets session token header.
+ */
+ inline void SetAwsSessionToken(const Aws::String& value)
+ {
+ SetHeaderValue(AWS_SECURITY_TOKEN, value);
+ }
+
+ inline bool HasCookie() const
+ {
+ return HasHeader(COOKIE_HEADER);
+ }
+ /**
+ * Gets cookie header.
+ */
+ inline const Aws::String& GetCookie() const
+ {
+ return GetHeaderValue(COOKIE_HEADER);
+ }
+ /**
+ * Sets cookie header.
+ */
+ inline void SetCookie(const Aws::String& value)
+ {
+ SetHeaderValue(COOKIE_HEADER, value);
+ }
+
+ inline bool HasContentLength() const
+ {
+ return HasHeader(CONTENT_LENGTH_HEADER);
+ }
+ /**
+ * Gets content-length header.
+ */
+ inline const Aws::String& GetContentLength() const
+ {
+ return GetHeaderValue(CONTENT_LENGTH_HEADER);
+ }
+ /**
+ * Sets content-length header.
+ */
+ inline void SetContentLength(const Aws::String& value)
+ {
+ SetHeaderValue(CONTENT_LENGTH_HEADER, value);
+ }
+
+ inline bool HasContentType() const
+ {
+ return HasHeader(CONTENT_TYPE_HEADER);
+ }
+ /**
+ * Gets content-type header.
+ */
+ inline const Aws::String& GetContentType() const
+ {
+ return GetHeaderValue(CONTENT_TYPE_HEADER);
+ }
+ /**
+ * sets content-type header.
+ */
+ inline void SetContentType(const Aws::String& value)
+ {
+ SetHeaderValue(CONTENT_TYPE_HEADER, value);
+ }
+
inline bool HasTransferEncoding() const
{
return HasHeader(TRANSFER_ENCODING_HEADER);
@@ -382,45 +382,45 @@ namespace Aws
SetHeaderValue(TRANSFER_ENCODING_HEADER, value);
}
- inline bool HasUserAgent() const
- {
- return HasHeader(USER_AGENT_HEADER);
- }
- /**
- * Gets User Agent header.
- */
- inline const Aws::String& GetUserAgent() const
- {
- return GetHeaderValue(USER_AGENT_HEADER);
- }
- /**
- * Sets User Agent header.
- */
- inline void SetUserAgent(const Aws::String& value)
- {
- SetHeaderValue(USER_AGENT_HEADER, value);
- }
-
- inline bool HasVia() const
- {
- return HasHeader(VIA_HEADER);
- }
- /**
- * Gets via header header.
- */
- inline const Aws::String& GetVia() const
- {
- return GetHeaderValue(VIA_HEADER);
- }
- /**
- * Sets via header.
- */
- inline void SetVia(const Aws::String& value)
- {
- SetHeaderValue(VIA_HEADER, value);
- }
-
- /**
+ inline bool HasUserAgent() const
+ {
+ return HasHeader(USER_AGENT_HEADER);
+ }
+ /**
+ * Gets User Agent header.
+ */
+ inline const Aws::String& GetUserAgent() const
+ {
+ return GetHeaderValue(USER_AGENT_HEADER);
+ }
+ /**
+ * Sets User Agent header.
+ */
+ inline void SetUserAgent(const Aws::String& value)
+ {
+ SetHeaderValue(USER_AGENT_HEADER, value);
+ }
+
+ inline bool HasVia() const
+ {
+ return HasHeader(VIA_HEADER);
+ }
+ /**
+ * Gets via header header.
+ */
+ inline const Aws::String& GetVia() const
+ {
+ return GetHeaderValue(VIA_HEADER);
+ }
+ /**
+ * Sets via header.
+ */
+ inline void SetVia(const Aws::String& value)
+ {
+ SetHeaderValue(VIA_HEADER, value);
+ }
+
+ /**
* Has Api version header x-amz-api-version
*/
inline bool HasApiVersion() const
@@ -444,76 +444,76 @@ namespace Aws
}
/**
- * Sets the closure for receiving events when data is received from the server.
- */
- inline void SetDataReceivedEventHandler(const DataReceivedEventHandler& dataReceivedEventHandler) { m_onDataReceived = dataReceivedEventHandler; }
- /**
- * Sets the closure for receiving events when data is received from the server.
- */
- inline void SetDataReceivedEventHandler(DataReceivedEventHandler&& dataReceivedEventHandler) { m_onDataReceived = std::move(dataReceivedEventHandler); }
- /**
- * Sets the closure for receiving events when data is sent to the server.
- */
- inline void SetDataSentEventHandler(const DataSentEventHandler& dataSentEventHandler) { m_onDataSent = dataSentEventHandler; }
- /**
- * Sets the closure for receiving events when data is sent to the server.
- */
- inline void SetDataSentEventHandler(DataSentEventHandler&& dataSentEventHandler) { m_onDataSent = std::move(dataSentEventHandler); }
- /**
- * Sets the closure for handling whether or not to cancel a request.
- */
- inline void SetContinueRequestHandle(const ContinueRequestHandler& continueRequestHandler) { m_continueRequest = continueRequestHandler; }
- /**
- * Sets the closure for handling whether or not to cancel a request.
- */
- inline void SetContinueRequestHandle(ContinueRequestHandler&& continueRequestHandler) { m_continueRequest = std::move(continueRequestHandler); }
-
- /**
- * Gets the closure for receiving events when data is received from the server.
- */
- inline const DataReceivedEventHandler& GetDataReceivedEventHandler() const { return m_onDataReceived; }
- /**
- * Gets the closure for receiving events when data is sent to the server.
- */
- inline const DataSentEventHandler& GetDataSentEventHandler() const { return m_onDataSent; }
-
- inline const ContinueRequestHandler& GetContinueRequestHandler() const { return m_continueRequest; }
-
- /**
- * Gets the AWS Access Key if this HttpRequest is signed with Aws Access Key
- */
- inline const Aws::String& GetSigningAccessKey() const { return m_signingAccessKey; }
- /**
- * Sets the Aws Access Key if this HttpRequest is signed with Aws Access Key
- */
- inline void SetSigningAccessKey(const Aws::String& accessKey) { m_signingAccessKey = accessKey; }
-
- /**
- * Gets the signing region if this request is signed.
- */
- inline const Aws::String& GetSigningRegion() const { return m_signingRegion; }
- /**
- * Sets the signing region if this request is signed.
- */
- inline void SetSigningRegion(const Aws::String& region) { m_signingRegion = region; }
-
- /**
- * Add a request metric
- * @param key, HttpClientMetricsKey defined in HttpClientMetrics.cpp
- * @param value, the corresponding value of this key measured during http request.
- */
- virtual void AddRequestMetric(const Aws::String& key, int64_t value) { m_httpRequestMetrics.emplace(key, value); }
-
- /**
- * Sets the request metrics
- */
+ * Sets the closure for receiving events when data is received from the server.
+ */
+ inline void SetDataReceivedEventHandler(const DataReceivedEventHandler& dataReceivedEventHandler) { m_onDataReceived = dataReceivedEventHandler; }
+ /**
+ * Sets the closure for receiving events when data is received from the server.
+ */
+ inline void SetDataReceivedEventHandler(DataReceivedEventHandler&& dataReceivedEventHandler) { m_onDataReceived = std::move(dataReceivedEventHandler); }
+ /**
+ * Sets the closure for receiving events when data is sent to the server.
+ */
+ inline void SetDataSentEventHandler(const DataSentEventHandler& dataSentEventHandler) { m_onDataSent = dataSentEventHandler; }
+ /**
+ * Sets the closure for receiving events when data is sent to the server.
+ */
+ inline void SetDataSentEventHandler(DataSentEventHandler&& dataSentEventHandler) { m_onDataSent = std::move(dataSentEventHandler); }
+ /**
+ * Sets the closure for handling whether or not to cancel a request.
+ */
+ inline void SetContinueRequestHandle(const ContinueRequestHandler& continueRequestHandler) { m_continueRequest = continueRequestHandler; }
+ /**
+ * Sets the closure for handling whether or not to cancel a request.
+ */
+ inline void SetContinueRequestHandle(ContinueRequestHandler&& continueRequestHandler) { m_continueRequest = std::move(continueRequestHandler); }
+
+ /**
+ * Gets the closure for receiving events when data is received from the server.
+ */
+ inline const DataReceivedEventHandler& GetDataReceivedEventHandler() const { return m_onDataReceived; }
+ /**
+ * Gets the closure for receiving events when data is sent to the server.
+ */
+ inline const DataSentEventHandler& GetDataSentEventHandler() const { return m_onDataSent; }
+
+ inline const ContinueRequestHandler& GetContinueRequestHandler() const { return m_continueRequest; }
+
+ /**
+ * Gets the AWS Access Key if this HttpRequest is signed with Aws Access Key
+ */
+ inline const Aws::String& GetSigningAccessKey() const { return m_signingAccessKey; }
+ /**
+ * Sets the Aws Access Key if this HttpRequest is signed with Aws Access Key
+ */
+ inline void SetSigningAccessKey(const Aws::String& accessKey) { m_signingAccessKey = accessKey; }
+
+ /**
+ * Gets the signing region if this request is signed.
+ */
+ inline const Aws::String& GetSigningRegion() const { return m_signingRegion; }
+ /**
+ * Sets the signing region if this request is signed.
+ */
+ inline void SetSigningRegion(const Aws::String& region) { m_signingRegion = region; }
+
+ /**
+ * Add a request metric
+ * @param key, HttpClientMetricsKey defined in HttpClientMetrics.cpp
+ * @param value, the corresponding value of this key measured during http request.
+ */
+ virtual void AddRequestMetric(const Aws::String& key, int64_t value) { m_httpRequestMetrics.emplace(key, value); }
+
+ /**
+ * Sets the request metrics
+ */
virtual void SetRequestMetrics(const Aws::Monitoring::HttpClientMetricsCollection& collection) { m_httpRequestMetrics = collection; }
-
- /**
- * Gets the request metrics
- */
+
+ /**
+ * Gets the request metrics
+ */
virtual const Aws::Monitoring::HttpClientMetricsCollection& GetRequestMetrics() const { return m_httpRequestMetrics; }
-
+
/**
* Returns the IP address of the remote host the request was made out to.
* This value is populated after the request is made and when the HTTP client supports retrieving such
@@ -525,18 +525,18 @@ namespace Aws
bool IsEventStreamRequest() { return m_isEvenStreamRequest; }
void SetEventStreamRequest(bool eventStreamRequest) { m_isEvenStreamRequest = eventStreamRequest; }
- private:
- URI m_uri;
- HttpMethod m_method;
+ private:
+ URI m_uri;
+ HttpMethod m_method;
bool m_isEvenStreamRequest;
- DataReceivedEventHandler m_onDataReceived;
- DataSentEventHandler m_onDataSent;
- ContinueRequestHandler m_continueRequest;
- Aws::String m_signingRegion;
- Aws::String m_signingAccessKey;
+ DataReceivedEventHandler m_onDataReceived;
+ DataSentEventHandler m_onDataSent;
+ ContinueRequestHandler m_continueRequest;
+ Aws::String m_signingRegion;
+ Aws::String m_signingAccessKey;
Aws::String m_resolvedRemoteHost;
Aws::Monitoring::HttpClientMetricsCollection m_httpRequestMetrics;
- };
-
- } // namespace Http
-} // namespace Aws
+ };
+
+ } // namespace Http
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpResponse.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpResponse.h
index ee6798e229..1db30d1730 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpResponse.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpResponse.h
@@ -2,198 +2,198 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/http/HttpRequest.h>
-#include <aws/core/http/HttpTypes.h>
-#include <aws/core/utils/memory/AWSMemory.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/http/HttpRequest.h>
+#include <aws/core/http/HttpTypes.h>
+#include <aws/core/utils/memory/AWSMemory.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/client/CoreErrors.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Stream
- {
- class ResponseStream;
- }
- }
- namespace Http
- {
- /**
- * Enum of Http response Codes. The integer values of the response codes correspond to the values in the RFC.
- */
- enum class HttpResponseCode
- {
- REQUEST_NOT_MADE = -1,
- CONTINUE = 100,
- SWITCHING_PROTOCOLS = 101,
- PROCESSING = 102,
- OK = 200,
- CREATED = 201,
- ACCEPTED = 202,
- NON_AUTHORITATIVE_INFORMATION = 203,
- NO_CONTENT = 204,
- RESET_CONTENT = 205,
- PARTIAL_CONTENT = 206,
- MULTI_STATUS = 207,
- ALREADY_REPORTED = 208,
- IM_USED = 226,
- MULTIPLE_CHOICES = 300,
- MOVED_PERMANENTLY = 301,
- FOUND = 302,
- SEE_OTHER = 303,
- NOT_MODIFIED = 304,
- USE_PROXY = 305,
- SWITCH_PROXY = 306,
- TEMPORARY_REDIRECT = 307,
- PERMANENT_REDIRECT = 308,
- BAD_REQUEST = 400,
- UNAUTHORIZED = 401,
- PAYMENT_REQUIRED = 402,
- FORBIDDEN = 403,
- NOT_FOUND = 404,
- METHOD_NOT_ALLOWED = 405,
- NOT_ACCEPTABLE = 406,
- PROXY_AUTHENTICATION_REQUIRED = 407,
- REQUEST_TIMEOUT = 408,
- CONFLICT = 409,
- GONE = 410,
- LENGTH_REQUIRED = 411,
- PRECONDITION_FAILED = 412,
- REQUEST_ENTITY_TOO_LARGE = 413,
- REQUEST_URI_TOO_LONG = 414,
- UNSUPPORTED_MEDIA_TYPE = 415,
- REQUESTED_RANGE_NOT_SATISFIABLE = 416,
- EXPECTATION_FAILED = 417,
- IM_A_TEAPOT = 418,
- AUTHENTICATION_TIMEOUT = 419,
- METHOD_FAILURE = 420,
- UNPROC_ENTITY = 422,
- LOCKED = 423,
- FAILED_DEPENDENCY = 424,
- UPGRADE_REQUIRED = 426,
- PRECONDITION_REQUIRED = 427,
- TOO_MANY_REQUESTS = 429,
- REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
- LOGIN_TIMEOUT = 440,
- NO_RESPONSE = 444,
- RETRY_WITH = 449,
- BLOCKED = 450,
- REDIRECT = 451,
- REQUEST_HEADER_TOO_LARGE = 494,
- CERT_ERROR = 495,
- NO_CERT = 496,
- HTTP_TO_HTTPS = 497,
- CLIENT_CLOSED_TO_REQUEST = 499,
- INTERNAL_SERVER_ERROR = 500,
- NOT_IMPLEMENTED = 501,
- BAD_GATEWAY = 502,
- SERVICE_UNAVAILABLE = 503,
- GATEWAY_TIMEOUT = 504,
- HTTP_VERSION_NOT_SUPPORTED = 505,
- VARIANT_ALSO_NEGOTIATES = 506,
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Stream
+ {
+ class ResponseStream;
+ }
+ }
+ namespace Http
+ {
+ /**
+ * Enum of Http response Codes. The integer values of the response codes correspond to the values in the RFC.
+ */
+ enum class HttpResponseCode
+ {
+ REQUEST_NOT_MADE = -1,
+ CONTINUE = 100,
+ SWITCHING_PROTOCOLS = 101,
+ PROCESSING = 102,
+ OK = 200,
+ CREATED = 201,
+ ACCEPTED = 202,
+ NON_AUTHORITATIVE_INFORMATION = 203,
+ NO_CONTENT = 204,
+ RESET_CONTENT = 205,
+ PARTIAL_CONTENT = 206,
+ MULTI_STATUS = 207,
+ ALREADY_REPORTED = 208,
+ IM_USED = 226,
+ MULTIPLE_CHOICES = 300,
+ MOVED_PERMANENTLY = 301,
+ FOUND = 302,
+ SEE_OTHER = 303,
+ NOT_MODIFIED = 304,
+ USE_PROXY = 305,
+ SWITCH_PROXY = 306,
+ TEMPORARY_REDIRECT = 307,
+ PERMANENT_REDIRECT = 308,
+ BAD_REQUEST = 400,
+ UNAUTHORIZED = 401,
+ PAYMENT_REQUIRED = 402,
+ FORBIDDEN = 403,
+ NOT_FOUND = 404,
+ METHOD_NOT_ALLOWED = 405,
+ NOT_ACCEPTABLE = 406,
+ PROXY_AUTHENTICATION_REQUIRED = 407,
+ REQUEST_TIMEOUT = 408,
+ CONFLICT = 409,
+ GONE = 410,
+ LENGTH_REQUIRED = 411,
+ PRECONDITION_FAILED = 412,
+ REQUEST_ENTITY_TOO_LARGE = 413,
+ REQUEST_URI_TOO_LONG = 414,
+ UNSUPPORTED_MEDIA_TYPE = 415,
+ REQUESTED_RANGE_NOT_SATISFIABLE = 416,
+ EXPECTATION_FAILED = 417,
+ IM_A_TEAPOT = 418,
+ AUTHENTICATION_TIMEOUT = 419,
+ METHOD_FAILURE = 420,
+ UNPROC_ENTITY = 422,
+ LOCKED = 423,
+ FAILED_DEPENDENCY = 424,
+ UPGRADE_REQUIRED = 426,
+ PRECONDITION_REQUIRED = 427,
+ TOO_MANY_REQUESTS = 429,
+ REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
+ LOGIN_TIMEOUT = 440,
+ NO_RESPONSE = 444,
+ RETRY_WITH = 449,
+ BLOCKED = 450,
+ REDIRECT = 451,
+ REQUEST_HEADER_TOO_LARGE = 494,
+ CERT_ERROR = 495,
+ NO_CERT = 496,
+ HTTP_TO_HTTPS = 497,
+ CLIENT_CLOSED_TO_REQUEST = 499,
+ INTERNAL_SERVER_ERROR = 500,
+ NOT_IMPLEMENTED = 501,
+ BAD_GATEWAY = 502,
+ SERVICE_UNAVAILABLE = 503,
+ GATEWAY_TIMEOUT = 504,
+ HTTP_VERSION_NOT_SUPPORTED = 505,
+ VARIANT_ALSO_NEGOTIATES = 506,
INSUFFICIENT_STORAGE = 507,
- LOOP_DETECTED = 508,
- BANDWIDTH_LIMIT_EXCEEDED = 509,
- NOT_EXTENDED = 510,
- NETWORK_AUTHENTICATION_REQUIRED = 511,
- NETWORK_READ_TIMEOUT = 598,
- NETWORK_CONNECT_TIMEOUT = 599
- };
-
- inline bool IsRetryableHttpResponseCode(HttpResponseCode responseCode)
- {
- switch (responseCode)
- {
- case HttpResponseCode::INTERNAL_SERVER_ERROR:
- case HttpResponseCode::SERVICE_UNAVAILABLE:
- case HttpResponseCode::TOO_MANY_REQUESTS:
- case HttpResponseCode::BANDWIDTH_LIMIT_EXCEEDED:
- case HttpResponseCode::REQUEST_TIMEOUT:
- case HttpResponseCode::AUTHENTICATION_TIMEOUT:
- case HttpResponseCode::LOGIN_TIMEOUT:
- case HttpResponseCode::GATEWAY_TIMEOUT:
- case HttpResponseCode::NETWORK_READ_TIMEOUT:
- case HttpResponseCode::NETWORK_CONNECT_TIMEOUT:
- return true;
- default:
- return false;
- }
- }
-
- /**
- * Abstract class for representing an Http Response.
- */
- class AWS_CORE_API HttpResponse
- {
- public:
- /**
- * Initializes an http response with the originalRequest and the response code.
- */
+ LOOP_DETECTED = 508,
+ BANDWIDTH_LIMIT_EXCEEDED = 509,
+ NOT_EXTENDED = 510,
+ NETWORK_AUTHENTICATION_REQUIRED = 511,
+ NETWORK_READ_TIMEOUT = 598,
+ NETWORK_CONNECT_TIMEOUT = 599
+ };
+
+ inline bool IsRetryableHttpResponseCode(HttpResponseCode responseCode)
+ {
+ switch (responseCode)
+ {
+ case HttpResponseCode::INTERNAL_SERVER_ERROR:
+ case HttpResponseCode::SERVICE_UNAVAILABLE:
+ case HttpResponseCode::TOO_MANY_REQUESTS:
+ case HttpResponseCode::BANDWIDTH_LIMIT_EXCEEDED:
+ case HttpResponseCode::REQUEST_TIMEOUT:
+ case HttpResponseCode::AUTHENTICATION_TIMEOUT:
+ case HttpResponseCode::LOGIN_TIMEOUT:
+ case HttpResponseCode::GATEWAY_TIMEOUT:
+ case HttpResponseCode::NETWORK_READ_TIMEOUT:
+ case HttpResponseCode::NETWORK_CONNECT_TIMEOUT:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Abstract class for representing an Http Response.
+ */
+ class AWS_CORE_API HttpResponse
+ {
+ public:
+ /**
+ * Initializes an http response with the originalRequest and the response code.
+ */
HttpResponse(const std::shared_ptr<const HttpRequest>& originatingRequest) :
- m_httpRequest(originatingRequest),
- m_responseCode(HttpResponseCode::REQUEST_NOT_MADE),
+ m_httpRequest(originatingRequest),
+ m_responseCode(HttpResponseCode::REQUEST_NOT_MADE),
m_hasClientError(false)
- {}
-
- virtual ~HttpResponse() = default;
-
- /**
+ {}
+
+ virtual ~HttpResponse() = default;
+
+ /**
* Gets the request that originated this response
- */
+ */
virtual inline const HttpRequest& GetOriginatingRequest() const { return *m_httpRequest; }
-
- /**
+
+ /**
* Sets the request that originated this response
*/
virtual inline void SetOriginatingRequest(const std::shared_ptr<const HttpRequest>& httpRequest) { m_httpRequest = httpRequest; }
-
- /**
- * Get the headers from this response
- */
- virtual HeaderValueCollection GetHeaders() const = 0;
- /**
- * Returns true if the response contains a header by headerName
- */
- virtual bool HasHeader(const char* headerName) const = 0;
- /**
- * Returns the value for a header at headerName if it exists.
- */
- virtual const Aws::String& GetHeader(const Aws::String& headerName) const = 0;
- /**
- * Gets response code for this http response.
- */
- virtual inline HttpResponseCode GetResponseCode() const { return m_responseCode; }
- /**
- * Sets the response code for this http response.
- */
- virtual inline void SetResponseCode(HttpResponseCode httpResponseCode) { m_responseCode = httpResponseCode; }
- /**
- * Gets the content-type of the response body
- */
- virtual const Aws::String& GetContentType() const { return GetHeader(Http::CONTENT_TYPE_HEADER); }
- /**
- * Gets the response body of the response.
- */
- virtual Aws::IOStream& GetResponseBody() const = 0;
- /**
- * Gives full control of the memory of the ResponseBody over to the caller. At this point, it is the caller's
- * responsibility to clean up this object.
- */
- virtual Utils::Stream::ResponseStream&& SwapResponseStreamOwnership() = 0;
- /**
- * Adds a header to the http response object.
- */
- virtual void AddHeader(const Aws::String&, const Aws::String&) = 0;
- /**
- * Sets the content type header on the http response object.
- */
- virtual void SetContentType(const Aws::String& contentType) { AddHeader("content-type", contentType); }
-
+
+ /**
+ * Get the headers from this response
+ */
+ virtual HeaderValueCollection GetHeaders() const = 0;
+ /**
+ * Returns true if the response contains a header by headerName
+ */
+ virtual bool HasHeader(const char* headerName) const = 0;
+ /**
+ * Returns the value for a header at headerName if it exists.
+ */
+ virtual const Aws::String& GetHeader(const Aws::String& headerName) const = 0;
+ /**
+ * Gets response code for this http response.
+ */
+ virtual inline HttpResponseCode GetResponseCode() const { return m_responseCode; }
+ /**
+ * Sets the response code for this http response.
+ */
+ virtual inline void SetResponseCode(HttpResponseCode httpResponseCode) { m_responseCode = httpResponseCode; }
+ /**
+ * Gets the content-type of the response body
+ */
+ virtual const Aws::String& GetContentType() const { return GetHeader(Http::CONTENT_TYPE_HEADER); }
+ /**
+ * Gets the response body of the response.
+ */
+ virtual Aws::IOStream& GetResponseBody() const = 0;
+ /**
+ * Gives full control of the memory of the ResponseBody over to the caller. At this point, it is the caller's
+ * responsibility to clean up this object.
+ */
+ virtual Utils::Stream::ResponseStream&& SwapResponseStreamOwnership() = 0;
+ /**
+ * Adds a header to the http response object.
+ */
+ virtual void AddHeader(const Aws::String&, const Aws::String&) = 0;
+ /**
+ * Sets the content type header on the http response object.
+ */
+ virtual void SetContentType(const Aws::String& contentType) { AddHeader("content-type", contentType); }
+
inline bool HasClientError() const { return m_hasClientError; }
inline void SetClientErrorType(Aws::Client::CoreErrors errorType) {m_hasClientError = true; m_clientErrorType = errorType;}
inline Aws::Client::CoreErrors GetClientErrorType() { return m_clientErrorType; }
@@ -201,19 +201,19 @@ namespace Aws
inline const Aws::String &GetClientErrorMessage() const { return m_clientErrorMessage; }
inline void SetClientErrorMessage(const Aws::String &error) { m_clientErrorMessage = error; }
- private:
- HttpResponse(const HttpResponse&);
- HttpResponse& operator = (const HttpResponse&);
-
+ private:
+ HttpResponse(const HttpResponse&);
+ HttpResponse& operator = (const HttpResponse&);
+
std::shared_ptr<const HttpRequest> m_httpRequest;
- HttpResponseCode m_responseCode;
+ HttpResponseCode m_responseCode;
// Error generated by http client, SDK or users, indicating non service error during http request
bool m_hasClientError;
Aws::Client::CoreErrors m_clientErrorType;
Aws::String m_clientErrorMessage;
- };
-
- } // namespace Http
-} // namespace Aws
-
-
+ };
+
+ } // namespace Http
+} // namespace Aws
+
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpTypes.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpTypes.h
index f395f77972..b8c993294a 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpTypes.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/HttpTypes.h
@@ -2,56 +2,56 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSList.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/memory/stl/AWSMap.h>
-
-#include <memory>
-
-namespace Aws
-{
- namespace Http
- {
- /**
- * Models Http methods.
- */
- enum class HttpMethod
- {
- HTTP_GET,
- HTTP_POST,
- HTTP_DELETE,
- HTTP_PUT,
- HTTP_HEAD,
- HTTP_PATCH
- };
-
- /**
- * Possible default http factory vended http client implementations.
- */
- enum class TransferLibType
- {
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSList.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSMap.h>
+
+#include <memory>
+
+namespace Aws
+{
+ namespace Http
+ {
+ /**
+ * Models Http methods.
+ */
+ enum class HttpMethod
+ {
+ HTTP_GET,
+ HTTP_POST,
+ HTTP_DELETE,
+ HTTP_PUT,
+ HTTP_HEAD,
+ HTTP_PATCH
+ };
+
+ /**
+ * Possible default http factory vended http client implementations.
+ */
+ enum class TransferLibType
+ {
DEFAULT_CLIENT = 0,
- CURL_CLIENT,
- WIN_INET_CLIENT,
- WIN_HTTP_CLIENT
- };
-
- namespace HttpMethodMapper
- {
- /**
- * Gets the string value of an httpMethod.
- */
- AWS_CORE_API const char* GetNameForHttpMethod(HttpMethod httpMethod);
- } // namespace HttpMethodMapper
-
- typedef std::pair<Aws::String, Aws::String> HeaderValuePair;
- typedef Aws::Map<Aws::String, Aws::String> HeaderValueCollection;
-
- } // namespace Http
-} // namespace Aws
-
+ CURL_CLIENT,
+ WIN_INET_CLIENT,
+ WIN_HTTP_CLIENT
+ };
+
+ namespace HttpMethodMapper
+ {
+ /**
+ * Gets the string value of an httpMethod.
+ */
+ AWS_CORE_API const char* GetNameForHttpMethod(HttpMethod httpMethod);
+ } // namespace HttpMethodMapper
+
+ typedef std::pair<Aws::String, Aws::String> HeaderValuePair;
+ typedef Aws::Map<Aws::String, Aws::String> HeaderValueCollection;
+
+ } // namespace Http
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/Scheme.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/Scheme.h
index 6c1dfa8a2e..a0ec88ad16 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/Scheme.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/Scheme.h
@@ -2,37 +2,37 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace Http
- {
- /**
- * Enum representing URI scheme.
- */
- enum class Scheme
- {
- HTTP,
- HTTPS
- };
-
- namespace SchemeMapper
- {
- /**
- * Converts a Scheme instance to a String.
- */
- AWS_CORE_API const char* ToString(Scheme scheme);
- /**
- * Converts a string instance to a Scheme. Defaults to https.
- */
- AWS_CORE_API Scheme FromString(const char* name);
- } // namespace SchemeMapper
- } // namespace Http
-} // namespace Aws
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace Http
+ {
+ /**
+ * Enum representing URI scheme.
+ */
+ enum class Scheme
+ {
+ HTTP,
+ HTTPS
+ };
+
+ namespace SchemeMapper
+ {
+ /**
+ * Converts a Scheme instance to a String.
+ */
+ AWS_CORE_API const char* ToString(Scheme scheme);
+ /**
+ * Converts a string instance to a Scheme. Defaults to https.
+ */
+ AWS_CORE_API Scheme FromString(const char* name);
+ } // namespace SchemeMapper
+ } // namespace Http
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/URI.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/URI.h
index 45879bb0c5..d72e96b863 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/URI.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/URI.h
@@ -2,170 +2,170 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/http/Scheme.h>
-#include <aws/core/utils/memory/stl/AWSMap.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-#include <stdint.h>
-
-namespace Aws
-{
- namespace Http
- {
- extern AWS_CORE_API const char* SEPARATOR;
- static const uint16_t HTTP_DEFAULT_PORT = 80;
- static const uint16_t HTTPS_DEFAULT_PORT = 443;
-
- //per https://tools.ietf.org/html/rfc3986#section-3.4 there is nothing preventing servers from allowing
- //multiple values for the same key. So use a multimap instead of a map.
- typedef Aws::MultiMap<Aws::String, Aws::String> QueryStringParameterCollection;
-
- /**
- * class modeling universal resource identifier, but implemented for http
- */
- class AWS_CORE_API URI
- {
- public:
- /**
- * Defaults to http and port 80
- */
- URI();
- /**
- * Parses string and sets uri fields
- */
- URI(const Aws::String&);
- /**
- * Parses string and sets uri fields
- */
- URI(const char*);
-
- URI& operator = (const Aws::String&);
- URI& operator = (const char*);
-
- bool operator == (const URI&) const;
- bool operator == (const Aws::String&) const;
- bool operator == (const char*) const;
- bool operator != (const URI&) const;
- bool operator != (const Aws::String&) const;
- bool operator != (const char*) const;
-
- /**
- * scheme or protocol e.g. http, https, ftp
- */
- inline Scheme GetScheme() const { return m_scheme; }
-
- /**
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/http/Scheme.h>
+#include <aws/core/utils/memory/stl/AWSMap.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+#include <stdint.h>
+
+namespace Aws
+{
+ namespace Http
+ {
+ extern AWS_CORE_API const char* SEPARATOR;
+ static const uint16_t HTTP_DEFAULT_PORT = 80;
+ static const uint16_t HTTPS_DEFAULT_PORT = 443;
+
+ //per https://tools.ietf.org/html/rfc3986#section-3.4 there is nothing preventing servers from allowing
+ //multiple values for the same key. So use a multimap instead of a map.
+ typedef Aws::MultiMap<Aws::String, Aws::String> QueryStringParameterCollection;
+
+ /**
+ * class modeling universal resource identifier, but implemented for http
+ */
+ class AWS_CORE_API URI
+ {
+ public:
+ /**
+ * Defaults to http and port 80
+ */
+ URI();
+ /**
+ * Parses string and sets uri fields
+ */
+ URI(const Aws::String&);
+ /**
+ * Parses string and sets uri fields
+ */
+ URI(const char*);
+
+ URI& operator = (const Aws::String&);
+ URI& operator = (const char*);
+
+ bool operator == (const URI&) const;
+ bool operator == (const Aws::String&) const;
+ bool operator == (const char*) const;
+ bool operator != (const URI&) const;
+ bool operator != (const Aws::String&) const;
+ bool operator != (const char*) const;
+
+ /**
+ * scheme or protocol e.g. http, https, ftp
+ */
+ inline Scheme GetScheme() const { return m_scheme; }
+
+ /**
* Sets scheme, if the port is incompatible with this scheme, the port will automatically be set as well.
- */
- void SetScheme(Scheme value);
-
- /**
- * Gets the domain portion of the uri
- */
- inline const Aws::String& GetAuthority() const { return m_authority; }
-
- /**
- * Sets the domain portion of the uri
- */
- inline void SetAuthority(const Aws::String& value) { m_authority = value; }
-
- /**
- * Gets the port portion of the uri, defaults to 22 for ftp, 80 for http and 443 for https
- */
- inline uint16_t GetPort() const { return m_port; }
-
- /**
- * Sets the port portion of the uri, normally you will not have to do this. If the scheme is set to ftp, http
- * or https then the default ports will be set.
- */
- inline void SetPort(uint16_t value) { m_port = value; }
-
- /**
- * Gets the path portion of the uri e.g. the portion after the first slash after the authority and prior to the
- * query string. This is not url encoded.
- */
- inline const Aws::String& GetPath() const { return m_path; }
-
- /**
- * Gets the path portion of the uri, url encodes it and returns it
- */
- inline Aws::String GetURLEncodedPath() const { return URLEncodePath(m_path); }
-
- /**
- * Sets the path portion of the uri. URL encodes it if needed
- */
- void SetPath(const Aws::String& value);
-
- /**
- * Gets the raw query string including the ?
- */
- inline const Aws::String& GetQueryString() const { return m_queryString; }
-
- /**
- * Resets the query string to the raw string. all query string manipulations made before this call will be lost
- */
- void SetQueryString(const Aws::String& str);
-
- Aws::String GetFormParameters() const;
-
- /**
+ */
+ void SetScheme(Scheme value);
+
+ /**
+ * Gets the domain portion of the uri
+ */
+ inline const Aws::String& GetAuthority() const { return m_authority; }
+
+ /**
+ * Sets the domain portion of the uri
+ */
+ inline void SetAuthority(const Aws::String& value) { m_authority = value; }
+
+ /**
+ * Gets the port portion of the uri, defaults to 22 for ftp, 80 for http and 443 for https
+ */
+ inline uint16_t GetPort() const { return m_port; }
+
+ /**
+ * Sets the port portion of the uri, normally you will not have to do this. If the scheme is set to ftp, http
+ * or https then the default ports will be set.
+ */
+ inline void SetPort(uint16_t value) { m_port = value; }
+
+ /**
+ * Gets the path portion of the uri e.g. the portion after the first slash after the authority and prior to the
+ * query string. This is not url encoded.
+ */
+ inline const Aws::String& GetPath() const { return m_path; }
+
+ /**
+ * Gets the path portion of the uri, url encodes it and returns it
+ */
+ inline Aws::String GetURLEncodedPath() const { return URLEncodePath(m_path); }
+
+ /**
+ * Sets the path portion of the uri. URL encodes it if needed
+ */
+ void SetPath(const Aws::String& value);
+
+ /**
+ * Gets the raw query string including the ?
+ */
+ inline const Aws::String& GetQueryString() const { return m_queryString; }
+
+ /**
+ * Resets the query string to the raw string. all query string manipulations made before this call will be lost
+ */
+ void SetQueryString(const Aws::String& str);
+
+ Aws::String GetFormParameters() const;
+
+ /**
* Canonicalizes the query string.
- */
- void CanonicalizeQueryString();
-
- /**
- * parses query string and returns url decoded key/value mappings from it. Spaces and all url encoded
- * values will not be encoded.
- */
- QueryStringParameterCollection GetQueryStringParameters(bool decode = true) const;
-
- /**
- * Adds query string parameter to underlying query string.
- */
- void AddQueryStringParameter(const char* key, const Aws::String& value);
-
- /**
- * Adds multiple query string parameters to underlying query string.
- */
- void AddQueryStringParameter(const Aws::Map<Aws::String, Aws::String>& queryStringPairs);
-
- /**
- * Converts the URI to a String usable for its context. e.g. an http request.
- */
- Aws::String GetURIString(bool includeQueryString = true) const;
-
- /**
- * URLEncodes the path portions of path (doesn't encode the "/" portion)
+ */
+ void CanonicalizeQueryString();
+
+ /**
+ * parses query string and returns url decoded key/value mappings from it. Spaces and all url encoded
+ * values will not be encoded.
+ */
+ QueryStringParameterCollection GetQueryStringParameters(bool decode = true) const;
+
+ /**
+ * Adds query string parameter to underlying query string.
+ */
+ void AddQueryStringParameter(const char* key, const Aws::String& value);
+
+ /**
+ * Adds multiple query string parameters to underlying query string.
+ */
+ void AddQueryStringParameter(const Aws::Map<Aws::String, Aws::String>& queryStringPairs);
+
+ /**
+ * Converts the URI to a String usable for its context. e.g. an http request.
+ */
+ Aws::String GetURIString(bool includeQueryString = true) const;
+
+ /**
+ * URLEncodes the path portions of path (doesn't encode the "/" portion)
* Keeps the first and the last "/".
- */
- static Aws::String URLEncodePath(const Aws::String& path);
-
- /**
- * URLEncodes the path portion of the URI according to RFC3986
- */
- static Aws::String URLEncodePathRFC3986(const Aws::String& path);
-
- private:
- void ParseURIParts(const Aws::String& uri);
- void ExtractAndSetScheme(const Aws::String& uri);
- void ExtractAndSetAuthority(const Aws::String& uri);
- void ExtractAndSetPort(const Aws::String& uri);
- void ExtractAndSetPath(const Aws::String& uri);
- void ExtractAndSetQueryString(const Aws::String& uri);
- bool CompareURIParts(const URI& other) const;
-
- Scheme m_scheme;
- Aws::String m_authority;
- uint16_t m_port;
- Aws::String m_path;
- Aws::String m_queryString;
- };
-
- } // namespace Http
-} // namespace Aws
-
+ */
+ static Aws::String URLEncodePath(const Aws::String& path);
+
+ /**
+ * URLEncodes the path portion of the URI according to RFC3986
+ */
+ static Aws::String URLEncodePathRFC3986(const Aws::String& path);
+
+ private:
+ void ParseURIParts(const Aws::String& uri);
+ void ExtractAndSetScheme(const Aws::String& uri);
+ void ExtractAndSetAuthority(const Aws::String& uri);
+ void ExtractAndSetPort(const Aws::String& uri);
+ void ExtractAndSetPath(const Aws::String& uri);
+ void ExtractAndSetQueryString(const Aws::String& uri);
+ bool CompareURIParts(const URI& other) const;
+
+ Scheme m_scheme;
+ Aws::String m_authority;
+ uint16_t m_port;
+ Aws::String m_path;
+ Aws::String m_queryString;
+ };
+
+ } // namespace Http
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHandleContainer.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHandleContainer.h
index 22d2a61955..c2745753eb 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHandleContainer.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHandleContainer.h
@@ -2,73 +2,73 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/utils/ResourceManager.h>
-
-#include <utility>
-#include <curl/curl.h>
-
-namespace Aws
-{
-namespace Http
-{
-
-/**
- * Simple Connection pool manager for Curl. It maintains connections in a thread safe manner. You
- * can call into acquire a handle, then put it back when finished. It is assumed that reusing an already
- * initialized handle is preferable (especially for synchronous clients). The pool doubles in capacity as
- * needed up to the maximum amount of connections.
- */
-class CurlHandleContainer
-{
-public:
- /**
- * Initializes an empty stack of CURL handles. If you are only making synchronous calls via your http client
- * then a small size is best. For async support, a good value would be 6 * number of Processors. *
- */
+
+#pragma once
+
+#include <aws/core/utils/ResourceManager.h>
+
+#include <utility>
+#include <curl/curl.h>
+
+namespace Aws
+{
+namespace Http
+{
+
+/**
+ * Simple Connection pool manager for Curl. It maintains connections in a thread safe manner. You
+ * can call into acquire a handle, then put it back when finished. It is assumed that reusing an already
+ * initialized handle is preferable (especially for synchronous clients). The pool doubles in capacity as
+ * needed up to the maximum amount of connections.
+ */
+class CurlHandleContainer
+{
+public:
+ /**
+ * Initializes an empty stack of CURL handles. If you are only making synchronous calls via your http client
+ * then a small size is best. For async support, a good value would be 6 * number of Processors. *
+ */
CurlHandleContainer(unsigned maxSize = 50, long httpRequestTimeout = 0, long connectTimeout = 1000, bool tcpKeepAlive = true,
unsigned long tcpKeepAliveIntervalMs = 30000, long lowSpeedTime = 3000, unsigned long lowSpeedLimit = 1);
- ~CurlHandleContainer();
-
- /**
- * Blocks until a curl handle from the pool is available for use.
- */
- CURL* AcquireCurlHandle();
- /**
- * Returns a handle to the pool for reuse. It is imperative that this is called
- * after you are finished with the handle.
- */
- void ReleaseCurlHandle(CURL* handle);
-
+ ~CurlHandleContainer();
+
+ /**
+ * Blocks until a curl handle from the pool is available for use.
+ */
+ CURL* AcquireCurlHandle();
+ /**
+ * Returns a handle to the pool for reuse. It is imperative that this is called
+ * after you are finished with the handle.
+ */
+ void ReleaseCurlHandle(CURL* handle);
+
/**
* When the handle has bad DNS entries, problematic live connections, we need to destory the handle from pool.
*/
void DestroyCurlHandle(CURL* handle);
-private:
- CurlHandleContainer(const CurlHandleContainer&) = delete;
- const CurlHandleContainer& operator = (const CurlHandleContainer&) = delete;
- CurlHandleContainer(const CurlHandleContainer&&) = delete;
- const CurlHandleContainer& operator = (const CurlHandleContainer&&) = delete;
-
+private:
+ CurlHandleContainer(const CurlHandleContainer&) = delete;
+ const CurlHandleContainer& operator = (const CurlHandleContainer&) = delete;
+ CurlHandleContainer(const CurlHandleContainer&&) = delete;
+ const CurlHandleContainer& operator = (const CurlHandleContainer&&) = delete;
+
CURL* CreateCurlHandleInPool();
- bool CheckAndGrowPool();
- void SetDefaultOptionsOnHandle(CURL* handle);
-
- Aws::Utils::ExclusiveOwnershipResourceManager<CURL*> m_handleContainer;
- unsigned m_maxPoolSize;
+ bool CheckAndGrowPool();
+ void SetDefaultOptionsOnHandle(CURL* handle);
+
+ Aws::Utils::ExclusiveOwnershipResourceManager<CURL*> m_handleContainer;
+ unsigned m_maxPoolSize;
unsigned long m_httpRequestTimeout;
- unsigned long m_connectTimeout;
+ unsigned long m_connectTimeout;
bool m_enableTcpKeepAlive;
unsigned long m_tcpKeepAliveIntervalMs;
unsigned long m_lowSpeedTime;
unsigned long m_lowSpeedLimit;
- unsigned m_poolSize;
- std::mutex m_containerLock;
-};
-
-} // namespace Http
-} // namespace Aws
-
+ unsigned m_poolSize;
+ std::mutex m_containerLock;
+};
+
+} // namespace Http
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h
index 9f174b9b26..31f96befd5 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h
@@ -2,44 +2,44 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/http/HttpClient.h>
-#include <aws/core/http/curl/CurlHandleContainer.h>
-#include <aws/core/client/ClientConfiguration.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <atomic>
-
-namespace Aws
-{
-namespace Http
-{
-namespace Standard
-{
- class StandardHttpResponse;
-}
-
-//Curl implementation of an http client. Right now it is only synchronous.
-class AWS_CORE_API CurlHttpClient: public HttpClient
-{
-public:
-
- using Base = HttpClient;
-
- //Creates client, initializes curl handle if it hasn't been created already.
- CurlHttpClient(const Aws::Client::ClientConfiguration& clientConfig);
- //Makes request and receives response synchronously
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/http/HttpClient.h>
+#include <aws/core/http/curl/CurlHandleContainer.h>
+#include <aws/core/client/ClientConfiguration.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <atomic>
+
+namespace Aws
+{
+namespace Http
+{
+namespace Standard
+{
+ class StandardHttpResponse;
+}
+
+//Curl implementation of an http client. Right now it is only synchronous.
+class AWS_CORE_API CurlHttpClient: public HttpClient
+{
+public:
+
+ using Base = HttpClient;
+
+ //Creates client, initializes curl handle if it hasn't been created already.
+ CurlHttpClient(const Aws::Client::ClientConfiguration& clientConfig);
+
+ //Makes request and receives response synchronously
std::shared_ptr<HttpResponse> MakeRequest(const std::shared_ptr<HttpRequest>& request,
Aws::Utils::RateLimits::RateLimiterInterface* readLimiter = nullptr,
Aws::Utils::RateLimits::RateLimiterInterface* writeLimiter = nullptr) const override;
-
- static void InitGlobalState();
- static void CleanupGlobalState();
-
+
+ static void InitGlobalState();
+ static void CleanupGlobalState();
+
protected:
/**
* Override any configuration on CURL handle for each request before sending.
@@ -47,31 +47,31 @@ protected:
*/
virtual void OverrideOptionsOnConnectionHandle(CURL*) const {}
-private:
- mutable CurlHandleContainer m_curlHandleContainer;
- bool m_isUsingProxy;
- Aws::String m_proxyUserName;
- Aws::String m_proxyPassword;
- Aws::String m_proxyScheme;
- Aws::String m_proxyHost;
+private:
+ mutable CurlHandleContainer m_curlHandleContainer;
+ bool m_isUsingProxy;
+ Aws::String m_proxyUserName;
+ Aws::String m_proxyPassword;
+ Aws::String m_proxyScheme;
+ Aws::String m_proxyHost;
Aws::String m_proxySSLCertPath;
Aws::String m_proxySSLCertType;
Aws::String m_proxySSLKeyPath;
Aws::String m_proxySSLKeyType;
Aws::String m_proxyKeyPasswd;
- unsigned m_proxyPort;
- bool m_verifySSL;
- Aws::String m_caPath;
- Aws::String m_caFile;
+ unsigned m_proxyPort;
+ bool m_verifySSL;
+ Aws::String m_caPath;
+ Aws::String m_caFile;
Aws::String m_proxyCaPath;
Aws::String m_proxyCaFile;
- bool m_disableExpectHeader;
- bool m_allowRedirects;
- static std::atomic<bool> isInit;
-};
-
-using PlatformHttpClient = CurlHttpClient;
-
-} // namespace Http
-} // namespace Aws
-
+ bool m_disableExpectHeader;
+ bool m_allowRedirects;
+ static std::atomic<bool> isInit;
+};
+
+using PlatformHttpClient = CurlHttpClient;
+
+} // namespace Http
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpRequest.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpRequest.h
index 3848f60765..c9c0016ef5 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpRequest.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpRequest.h
@@ -2,88 +2,88 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/http/HttpRequest.h>
-#include <aws/core/utils/memory/stl/AWSMap.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace Http
- {
- namespace Standard
- {
- /**
- * Simple STL container modeling of HttpRequest. Implementation of the HttpRequest interface.
- */
- class AWS_CORE_API StandardHttpRequest : public HttpRequest
- {
- public:
- /**
- * Initializes an HttpRequest object with uri and http method.
- */
- StandardHttpRequest(const URI& uri, HttpMethod method);
-
- /**
- * Get All headers for this request.
- */
- virtual HeaderValueCollection GetHeaders() const override;
- /**
- * Get the value for a Header based on its name.
- * This function doesn't check the existence of headerName.
- * So make sure you call HasHeader() first before calling this function, otherwise the behavior is undefined.
- */
- virtual const Aws::String& GetHeaderValue(const char* headerName) const override;
- /**
- * Add a header pair
- */
- virtual void SetHeaderValue(const char* headerName, const Aws::String& headerValue) override;
- /**
- * Add a header pair
- */
- virtual void SetHeaderValue(const Aws::String& headerName, const Aws::String& headerValue) override;
- /**
- * delete pair by headerName
- */
- virtual void DeleteHeader(const char* headerName) override;
- /**
- * Adds a content body stream to the request. This stream will be used to send the body to the endpoint.
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/http/HttpRequest.h>
+#include <aws/core/utils/memory/stl/AWSMap.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace Http
+ {
+ namespace Standard
+ {
+ /**
+ * Simple STL container modeling of HttpRequest. Implementation of the HttpRequest interface.
+ */
+ class AWS_CORE_API StandardHttpRequest : public HttpRequest
+ {
+ public:
+ /**
+ * Initializes an HttpRequest object with uri and http method.
+ */
+ StandardHttpRequest(const URI& uri, HttpMethod method);
+
+ /**
+ * Get All headers for this request.
+ */
+ virtual HeaderValueCollection GetHeaders() const override;
+ /**
+ * Get the value for a Header based on its name.
+ * This function doesn't check the existence of headerName.
+ * So make sure you call HasHeader() first before calling this function, otherwise the behavior is undefined.
*/
- virtual inline void AddContentBody(const std::shared_ptr<Aws::IOStream>& strContent) override { bodyStream = strContent; }
- /**
- * Gets the content body stream that will be used for this request.
- */
- virtual inline const std::shared_ptr<Aws::IOStream>& GetContentBody() const override { return bodyStream; }
- /**
- * Returns true if a header exists in the request with name
- */
- virtual bool HasHeader(const char*) const override;
- /**
- * Get size in bytes of the request when as it will be going accross the wire.
- */
- virtual int64_t GetSize() const override;
- /**
- * Gets the factory for creating the stream that will be used in the http response.
- */
- virtual const Aws::IOStreamFactory& GetResponseStreamFactory() const override;
- /**
- * Sets the factory for creating the stream that will be used in the http response.
- */
- virtual void SetResponseStreamFactory(const Aws::IOStreamFactory& factory) override;
-
- private:
- HeaderValueCollection headerMap;
- std::shared_ptr<Aws::IOStream> bodyStream;
- Aws::IOStreamFactory m_responseStreamFactory;
- Aws::String m_emptyHeader;
- };
-
- } // namespace Standard
- } // namespace Http
-} // namespace Aws
-
-
+ virtual const Aws::String& GetHeaderValue(const char* headerName) const override;
+ /**
+ * Add a header pair
+ */
+ virtual void SetHeaderValue(const char* headerName, const Aws::String& headerValue) override;
+ /**
+ * Add a header pair
+ */
+ virtual void SetHeaderValue(const Aws::String& headerName, const Aws::String& headerValue) override;
+ /**
+ * delete pair by headerName
+ */
+ virtual void DeleteHeader(const char* headerName) override;
+ /**
+ * Adds a content body stream to the request. This stream will be used to send the body to the endpoint.
+ */
+ virtual inline void AddContentBody(const std::shared_ptr<Aws::IOStream>& strContent) override { bodyStream = strContent; }
+ /**
+ * Gets the content body stream that will be used for this request.
+ */
+ virtual inline const std::shared_ptr<Aws::IOStream>& GetContentBody() const override { return bodyStream; }
+ /**
+ * Returns true if a header exists in the request with name
+ */
+ virtual bool HasHeader(const char*) const override;
+ /**
+ * Get size in bytes of the request when as it will be going accross the wire.
+ */
+ virtual int64_t GetSize() const override;
+ /**
+ * Gets the factory for creating the stream that will be used in the http response.
+ */
+ virtual const Aws::IOStreamFactory& GetResponseStreamFactory() const override;
+ /**
+ * Sets the factory for creating the stream that will be used in the http response.
+ */
+ virtual void SetResponseStreamFactory(const Aws::IOStreamFactory& factory) override;
+
+ private:
+ HeaderValueCollection headerMap;
+ std::shared_ptr<Aws::IOStream> bodyStream;
+ Aws::IOStreamFactory m_responseStreamFactory;
+ Aws::String m_emptyHeader;
+ };
+
+ } // namespace Standard
+ } // namespace Http
+} // namespace Aws
+
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpResponse.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpResponse.h
index 80de073684..309206f1f3 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpResponse.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/standard/StandardHttpResponse.h
@@ -2,73 +2,73 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/http/HttpResponse.h>
-#include <aws/core/utils/memory/stl/AWSMap.h>
-#include <aws/core/utils/stream/ResponseStream.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace Http
- {
- namespace Standard
- {
- /**
- * Simple STL representation an Http Response, implements HttpResponse.
- */
- class AWS_CORE_API StandardHttpResponse : public HttpResponse
- {
- public:
- /**
- * Initializes an http response with the originalRequest and the response code.
- */
- StandardHttpResponse(const std::shared_ptr<const HttpRequest>& originatingRequest) :
- HttpResponse(originatingRequest),
- bodyStream(originatingRequest->GetResponseStreamFactory())
- {}
-
- ~StandardHttpResponse() = default;
-
- /**
- * Get the headers from this response
- */
- HeaderValueCollection GetHeaders() const;
- /**
- * Returns true if the response contains a header by headerName
- */
- bool HasHeader(const char* headerName) const;
- /**
- * Returns the value for a header at headerName if it exists.
- */
- const Aws::String& GetHeader(const Aws::String&) const;
- /**
- * Gets the response body of the response.
- */
- inline Aws::IOStream& GetResponseBody() const { return bodyStream.GetUnderlyingStream(); }
- /**
- * Gives full control of the memory of the ResponseBody over to the caller. At this point, it is the caller's
- * responsibility to clean up this object.
- */
- inline Utils::Stream::ResponseStream&& SwapResponseStreamOwnership() { return std::move(bodyStream); }
- /**
- * Adds a header to the http response object.
- */
- void AddHeader(const Aws::String&, const Aws::String&);
-
- private:
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/http/HttpResponse.h>
+#include <aws/core/utils/memory/stl/AWSMap.h>
+#include <aws/core/utils/stream/ResponseStream.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace Http
+ {
+ namespace Standard
+ {
+ /**
+ * Simple STL representation an Http Response, implements HttpResponse.
+ */
+ class AWS_CORE_API StandardHttpResponse : public HttpResponse
+ {
+ public:
+ /**
+ * Initializes an http response with the originalRequest and the response code.
+ */
+ StandardHttpResponse(const std::shared_ptr<const HttpRequest>& originatingRequest) :
+ HttpResponse(originatingRequest),
+ bodyStream(originatingRequest->GetResponseStreamFactory())
+ {}
+
+ ~StandardHttpResponse() = default;
+
+ /**
+ * Get the headers from this response
+ */
+ HeaderValueCollection GetHeaders() const;
+ /**
+ * Returns true if the response contains a header by headerName
+ */
+ bool HasHeader(const char* headerName) const;
+ /**
+ * Returns the value for a header at headerName if it exists.
+ */
+ const Aws::String& GetHeader(const Aws::String&) const;
+ /**
+ * Gets the response body of the response.
+ */
+ inline Aws::IOStream& GetResponseBody() const { return bodyStream.GetUnderlyingStream(); }
+ /**
+ * Gives full control of the memory of the ResponseBody over to the caller. At this point, it is the caller's
+ * responsibility to clean up this object.
+ */
+ inline Utils::Stream::ResponseStream&& SwapResponseStreamOwnership() { return std::move(bodyStream); }
+ /**
+ * Adds a header to the http response object.
+ */
+ void AddHeader(const Aws::String&, const Aws::String&);
+
+ private:
StandardHttpResponse(const StandardHttpResponse&);
-
- Aws::Map<Aws::String, Aws::String> headerMap;
- Utils::Stream::ResponseStream bodyStream;
- };
-
- } // namespace Standard
- } // namespace Http
-} // namespace Aws
-
-
+
+ Aws::Map<Aws::String, Aws::String> headerMap;
+ Utils::Stream::ResponseStream bodyStream;
+ };
+
+ } // namespace Standard
+ } // namespace Http
+} // namespace Aws
+
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h
index 4d879fc314..c58a1b70bf 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h
@@ -2,61 +2,61 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/AWSMemory.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/client/ClientConfiguration.h>
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/AWSMemory.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/client/ClientConfiguration.h>
#include <aws/core/client/AWSErrorMarshaller.h>
#include <aws/core/auth/AWSCredentials.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/DateTime.h>
-#include <memory>
+#include <memory>
#include <mutex>
-namespace Aws
-{
- namespace Http
- {
- class HttpClient;
+namespace Aws
+{
+ namespace Http
+ {
+ class HttpClient;
class HttpRequest;
enum class HttpResponseCode;
- } // namespace Http
-
- namespace Internal
- {
- /**
- * Simple client for accessing the AWS remote data by Http.
- * Currently we use it to access EC2 Metadata and ECS Credential.
- */
- class AWS_CORE_API AWSHttpResourceClient
- {
- public:
- /**
- * Builds an AWSHttpResourceClient instance by using default http stack.
- */
- AWSHttpResourceClient(const char* logtag = "AWSHttpResourceClient");
- AWSHttpResourceClient(const Client::ClientConfiguration& clientConfiguration, const char* logtag = "AWSHttpResourceClient");
-
- AWSHttpResourceClient& operator =(const AWSHttpResourceClient& rhs) = delete;
- AWSHttpResourceClient(const AWSHttpResourceClient& rhs) = delete;
- AWSHttpResourceClient& operator =(const AWSHttpResourceClient&& rhs) = delete;
- AWSHttpResourceClient(const AWSHttpResourceClient&& rhs) = delete;
-
- virtual ~AWSHttpResourceClient();
-
- /**
- * Connects to an HTTP endpoint to read the specified resource and returns the text contents.
- * The resource URI = endpoint + resourcePath (e.g:http://domain/path/to/res)
- * @param endpoint The HTTP resource to connect to.
- * @param resourcePath A path appended to the endpoint to form the final URI.
- * @param authToken An optional authorization token that will be passed as the value of the HTTP
- * header 'Authorization'.
- * @return The response from the HTTP endpoint as a string.
- */
- virtual Aws::String GetResource(const char* endpoint, const char* resourcePath, const char* authToken) const;
-
+ } // namespace Http
+
+ namespace Internal
+ {
+ /**
+ * Simple client for accessing the AWS remote data by Http.
+ * Currently we use it to access EC2 Metadata and ECS Credential.
+ */
+ class AWS_CORE_API AWSHttpResourceClient
+ {
+ public:
+ /**
+ * Builds an AWSHttpResourceClient instance by using default http stack.
+ */
+ AWSHttpResourceClient(const char* logtag = "AWSHttpResourceClient");
+ AWSHttpResourceClient(const Client::ClientConfiguration& clientConfiguration, const char* logtag = "AWSHttpResourceClient");
+
+ AWSHttpResourceClient& operator =(const AWSHttpResourceClient& rhs) = delete;
+ AWSHttpResourceClient(const AWSHttpResourceClient& rhs) = delete;
+ AWSHttpResourceClient& operator =(const AWSHttpResourceClient&& rhs) = delete;
+ AWSHttpResourceClient(const AWSHttpResourceClient&& rhs) = delete;
+
+ virtual ~AWSHttpResourceClient();
+
+ /**
+ * Connects to an HTTP endpoint to read the specified resource and returns the text contents.
+ * The resource URI = endpoint + resourcePath (e.g:http://domain/path/to/res)
+ * @param endpoint The HTTP resource to connect to.
+ * @param resourcePath A path appended to the endpoint to form the final URI.
+ * @param authToken An optional authorization token that will be passed as the value of the HTTP
+ * header 'Authorization'.
+ * @return The response from the HTTP endpoint as a string.
+ */
+ virtual Aws::String GetResource(const char* endpoint, const char* resourcePath, const char* authToken) const;
+
/**
* Connects to an HTTP endpoint to read the specified resource and returns the text contents.
* The resource URI = endpoint + resourcePath (e.g:http://domain/path/to/res)
@@ -82,107 +82,107 @@ namespace Aws
void SetErrorMarshaller(Aws::UniquePtr<Client::AWSErrorMarshaller> errorMarshaller) { m_errorMarshaller = std::move(errorMarshaller); }
const Client::AWSErrorMarshaller* GetErrorMarshaller() const { return m_errorMarshaller.get(); }
- protected:
- Aws::String m_logtag;
-
- private:
- std::shared_ptr<Client::RetryStrategy> m_retryStrategy;
- std::shared_ptr<Http::HttpClient> m_httpClient;
+ protected:
+ Aws::String m_logtag;
+
+ private:
+ std::shared_ptr<Client::RetryStrategy> m_retryStrategy;
+ std::shared_ptr<Http::HttpClient> m_httpClient;
Aws::UniquePtr<Client::AWSErrorMarshaller> m_errorMarshaller;
- };
-
- /**
- * Derived class to support retrieving of EC2 Metadata
- */
- class AWS_CORE_API EC2MetadataClient : public AWSHttpResourceClient
- {
- public:
- /**
- * Build an instance with default EC2 Metadata service endpoint
- */
- EC2MetadataClient(const char* endpoint = "http://169.254.169.254");
- EC2MetadataClient(const Client::ClientConfiguration& clientConfiguration, const char* endpoint = "http://169.254.169.254");
-
- EC2MetadataClient& operator =(const EC2MetadataClient& rhs) = delete;
- EC2MetadataClient(const EC2MetadataClient& rhs) = delete;
- EC2MetadataClient& operator =(const EC2MetadataClient&& rhs) = delete;
- EC2MetadataClient(const EC2MetadataClient&& rhs) = delete;
-
- virtual ~EC2MetadataClient();
-
- using AWSHttpResourceClient::GetResource;
-
- /**
- * Connects to the metadata service to read the specified resource and
- * returns the text contents. The resource URI = m_endpoint + resourcePath.
- */
- virtual Aws::String GetResource(const char* resourcePath) const;
-
- /**
- * Connects to the Amazon EC2 Instance Metadata Service to retrieve the
- * default credential information (if any).
- */
- virtual Aws::String GetDefaultCredentials() const;
-
- /**
+ };
+
+ /**
+ * Derived class to support retrieving of EC2 Metadata
+ */
+ class AWS_CORE_API EC2MetadataClient : public AWSHttpResourceClient
+ {
+ public:
+ /**
+ * Build an instance with default EC2 Metadata service endpoint
+ */
+ EC2MetadataClient(const char* endpoint = "http://169.254.169.254");
+ EC2MetadataClient(const Client::ClientConfiguration& clientConfiguration, const char* endpoint = "http://169.254.169.254");
+
+ EC2MetadataClient& operator =(const EC2MetadataClient& rhs) = delete;
+ EC2MetadataClient(const EC2MetadataClient& rhs) = delete;
+ EC2MetadataClient& operator =(const EC2MetadataClient&& rhs) = delete;
+ EC2MetadataClient(const EC2MetadataClient&& rhs) = delete;
+
+ virtual ~EC2MetadataClient();
+
+ using AWSHttpResourceClient::GetResource;
+
+ /**
+ * Connects to the metadata service to read the specified resource and
+ * returns the text contents. The resource URI = m_endpoint + resourcePath.
+ */
+ virtual Aws::String GetResource(const char* resourcePath) const;
+
+ /**
+ * Connects to the Amazon EC2 Instance Metadata Service to retrieve the
+ * default credential information (if any).
+ */
+ virtual Aws::String GetDefaultCredentials() const;
+
+ /**
* Connects to the Amazon EC2 Instance Metadata Service to retrieve the
* credential information (if any) in a more secure way.
*/
virtual Aws::String GetDefaultCredentialsSecurely() const;
/**
- * connects to the Amazon EC2 Instance metadata Service to retrieve the region
- * the current EC2 instance is running in.
- */
- virtual Aws::String GetCurrentRegion() const;
-
- private:
- Aws::String m_endpoint;
+ * connects to the Amazon EC2 Instance metadata Service to retrieve the region
+ * the current EC2 instance is running in.
+ */
+ virtual Aws::String GetCurrentRegion() const;
+
+ private:
+ Aws::String m_endpoint;
mutable std::recursive_mutex m_tokenMutex;
mutable Aws::String m_token;
mutable bool m_tokenRequired;
mutable Aws::String m_region;
- };
-
+ };
+
void AWS_CORE_API InitEC2MetadataClient();
void AWS_CORE_API CleanupEC2MetadataClient();
std::shared_ptr<EC2MetadataClient> AWS_CORE_API GetEC2MetadataClient();
- /**
+ /**
* Derived class to support retrieving of ECS Credentials
- */
- class AWS_CORE_API ECSCredentialsClient : public AWSHttpResourceClient
- {
- public:
- /**
- * Build an instance with default ECS service endpoint
- * @param resourcePath The path part of the metadata URL
- * @param endpoint The URL authority to hit. Default is the IP address of the Task metadata service endpoint.
- */
- ECSCredentialsClient(const char* resourcePath, const char* endpoint = "http://169.254.170.2",
- const char* authToken = "");
- ECSCredentialsClient(const Client::ClientConfiguration& clientConfiguration,
- const char* resourcePath, const char* endpoint = "http://169.254.170.2",
- const char* authToken = "");
-
- ECSCredentialsClient& operator =(ECSCredentialsClient& rhs) = delete;
- ECSCredentialsClient(const ECSCredentialsClient& rhs) = delete;
- ECSCredentialsClient& operator =(ECSCredentialsClient&& rhs) = delete;
- ECSCredentialsClient(const ECSCredentialsClient&& rhs) = delete;
-
- /**
- * Connects to the Amazon ECS service to retrieve the credential
- */
- virtual Aws::String GetECSCredentials() const
- {
- return GetResource(m_endpoint.c_str(), m_resourcePath.c_str(), m_token.c_str());
- }
-
- private:
- Aws::String m_resourcePath;
- Aws::String m_endpoint;
- Aws::String m_token;
- };
+ */
+ class AWS_CORE_API ECSCredentialsClient : public AWSHttpResourceClient
+ {
+ public:
+ /**
+ * Build an instance with default ECS service endpoint
+ * @param resourcePath The path part of the metadata URL
+ * @param endpoint The URL authority to hit. Default is the IP address of the Task metadata service endpoint.
+ */
+ ECSCredentialsClient(const char* resourcePath, const char* endpoint = "http://169.254.170.2",
+ const char* authToken = "");
+ ECSCredentialsClient(const Client::ClientConfiguration& clientConfiguration,
+ const char* resourcePath, const char* endpoint = "http://169.254.170.2",
+ const char* authToken = "");
+
+ ECSCredentialsClient& operator =(ECSCredentialsClient& rhs) = delete;
+ ECSCredentialsClient(const ECSCredentialsClient& rhs) = delete;
+ ECSCredentialsClient& operator =(ECSCredentialsClient&& rhs) = delete;
+ ECSCredentialsClient(const ECSCredentialsClient&& rhs) = delete;
+
+ /**
+ * Connects to the Amazon ECS service to retrieve the credential
+ */
+ virtual Aws::String GetECSCredentials() const
+ {
+ return GetResource(m_endpoint.c_str(), m_resourcePath.c_str(), m_token.c_str());
+ }
+
+ private:
+ Aws::String m_resourcePath;
+ Aws::String m_endpoint;
+ Aws::String m_token;
+ };
/**
* To support retrieving credentials from STS.
@@ -221,5 +221,5 @@ namespace Aws
private:
Aws::String m_endpoint;
};
- } // namespace Internal
-} // namespace Aws
+ } // namespace Internal
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/CoreMetrics.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/CoreMetrics.h
index 409ab147fd..575a6003e2 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/CoreMetrics.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/CoreMetrics.h
@@ -1,27 +1,27 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/monitoring/HttpClientMetrics.h>
-
-namespace Aws
-{
- namespace Monitoring
- {
- /**
- * Metrics collected from AWS SDK Core include Http Client Metrics and other types of metrics.
- */
- struct AWS_CORE_API CoreMetricsCollection
- {
- /**
+ */
+
+#pragma once
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/monitoring/HttpClientMetrics.h>
+
+namespace Aws
+{
+ namespace Monitoring
+ {
+ /**
+ * Metrics collected from AWS SDK Core include Http Client Metrics and other types of metrics.
+ */
+ struct AWS_CORE_API CoreMetricsCollection
+ {
+ /**
* Metrics collected from underlying http client during execution of a request
- */
- HttpClientMetricsCollection httpClientMetrics;
-
- // Add Other types of metrics here.
- };
- }
-}
+ */
+ HttpClientMetricsCollection httpClientMetrics;
+
+ // Add Other types of metrics here.
+ };
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/DefaultMonitoring.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/DefaultMonitoring.h
index 1af1edb5db..148a3a23c5 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/DefaultMonitoring.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/DefaultMonitoring.h
@@ -2,72 +2,72 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/client/AWSClient.h>
-#include <aws/core/monitoring/MonitoringInterface.h>
-#include <aws/core/monitoring/MonitoringFactory.h>
-#include <aws/core/net/SimpleUDP.h>
-namespace Aws
-{
- namespace Monitoring
- {
- /**
- * Default monitoring implementation definition
- */
- class AWS_CORE_API DefaultMonitoring: public MonitoringInterface
- {
- public:
- const static int DEFAULT_MONITORING_VERSION;
- const static char DEFAULT_CSM_CONFIG_ENABLED[];
- const static char DEFAULT_CSM_CONFIG_CLIENT_ID[];
+
+#pragma once
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/client/AWSClient.h>
+#include <aws/core/monitoring/MonitoringInterface.h>
+#include <aws/core/monitoring/MonitoringFactory.h>
+#include <aws/core/net/SimpleUDP.h>
+namespace Aws
+{
+ namespace Monitoring
+ {
+ /**
+ * Default monitoring implementation definition
+ */
+ class AWS_CORE_API DefaultMonitoring: public MonitoringInterface
+ {
+ public:
+ const static int DEFAULT_MONITORING_VERSION;
+ const static char DEFAULT_CSM_CONFIG_ENABLED[];
+ const static char DEFAULT_CSM_CONFIG_CLIENT_ID[];
const static char DEFAULT_CSM_CONFIG_HOST[];
- const static char DEFAULT_CSM_CONFIG_PORT[];
- const static char DEFAULT_CSM_ENVIRONMENT_VAR_ENABLED[];
- const static char DEFAULT_CSM_ENVIRONMENT_VAR_CLIENT_ID[];
+ const static char DEFAULT_CSM_CONFIG_PORT[];
+ const static char DEFAULT_CSM_ENVIRONMENT_VAR_ENABLED[];
+ const static char DEFAULT_CSM_ENVIRONMENT_VAR_CLIENT_ID[];
const static char DEFAULT_CSM_ENVIRONMENT_VAR_HOST[];
- const static char DEFAULT_CSM_ENVIRONMENT_VAR_PORT[];
-
- /**
- * @brief Construct a default monitoring instance
- * @param clientId, used to identify the application
+ const static char DEFAULT_CSM_ENVIRONMENT_VAR_PORT[];
+
+ /**
+ * @brief Construct a default monitoring instance
+ * @param clientId, used to identify the application
* @param host, either the host name or the host ip address (could be ipv4 or ipv6). Note that "localhost" will be treated as host name and address look up will be performed.
- * @param port, used to send collected metric to a local agent listen on this port.
- */
+ * @param port, used to send collected metric to a local agent listen on this port.
+ */
DefaultMonitoring(const Aws::String& clientId, const Aws::String& host, unsigned short port);
-
- void* OnRequestStarted(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request) const override;
-
- void OnRequestSucceeded(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
- const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const override;
-
-
- void OnRequestFailed(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
- const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const override;
-
+
+ void* OnRequestStarted(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request) const override;
+
+ void OnRequestSucceeded(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
+ const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const override;
+
+
+ void OnRequestFailed(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
+ const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const override;
+
void OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName,
- const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const override;
-
-
+ const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const override;
+
+
void OnFinish(const Aws::String& serviceName, const Aws::String& requestName,
- const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const override;
-
- static inline int GetVersion() { return DEFAULT_MONITORING_VERSION; }
- private:
+ const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const override;
+
+ static inline int GetVersion() { return DEFAULT_MONITORING_VERSION; }
+ private:
void CollectAndSendAttemptData(const Aws::String& serviceName, const Aws::String& requestName,
const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Client::HttpResponseOutcome& outcome,
- const CoreMetricsCollection& metricsFromCore, void* context) const;
-
- Aws::Net::SimpleUDP m_udp;
- Aws::String m_clientId;
- };
-
- class AWS_CORE_API DefaultMonitoringFactory : public MonitoringFactory
- {
- public:
- Aws::UniquePtr<MonitoringInterface> CreateMonitoringInstance() const override;
- };
- } // namespace Monitoring
+ const CoreMetricsCollection& metricsFromCore, void* context) const;
+
+ Aws::Net::SimpleUDP m_udp;
+ Aws::String m_clientId;
+ };
+
+ class AWS_CORE_API DefaultMonitoringFactory : public MonitoringFactory
+ {
+ public:
+ Aws::UniquePtr<MonitoringInterface> CreateMonitoringInstance() const override;
+ };
+ } // namespace Monitoring
} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/HttpClientMetrics.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/HttpClientMetrics.h
index 73418dabf5..2c2efa3ed5 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/HttpClientMetrics.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/HttpClientMetrics.h
@@ -1,84 +1,84 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/memory/stl/AWSMap.h>
-
-namespace Aws
-{
- namespace Monitoring
- {
- /**
- * Metrics definitions optional from HttpClient module inside AWS Sdk core.
- */
- enum class HttpClientMetricsType
- {
+ */
+
+#pragma once
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSMap.h>
+
+namespace Aws
+{
+ namespace Monitoring
+ {
+ /**
+ * Metrics definitions optional from HttpClient module inside AWS Sdk core.
+ */
+ enum class HttpClientMetricsType
+ {
/*
- * Requires a successful DNS lookup, contains the (IPv4 or IPv6 as appropriate) numeric address of the connection endpoint to which the attempt was sent.
- */
- DestinationIp = 0,
-
+ * Requires a successful DNS lookup, contains the (IPv4 or IPv6 as appropriate) numeric address of the connection endpoint to which the attempt was sent.
+ */
+ DestinationIp = 0,
+
/**
* Requires the SDK to recognize that an existing connection was reused to make the request,
- * contains the time interval (in milliseconds) between the construction of the http request and when a connection was successfully acquired from the connection pool.
- */
- AcquireConnectionLatency,
-
- /**
+ * contains the time interval (in milliseconds) between the construction of the http request and when a connection was successfully acquired from the connection pool.
+ */
+ AcquireConnectionLatency,
+
+ /**
* Requires the SDK to recognize whether or not an existing connection was used to make the request,
- * contains 1 if an existing connection was used to perform the http request; contains 0 if a new connection was opened to perform the http request.
- */
+ * contains 1 if an existing connection was used to perform the http request; contains 0 if a new connection was opened to perform the http request.
+ */
ConnectionReused,
-
+
/**
* Requires the SDK to recognize that a new connection was established to make the request,
* contains the time interval (in milliseconds) between the construction of the http request and when a connection was fully established.
* If the SDK is able to estimate this time despite not having a perfectly accurate callback for the specific event, then it should.
* For example, if the http client includes user-level data write functions that are guaranteed to be called shortly after connection establishment,
- * then the first call could be used as a reasonable time marker for ConnectLatency
- */
- ConnectLatency,
-
+ * then the first call could be used as a reasonable time marker for ConnectLatency
+ */
+ ConnectLatency,
+
/**
* Requires the SDK to be able to mark the point in time where the request starts transmission,
* contains the time interval (in milliseconds) between when the request begins transmission to the service and when a terminal error has occurred or the response has been parsed,
- * excluding streaming payloads. Like ConnectLatency, if the SDK has access to an event that is a "close enough" marker in time, it should include this entry.
- * The request here is a http level request, not a service level API request.
- */
+ * excluding streaming payloads. Like ConnectLatency, if the SDK has access to an event that is a "close enough" marker in time, it should include this entry.
+ * The request here is a http level request, not a service level API request.
+ */
RequestLatency,
-
- /**
+
+ /**
* Requires the SDK to have access to how long it took to perform DNS lookup, if it took place,
- * contains the time (in milliseconds) it took to perform DNS lookup, during the Api Call attempt.
- */
- DnsLatency,
-
- /**
+ * contains the time (in milliseconds) it took to perform DNS lookup, during the Api Call attempt.
+ */
+ DnsLatency,
+
+ /**
* Requires the SDK to have access to how long it took to establish the underlying Tcp/Ip connection used for the request,
- * contains the time (in milliseconds) it took to fully establish the TCP/IP connection used to make the request attempt.
- */
- TcpLatency,
-
- /**
+ * contains the time (in milliseconds) it took to fully establish the TCP/IP connection used to make the request attempt.
+ */
+ TcpLatency,
+
+ /**
* Requires the SDK to have access to how long it took to perform the SSL handshake for a secure request,
- * contains the time (in milliseconds) it took to perform a SSL handshake over the established TCP/IP connection.
- */
- SslLatency,
-
- /**
- * Unknow Metrics Type
- */
- Unknown
- };
-
- typedef Aws::Map<Aws::String, int64_t> HttpClientMetricsCollection;
-
+ * contains the time (in milliseconds) it took to perform a SSL handshake over the established TCP/IP connection.
+ */
+ SslLatency,
+
+ /**
+ * Unknow Metrics Type
+ */
+ Unknown
+ };
+
+ typedef Aws::Map<Aws::String, int64_t> HttpClientMetricsCollection;
+
AWS_CORE_API HttpClientMetricsType GetHttpClientMetricTypeByName(const Aws::String& name);
-
+
AWS_CORE_API Aws::String GetHttpClientMetricNameByType(HttpClientMetricsType type);
- }
-}
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h
index 22d9f6784b..2d03efa712 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringFactory.h
@@ -1,26 +1,26 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-#include <aws/core/Core_EXPORTS.h>
-
-namespace Aws
-{
- namespace Monitoring
- {
- class MonitoringInterface;
-
- /**
- * Factory to create monitoring instance.
- */
- class AWS_CORE_API MonitoringFactory
- {
- public:
- virtual ~MonitoringFactory() = default;
- virtual Aws::UniquePtr<MonitoringInterface> CreateMonitoringInstance() const = 0;
- };
-
- } // namespace Monitoring
-} // namespace Aws
+ */
+
+#pragma once
+#include <aws/core/Core_EXPORTS.h>
+
+namespace Aws
+{
+ namespace Monitoring
+ {
+ class MonitoringInterface;
+
+ /**
+ * Factory to create monitoring instance.
+ */
+ class AWS_CORE_API MonitoringFactory
+ {
+ public:
+ virtual ~MonitoringFactory() = default;
+ virtual Aws::UniquePtr<MonitoringInterface> CreateMonitoringInstance() const = 0;
+ };
+
+ } // namespace Monitoring
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringInterface.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringInterface.h
index 8613bae238..ebe50722c7 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringInterface.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringInterface.h
@@ -1,89 +1,89 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/http/HttpResponse.h>
-#include <aws/core/client/AWSError.h>
-#include <aws/core/client/AWSClient.h>
-#include <aws/core/monitoring/CoreMetrics.h>
-
-namespace Aws
-{
- namespace Monitoring
- {
- /**
- * Monitoring interface definition for SDK metrics collection.
- */
- class AWS_CORE_API MonitoringInterface
- {
- public:
- virtual ~MonitoringInterface() = default;
-
- /**
+ */
+
+#pragma once
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/http/HttpResponse.h>
+#include <aws/core/client/AWSError.h>
+#include <aws/core/client/AWSClient.h>
+#include <aws/core/monitoring/CoreMetrics.h>
+
+namespace Aws
+{
+ namespace Monitoring
+ {
+ /**
+ * Monitoring interface definition for SDK metrics collection.
+ */
+ class AWS_CORE_API MonitoringInterface
+ {
+ public:
+ virtual ~MonitoringInterface() = default;
+
+ /**
* @brief This function lets you do preparation work when a http attempt(request) starts. It returns a pointer to an implementation defined context which will be
* passed down with the other facilities that completes the request's lifetime. This context can be used to track the lifetime of the request and record metrics
- * specific to this particular request. You are responsible for deleteing the context during your OnFinish call.
- * @param serviceName, the service client who initiates this http attempt. like "s3", "ec2", etc.
- * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3.
- * @param request, the actual Http Request.
- * @return implementation depends memory address of context.
+ * specific to this particular request. You are responsible for deleteing the context during your OnFinish call.
+ * @param serviceName, the service client who initiates this http attempt. like "s3", "ec2", etc.
+ * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3.
+ * @param request, the actual Http Request.
+ * @return implementation depends memory address of context.
*/
virtual void* OnRequestStarted(const Aws::String& serviceName, const Aws::String& requestName,
- const std::shared_ptr<const Aws::Http::HttpRequest>& request) const = 0;
-
- /**
+ const std::shared_ptr<const Aws::Http::HttpRequest>& request) const = 0;
+
+ /**
* @brief Once a Http attempt finished and received "Succeeded" response, this function will be called.
- * @param serviceName, the service client who initiate this http attempt. like "s3", "ec2", etc.
- * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3.
- * @param request, the actual Http Request.
- * @param outcome, the outcome of the http attempt, you can access httpResponse and original httpRequest from it.
- * @param metricsFromCore, metrics collected from core, such as detailed latencies during http connection.
- * @param context parameter pointed to the same place returned by OnRequestStarted() function.
- * @return void.
- */
+ * @param serviceName, the service client who initiate this http attempt. like "s3", "ec2", etc.
+ * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3.
+ * @param request, the actual Http Request.
+ * @param outcome, the outcome of the http attempt, you can access httpResponse and original httpRequest from it.
+ * @param metricsFromCore, metrics collected from core, such as detailed latencies during http connection.
+ * @param context parameter pointed to the same place returned by OnRequestStarted() function.
+ * @return void.
+ */
virtual void OnRequestSucceeded(const Aws::String& serviceName,
- const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
- const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const = 0;
-
- /**
- * @brief Once a Http request finished and received "Failed" response, this function will be called.
- * @param serviceName, the service client who initiate this http attempt. like "s3", "ec2", etc.
- * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3.
- * @param request, the actual Http Request.
- * @param outcome, the outcome of the http attempt, you can access httpResponse and original httpRequest from it.
- * @param metricsFromCore, metrics collected from core, such as detailed latencies during http connection.
- * @param context parameter pointed to the same place returned by OnRequestStarted() function.
- * @return void.
- */
+ const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
+ const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const = 0;
+
+ /**
+ * @brief Once a Http request finished and received "Failed" response, this function will be called.
+ * @param serviceName, the service client who initiate this http attempt. like "s3", "ec2", etc.
+ * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3.
+ * @param request, the actual Http Request.
+ * @param outcome, the outcome of the http attempt, you can access httpResponse and original httpRequest from it.
+ * @param metricsFromCore, metrics collected from core, such as detailed latencies during http connection.
+ * @param context parameter pointed to the same place returned by OnRequestStarted() function.
+ * @return void.
+ */
virtual void OnRequestFailed(const Aws::String& serviceName,
- const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
- const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const = 0;
-
- /**
- * @brief Once an API call retried the attempt and send the request again, this function will be called.
- * @param serviceName, the service client who initiate this http attempt. like "s3", "ec2", etc.
- * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3.
- * @param request, the actual Http Request.
- * @param context parameter pointed to the same place returned by OnRequestStarted() function.
- * @return void.
- */
+ const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
+ const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const = 0;
+
+ /**
+ * @brief Once an API call retried the attempt and send the request again, this function will be called.
+ * @param serviceName, the service client who initiate this http attempt. like "s3", "ec2", etc.
+ * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3.
+ * @param request, the actual Http Request.
+ * @param context parameter pointed to the same place returned by OnRequestStarted() function.
+ * @return void.
+ */
virtual void OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName,
- const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const = 0;
-
- /**
- * @brief This function will always be called by the SDK to signal the implementer that this request is done. The implementer can safely delete the context.
- * @param serviceName, the service client who initiate this http attempt. like "s3", "ec2", etc.
- * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3.
- * @param request, the actual Http Request.
- * @param context parameter pointed to the same place returned by OnRequestStarted() function.
- * @return void.
- */
+ const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const = 0;
+
+ /**
+ * @brief This function will always be called by the SDK to signal the implementer that this request is done. The implementer can safely delete the context.
+ * @param serviceName, the service client who initiate this http attempt. like "s3", "ec2", etc.
+ * @param requestName, the operation or API name of this http attempt, like "GetObject" in s3.
+ * @param request, the actual Http Request.
+ * @param context parameter pointed to the same place returned by OnRequestStarted() function.
+ * @return void.
+ */
virtual void OnFinish(const Aws::String& serviceName, const Aws::String& requestName,
- const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const = 0;
- };
- } // namespace Monitoring
+ const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const = 0;
+ };
+ } // namespace Monitoring
} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringManager.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringManager.h
index 49bb8e00bf..aaa5bca5d1 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringManager.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/monitoring/MonitoringManager.h
@@ -1,64 +1,64 @@
-
+
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/memory/stl/AWSVector.h>
-#include <aws/core/client/AWSClient.h>
-#include <aws/core/monitoring/CoreMetrics.h>
-
-namespace Aws
-{
- namespace Monitoring
- {
- class MonitoringFactory;
- /**
- * Wrapper function of OnRequestStarted defined by all monitoring instances
- */
- Aws::Vector<void*> OnRequestStarted(const Aws::String& serviceName, const Aws::String& requestName,
- const std::shared_ptr<const Aws::Http::HttpRequest>& request);
-
- /**
- * Wrapper function of OnRequestSucceeded defined by all monitoring instances
- */
- void OnRequestSucceeded(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
- const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, const Aws::Vector<void*>& contexts);
-
- /**
- * Wrapper function of OnRequestFailed defined by all monitoring instances
- */
- void OnRequestFailed(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
- const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, const Aws::Vector<void*>& contexts);
-
- /**
- * Wrapper function of OnRequestRetry defined by all monitoring instances
- */
+ */
+
+#pragma once
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSVector.h>
+#include <aws/core/client/AWSClient.h>
+#include <aws/core/monitoring/CoreMetrics.h>
+
+namespace Aws
+{
+ namespace Monitoring
+ {
+ class MonitoringFactory;
+ /**
+ * Wrapper function of OnRequestStarted defined by all monitoring instances
+ */
+ Aws::Vector<void*> OnRequestStarted(const Aws::String& serviceName, const Aws::String& requestName,
+ const std::shared_ptr<const Aws::Http::HttpRequest>& request);
+
+ /**
+ * Wrapper function of OnRequestSucceeded defined by all monitoring instances
+ */
+ void OnRequestSucceeded(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
+ const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, const Aws::Vector<void*>& contexts);
+
+ /**
+ * Wrapper function of OnRequestFailed defined by all monitoring instances
+ */
+ void OnRequestFailed(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
+ const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, const Aws::Vector<void*>& contexts);
+
+ /**
+ * Wrapper function of OnRequestRetry defined by all monitoring instances
+ */
void OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName,
- const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Vector<void*>& contexts);
-
- /**
- * Wrapper function of OnFinish defined by all monitoring instances
- */
+ const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Vector<void*>& contexts);
+
+ /**
+ * Wrapper function of OnFinish defined by all monitoring instances
+ */
void OnFinish(const Aws::String& serviceName, const Aws::String& requestName,
- const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Vector<void*>& contexts);
-
- typedef std::function<Aws::UniquePtr<MonitoringFactory>()> MonitoringFactoryCreateFunction;
-
- /**
+ const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Vector<void*>& contexts);
+
+ typedef std::function<Aws::UniquePtr<MonitoringFactory>()> MonitoringFactoryCreateFunction;
+
+ /**
* Init monitoring using supplied factories, monitoring can support multiple instances.
- * We will try to (based on config resolution result) create a default client side monitoring listener instance defined in AWS SDK Core module.
- * and create other instances from these factories.
- * This function will be called during Aws::InitAPI call, argument is acquired from Aws::SDKOptions->MonitoringOptions
- */
+ * We will try to (based on config resolution result) create a default client side monitoring listener instance defined in AWS SDK Core module.
+ * and create other instances from these factories.
+ * This function will be called during Aws::InitAPI call, argument is acquired from Aws::SDKOptions->MonitoringOptions
+ */
AWS_CORE_API void InitMonitoring(const std::vector<MonitoringFactoryCreateFunction>& monitoringFactoryCreateFunctions);
-
- /**
- * Clean up monitoring related global variables
- */
+
+ /**
+ * Clean up monitoring related global variables
+ */
AWS_CORE_API void CleanupMonitoring();
- }
-}
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/Net.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/Net.h
index 25994a248a..00aca57e0a 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/Net.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/Net.h
@@ -1,23 +1,23 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-namespace Aws
-{
- namespace Net
- {
- // Has network stack been initiated.
- bool IsNetworkInitiated();
-
- // Initiate network stack.
- void InitNetwork();
-
- // Cleanup network stack.
- void CleanupNetwork();
- }
-}
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+namespace Aws
+{
+ namespace Net
+ {
+ // Has network stack been initiated.
+ bool IsNetworkInitiated();
+
+ // Initiate network stack.
+ void InitNetwork();
+
+ // Cleanup network stack.
+ void CleanupNetwork();
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/SimpleUDP.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/SimpleUDP.h
index 4462331cb7..2e96b509fb 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/SimpleUDP.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/net/SimpleUDP.h
@@ -1,47 +1,47 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
-#include <cstdint>
-struct sockaddr;
-
-namespace Aws
-{
- namespace Net
- {
- // 8K is aligned with default monitoring packet size.
- const static size_t UDP_BUFFER_SIZE = 8192;
- /**
- * SimpleUDP definition.
- */
- class AWS_CORE_API SimpleUDP
- {
- public:
- /**
- * @brief Constructor of SimpleUDP
- * @param addressFamily, AF_INET for IPV4 or AF_INET6 for IPV6
- * @param sendBufSize, if nonzero, try set socket's send buffer size to this value.
+#include <cstdint>
+struct sockaddr;
+
+namespace Aws
+{
+ namespace Net
+ {
+ // 8K is aligned with default monitoring packet size.
+ const static size_t UDP_BUFFER_SIZE = 8192;
+ /**
+ * SimpleUDP definition.
+ */
+ class AWS_CORE_API SimpleUDP
+ {
+ public:
+ /**
+ * @brief Constructor of SimpleUDP
+ * @param addressFamily, AF_INET for IPV4 or AF_INET6 for IPV6
+ * @param sendBufSize, if nonzero, try set socket's send buffer size to this value.
* @param receieveBufSize, if nonzero, try set socket's receive buffer size to this value.
* @param nonBlocking, if it is true, implementation will try to create a non-blocking underlying UDP socket.
- * Implementation should create and set the underlying udp socket.
- */
- SimpleUDP(int addressFamily, size_t sendBufSize = UDP_BUFFER_SIZE, size_t receiveBufSize = UDP_BUFFER_SIZE, bool nonBlocking = true);
-
- /**
- * @brief An easy constructor of an IPV4 or IPV6 SimpleUDP
- * @param addressFamily, either AF_INET for IPV4 or AF_INET6 for IPV6
- * @param sendBufSize, if nonzero, try set socket's send buffer size to this value.
+ * Implementation should create and set the underlying udp socket.
+ */
+ SimpleUDP(int addressFamily, size_t sendBufSize = UDP_BUFFER_SIZE, size_t receiveBufSize = UDP_BUFFER_SIZE, bool nonBlocking = true);
+
+ /**
+ * @brief An easy constructor of an IPV4 or IPV6 SimpleUDP
+ * @param addressFamily, either AF_INET for IPV4 or AF_INET6 for IPV6
+ * @param sendBufSize, if nonzero, try set socket's send buffer size to this value.
* @param receieveBufSize, if nonzero, try set socket's receive buffer size to this value.
* @param nonBlocking, if it is true, implementation will try to create a non-blocking underlying UDP socket.
- * Implementation should create and set the underlying udp socket.
- */
- SimpleUDP(bool IPV4 = true, size_t sendBufSize = UDP_BUFFER_SIZE, size_t receiveBufSize = UDP_BUFFER_SIZE, bool nonBlocking = true);
-
+ * Implementation should create and set the underlying udp socket.
+ */
+ SimpleUDP(bool IPV4 = true, size_t sendBufSize = UDP_BUFFER_SIZE, size_t receiveBufSize = UDP_BUFFER_SIZE, bool nonBlocking = true);
+
/**
* @brief An easy constructor of SimpleUDP based on host and port
* @param host, the host that packets will be sent to, could be ipv4 or ipv6 address, or a hostname
@@ -54,110 +54,110 @@ namespace Aws
*/
SimpleUDP(const char* host, unsigned short port, size_t sendBufSize = UDP_BUFFER_SIZE, size_t receiveBufSize = UDP_BUFFER_SIZE, bool nonBlocking = true);
- ~SimpleUDP();
-
- /**
- * @brief Connect underlying udp socket to server specified in address.
- * @param address, the server's address info.
- * @param addressLength, length of address, structure of address can vary.
- * @return 0 on success, -1 on error, check errno for detailed error information.
- */
- int Connect(const sockaddr* address, size_t addressLength);
-
- /**
+ ~SimpleUDP();
+
+ /**
+ * @brief Connect underlying udp socket to server specified in address.
+ * @param address, the server's address info.
+ * @param addressLength, length of address, structure of address can vary.
+ * @return 0 on success, -1 on error, check errno for detailed error information.
+ */
+ int Connect(const sockaddr* address, size_t addressLength);
+
+ /**
* @brief An easy way to connect to host
* @param hostIP, a valid ipv4 or ipv6 address. The address type should match the m_addressFamily type settled during construction.
* Otherwise the connection will fail.
* @param port, the port that host listens on.
- */
+ */
int ConnectToHost(const char* hostIP, unsigned short port) const;
-
- /**
+
+ /**
* @brief An easy way to connect to 127.0.0.1 or ::1 based on m_addressFamily
*/
int ConnectToLocalHost(unsigned short port) const;
/**
- * @brief Bind underlying udp socket to an address.
- * @param address, the server's address info.
- * @param addressLength, length of address, structure of address can vary.
- * @return 0 on success, -1 on error, check errno for detailed error information.
- */
- int Bind(const sockaddr* address, size_t addressLength) const;
-
- /**
- * @brief An easy way to bind to localhost
- */
- int BindToLocalHost(unsigned short port) const;
-
- /**
+ * @brief Bind underlying udp socket to an address.
+ * @param address, the server's address info.
+ * @param addressLength, length of address, structure of address can vary.
+ * @return 0 on success, -1 on error, check errno for detailed error information.
+ */
+ int Bind(const sockaddr* address, size_t addressLength) const;
+
+ /**
+ * @brief An easy way to bind to localhost
+ */
+ int BindToLocalHost(unsigned short port) const;
+
+ /**
* @brief Send data to server without specifying address, only usable if hostIP and port are available.
- * @param data, the data you want to send.
- * @param dataLen, the length of data you want to send. On Windows, dataLen larger than INT32_MAX will cause undefined behavior
- * @return 0 on success, -1 on error, check errno for detailed error information.
- */
- int SendData(const uint8_t* data, size_t dataLen) const;
-
- /**
- * @brief Send data to server.
- * @param address, the server's address info.
- * @param addressLength, length of address, structure of address can vary.
- * @param data, the memory address of the data you want to send.
- * @param dataLen, the length of data you want to send. On Windows, dataLen larger than INT32_MAX will cause undefined behavior
- * @return 0 on success, -1 on error check errno for detailed error information.
- */
- int SendDataTo(const sockaddr* address, size_t addressLength, const uint8_t* data, size_t dataLen) const;
-
- /**
- * @brief An easy way to send data to localhost, when the underlying udp is connected, call this function will
- * send the data to where it connects to, not essentially to localhost. when it's not connected, it will send data
- * to localhost, but this call will not connect underlying socket to localhost for you.
- * @param data, the memory address of the data you want to send.
- * @param dataLen, the length of data you want to send. On Windows, dataLen larger than INT32_MAX will cause undefined behavior
- * @param port, port of localhost.
- * @return 0 on success, -1 on error, check errno for detailed error information.
- */
- int SendDataToLocalHost(const uint8_t* data, size_t dataLen, unsigned short port) const;
-
- /**
- * @brief Receive data from unique address specified in ConnectWithServer call.
- * this function is equivalent to call ReceiveDataFrom(nullptr, 0, data, dataLen, flags).
- * @param buffer, the memory address where you want to store received data.
- * @param bufferLen, the size of data buffer.
- * @return -1 on failure, check errno for detailed error information, on success, returns the actual bytes of data received
- */
- int ReceiveData(uint8_t* buffer, size_t bufferLen) const;
-
- /**
- * @brief Receive data from network.
- * @param address, if not null and underlying implementation supply the incoming data's source address, this will be filled with source address info.
- * @param addressLength, the size of source adddress, should not be null.
- * @param buffer, the memory address where you want to store received data.
- * @param bufferLen, the size of data buffer.
- * @return -1 on failure, check errno for detailed error information, on success, returns the actual bytes of data received.
- */
- int ReceiveDataFrom(sockaddr* address, size_t* addressLength, uint8_t* buffer, size_t bufferLen) const;
-
- /**
+ * @param data, the data you want to send.
+ * @param dataLen, the length of data you want to send. On Windows, dataLen larger than INT32_MAX will cause undefined behavior
+ * @return 0 on success, -1 on error, check errno for detailed error information.
+ */
+ int SendData(const uint8_t* data, size_t dataLen) const;
+
+ /**
+ * @brief Send data to server.
+ * @param address, the server's address info.
+ * @param addressLength, length of address, structure of address can vary.
+ * @param data, the memory address of the data you want to send.
+ * @param dataLen, the length of data you want to send. On Windows, dataLen larger than INT32_MAX will cause undefined behavior
+ * @return 0 on success, -1 on error check errno for detailed error information.
+ */
+ int SendDataTo(const sockaddr* address, size_t addressLength, const uint8_t* data, size_t dataLen) const;
+
+ /**
+ * @brief An easy way to send data to localhost, when the underlying udp is connected, call this function will
+ * send the data to where it connects to, not essentially to localhost. when it's not connected, it will send data
+ * to localhost, but this call will not connect underlying socket to localhost for you.
+ * @param data, the memory address of the data you want to send.
+ * @param dataLen, the length of data you want to send. On Windows, dataLen larger than INT32_MAX will cause undefined behavior
+ * @param port, port of localhost.
+ * @return 0 on success, -1 on error, check errno for detailed error information.
+ */
+ int SendDataToLocalHost(const uint8_t* data, size_t dataLen, unsigned short port) const;
+
+ /**
+ * @brief Receive data from unique address specified in ConnectWithServer call.
+ * this function is equivalent to call ReceiveDataFrom(nullptr, 0, data, dataLen, flags).
+ * @param buffer, the memory address where you want to store received data.
+ * @param bufferLen, the size of data buffer.
+ * @return -1 on failure, check errno for detailed error information, on success, returns the actual bytes of data received
+ */
+ int ReceiveData(uint8_t* buffer, size_t bufferLen) const;
+
+ /**
+ * @brief Receive data from network.
+ * @param address, if not null and underlying implementation supply the incoming data's source address, this will be filled with source address info.
+ * @param addressLength, the size of source adddress, should not be null.
+ * @param buffer, the memory address where you want to store received data.
+ * @param bufferLen, the size of data buffer.
+ * @return -1 on failure, check errno for detailed error information, on success, returns the actual bytes of data received.
+ */
+ int ReceiveDataFrom(sockaddr* address, size_t* addressLength, uint8_t* buffer, size_t bufferLen) const;
+
+ /**
* Gets the AddressFamily used for the underlying socket. E.g. AF_INET, AF_INET6 etc.
- */
- inline int GetAddressFamily() const { return m_addressFamily; }
-
- /**
- * Is the underlying socket connected with a remote address
- */
- inline bool IsConnected() const { return m_connected; }
-
- private:
- void CreateSocket(int addressFamily, size_t sendBufSize, size_t receiveBufSize, bool nonBlocking);
- int GetUnderlyingSocket() const { return m_socket; }
- void SetUnderlyingSocket(int socket) { m_socket = socket; }
- int m_addressFamily;
- // if not connected, you can't perform SendData, if connected, SendDataTo will call SendData
+ */
+ inline int GetAddressFamily() const { return m_addressFamily; }
+
+ /**
+ * Is the underlying socket connected with a remote address
+ */
+ inline bool IsConnected() const { return m_connected; }
+
+ private:
+ void CreateSocket(int addressFamily, size_t sendBufSize, size_t receiveBufSize, bool nonBlocking);
+ int GetUnderlyingSocket() const { return m_socket; }
+ void SetUnderlyingSocket(int socket) { m_socket = socket; }
+ int m_addressFamily;
+ // if not connected, you can't perform SendData, if connected, SendDataTo will call SendData
mutable bool m_connected;
- int m_socket;
+ int m_socket;
unsigned short m_port;
Aws::String m_hostIP;
- };
- }
-}
+ };
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Android.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Android.h
index 7ff3c072ff..b012a49d50 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Android.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Android.h
@@ -2,28 +2,28 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#ifdef __ANDROID__
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-#include <jni.h>
-
-namespace Aws
-{
-namespace Platform
-{
-
-// must be called before any other native SDK functions when running on Android
-AWS_CORE_API void InitAndroid(JNIEnv* env, jobject context);
-
-// helper functions for functionality requiring JNI calls; not valid until InitAndroid has been called
-AWS_CORE_API JavaVM* GetJavaVM();
-AWS_CORE_API const char* GetCacheDirectory();
-
-} //namespace Platform
-} //namespace Aws
-
-#endif // __ANDROID__
+
+#ifdef __ANDROID__
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+#include <jni.h>
+
+namespace Aws
+{
+namespace Platform
+{
+
+// must be called before any other native SDK functions when running on Android
+AWS_CORE_API void InitAndroid(JNIEnv* env, jobject context);
+
+// helper functions for functionality requiring JNI calls; not valid until InitAndroid has been called
+AWS_CORE_API JavaVM* GetJavaVM();
+AWS_CORE_API const char* GetCacheDirectory();
+
+} //namespace Platform
+} //namespace Aws
+
+#endif // __ANDROID__
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Environment.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Environment.h
index 095f8ed8fc..f522bf3a22 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Environment.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Environment.h
@@ -2,21 +2,21 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
-namespace Environment
-{
- /**
- * shim for getenv
- */
- AWS_CORE_API Aws::String GetEnv(const char* name);
-
-} // namespace Environment
-} // namespace Aws
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+namespace Environment
+{
+ /**
+ * shim for getenv
+ */
+ AWS_CORE_API Aws::String GetEnv(const char* name);
+
+} // namespace Environment
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h
index ad17749f22..5eeacd2fbd 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h
@@ -2,225 +2,225 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSVector.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/memory/stl/AWSMap.h>
-#include <functional>
-
-namespace Aws
-{
-
-namespace FileSystem
-{
- struct DirectoryEntry;
- class Directory;
-
- #ifdef _WIN32
- static const char PATH_DELIM = '\\';
- #else
- static const char PATH_DELIM = '/';
- #endif
-
- /**
- * Returns the directory path for the home dir env variable
- */
- AWS_CORE_API Aws::String GetHomeDirectory();
-
- /**
- * Returns the directory path for the directory containing the currently running executable
- */
- AWS_CORE_API Aws::String GetExecutableDirectory();
-
- /**
- * @brief Creates directory if it doesn't exist. Returns true if the directory was created or already exists. False for failure.
- * @param path, the absolute path of the directory.
- * @param createParentDirs, if true, then this function will create missing directories on the path like linux command: mkdir -p
- */
- AWS_CORE_API bool CreateDirectoryIfNotExists(const char* path, bool createParentDirs = false);
-
- /**
- * Creates directory if it doesn't exist. Returns true if the directory was created
- * or already exists. False for failure.
- */
- AWS_CORE_API bool RemoveDirectoryIfExists(const char* path);
-
- /**
- * Deletes file if it exists. Returns true if file doesn't exist or on success.
- */
- AWS_CORE_API bool RemoveFileIfExists(const char* fileName);
-
- /**
- * Moves the file. Returns true on success
- */
- AWS_CORE_API bool RelocateFileOrDirectory(const char* from, const char* to);
-
- /**
- * Copies a directory and all of its contents.
- */
- AWS_CORE_API bool DeepCopyDirectory(const char* from, const char* to);
-
- /**
- * Deletes a directory and all of its contents.
- */
- AWS_CORE_API bool DeepDeleteDirectory(const char* toDelete);
-
- /**
- * Computes a unique tmp file path
- */
- AWS_CORE_API Aws::String CreateTempFilePath();
-
- /**
- * Opens a directory for traversal.
- */
- AWS_CORE_API Aws::UniquePtr<Directory> OpenDirectory(const Aws::String& path, const Aws::String& relativePath = "");
-
- /**
- * Joins the leftSegment and rightSegment of a path together using platform specific delimiter.
- * e.g. C:\users\name\ and .aws becomes C:\users\name\.aws
- */
- AWS_CORE_API Aws::String Join(const Aws::String& leftSegment, const Aws::String& rightSegment);
-
- /**
- * Joins the leftSegment and rightSegment of a path together using the specified delimiter.
- * e.g. with delimiter & C:\users\name\ and .aws becomes C:\users\name&.aws
- */
- AWS_CORE_API Aws::String Join(char delimiter, const Aws::String& leftSegment, const Aws::String& rightSegment);
-
- /**
- * Type of directory entry encountered.
- */
- enum class FileType
- {
- None,
- File,
- Symlink,
- Directory
- };
-
- struct DirectoryEntry
- {
- DirectoryEntry() : fileType(FileType::None), fileSize(0) {}
-
- operator bool() const { return !path.empty() && fileType != FileType::None; }
-
- Aws::String path;
- Aws::String relativePath;
- FileType fileType;
- int64_t fileSize;
- };
-
- /**
- * Base level representation of a directory. Provides the ability to iterate all entries in a directory and to descend into directories.
- * We don't recommend you use this class directly. Instead see DirectoryTree.
- */
- class AWS_CORE_API Directory
- {
- public:
- virtual ~Directory() = default;
-
- /**
- * Initialize a directory with it's absolute path. If the path is invalid, the bool operator will return false.
- */
- Directory(const Aws::String& path, const Aws::String& relativePath);
-
- /**
- * If this directory is valid for use.
- */
- virtual operator bool() const { return m_directoryEntry.operator bool(); }
-
- /**
- * Get the entry representing this current directory object.
- */
- const DirectoryEntry& GetDirectoryEntry() const { return m_directoryEntry; }
-
- /**
- * Get the current path of this directory object.
- */
- const Aws::String& GetPath() const { return m_directoryEntry.path; }
-
- /**
- * Get the next entry inside this directory.
- */
- virtual DirectoryEntry Next() = 0;
-
- /**
- * Descend into a directory if it is a directory. Returns a shared pointer to a Directory object which you can then call Next() and Descend on.
- * The original Directory object you use is responsible for the memory this method allocates, so do not attempt to delete the return value.
- */
- Aws::UniquePtr<Directory> Descend(const DirectoryEntry& directoryEntry);
-
- /**
- * Recursively search directories with path as root directory, return all normal(non directory and non symlink) files' paths.
- */
- static Aws::Vector<Aws::String> GetAllFilePathsInDirectory(const Aws::String& path);
-
- protected:
- DirectoryEntry m_directoryEntry;
- };
-
- class DirectoryTree;
-
- /**
- * Visitor for a Directory Tree traversal. Return true to continue the traversal, false to exit the traversal immediately.
- */
- typedef std::function<bool(const DirectoryTree*, const DirectoryEntry&)> DirectoryEntryVisitor;
-
- /**
- * Wrapper around directory. Currently provides a Depth-first and Breadth-first traversal of the provided path. This is most likely the class you are
- * looking for.
- */
- class AWS_CORE_API DirectoryTree
- {
- public:
- /**
- * Create a directory object for use with traversal using the provided path.
- */
- DirectoryTree(const Aws::String& path);
-
- /**
- * Returns true if the Directory Tree structures match. Otherwise false.
- */
- bool operator==(DirectoryTree& other);
-
- /**
- * Returns true if the Directory tree structure at path matches. Otherwise false.
- */
- bool operator==(const Aws::String& path);
-
- /**
- * Computes the difference between two directory trees based on their relative paths.
- * File contents are not taken into account, only the tree structure.
- *
- * Returns the diff between the two trees where the key is the relative path. The Directory entry will
- * contain the absolute path and file size.
- */
- Aws::Map<Aws::String, DirectoryEntry> Diff(DirectoryTree& other);
-
- /**
- * If the object is valid for use: true. Otherwise: false.
- */
- operator bool() const;
-
- /**
- * Performs a depth-first traversal of the directory tree. Upon encountering an entry, visitor will be invoked.
- * If postOrder is true, a pre-order traversal will be used. otherwise pre-order will be used.
- */
- void TraverseDepthFirst(const DirectoryEntryVisitor& visitor, bool postOrderTraversal = false);
-
- /**
- * Performs a breadth-first traversal of the directory tree. Upon encountering an entry, visitor will be invoked.
- */
- void TraverseBreadthFirst(const DirectoryEntryVisitor& visitor);
-
- private:
- bool TraverseDepthFirst(Directory& dir, const DirectoryEntryVisitor& visitor, bool postOrder = false);
- void TraverseBreadthFirst(Directory& dir, const DirectoryEntryVisitor& visitor);
-
- Aws::UniquePtr<Directory> m_dir;
- };
-
-} // namespace FileSystem
-} // namespace Aws
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSVector.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSMap.h>
+#include <functional>
+
+namespace Aws
+{
+
+namespace FileSystem
+{
+ struct DirectoryEntry;
+ class Directory;
+
+ #ifdef _WIN32
+ static const char PATH_DELIM = '\\';
+ #else
+ static const char PATH_DELIM = '/';
+ #endif
+
+ /**
+ * Returns the directory path for the home dir env variable
+ */
+ AWS_CORE_API Aws::String GetHomeDirectory();
+
+ /**
+ * Returns the directory path for the directory containing the currently running executable
+ */
+ AWS_CORE_API Aws::String GetExecutableDirectory();
+
+ /**
+ * @brief Creates directory if it doesn't exist. Returns true if the directory was created or already exists. False for failure.
+ * @param path, the absolute path of the directory.
+ * @param createParentDirs, if true, then this function will create missing directories on the path like linux command: mkdir -p
+ */
+ AWS_CORE_API bool CreateDirectoryIfNotExists(const char* path, bool createParentDirs = false);
+
+ /**
+ * Creates directory if it doesn't exist. Returns true if the directory was created
+ * or already exists. False for failure.
+ */
+ AWS_CORE_API bool RemoveDirectoryIfExists(const char* path);
+
+ /**
+ * Deletes file if it exists. Returns true if file doesn't exist or on success.
+ */
+ AWS_CORE_API bool RemoveFileIfExists(const char* fileName);
+
+ /**
+ * Moves the file. Returns true on success
+ */
+ AWS_CORE_API bool RelocateFileOrDirectory(const char* from, const char* to);
+
+ /**
+ * Copies a directory and all of its contents.
+ */
+ AWS_CORE_API bool DeepCopyDirectory(const char* from, const char* to);
+
+ /**
+ * Deletes a directory and all of its contents.
+ */
+ AWS_CORE_API bool DeepDeleteDirectory(const char* toDelete);
+
+ /**
+ * Computes a unique tmp file path
+ */
+ AWS_CORE_API Aws::String CreateTempFilePath();
+
+ /**
+ * Opens a directory for traversal.
+ */
+ AWS_CORE_API Aws::UniquePtr<Directory> OpenDirectory(const Aws::String& path, const Aws::String& relativePath = "");
+
+ /**
+ * Joins the leftSegment and rightSegment of a path together using platform specific delimiter.
+ * e.g. C:\users\name\ and .aws becomes C:\users\name\.aws
+ */
+ AWS_CORE_API Aws::String Join(const Aws::String& leftSegment, const Aws::String& rightSegment);
+
+ /**
+ * Joins the leftSegment and rightSegment of a path together using the specified delimiter.
+ * e.g. with delimiter & C:\users\name\ and .aws becomes C:\users\name&.aws
+ */
+ AWS_CORE_API Aws::String Join(char delimiter, const Aws::String& leftSegment, const Aws::String& rightSegment);
+
+ /**
+ * Type of directory entry encountered.
+ */
+ enum class FileType
+ {
+ None,
+ File,
+ Symlink,
+ Directory
+ };
+
+ struct DirectoryEntry
+ {
+ DirectoryEntry() : fileType(FileType::None), fileSize(0) {}
+
+ operator bool() const { return !path.empty() && fileType != FileType::None; }
+
+ Aws::String path;
+ Aws::String relativePath;
+ FileType fileType;
+ int64_t fileSize;
+ };
+
+ /**
+ * Base level representation of a directory. Provides the ability to iterate all entries in a directory and to descend into directories.
+ * We don't recommend you use this class directly. Instead see DirectoryTree.
+ */
+ class AWS_CORE_API Directory
+ {
+ public:
+ virtual ~Directory() = default;
+
+ /**
+ * Initialize a directory with it's absolute path. If the path is invalid, the bool operator will return false.
+ */
+ Directory(const Aws::String& path, const Aws::String& relativePath);
+
+ /**
+ * If this directory is valid for use.
+ */
+ virtual operator bool() const { return m_directoryEntry.operator bool(); }
+
+ /**
+ * Get the entry representing this current directory object.
+ */
+ const DirectoryEntry& GetDirectoryEntry() const { return m_directoryEntry; }
+
+ /**
+ * Get the current path of this directory object.
+ */
+ const Aws::String& GetPath() const { return m_directoryEntry.path; }
+
+ /**
+ * Get the next entry inside this directory.
+ */
+ virtual DirectoryEntry Next() = 0;
+
+ /**
+ * Descend into a directory if it is a directory. Returns a shared pointer to a Directory object which you can then call Next() and Descend on.
+ * The original Directory object you use is responsible for the memory this method allocates, so do not attempt to delete the return value.
+ */
+ Aws::UniquePtr<Directory> Descend(const DirectoryEntry& directoryEntry);
+
+ /**
+ * Recursively search directories with path as root directory, return all normal(non directory and non symlink) files' paths.
+ */
+ static Aws::Vector<Aws::String> GetAllFilePathsInDirectory(const Aws::String& path);
+
+ protected:
+ DirectoryEntry m_directoryEntry;
+ };
+
+ class DirectoryTree;
+
+ /**
+ * Visitor for a Directory Tree traversal. Return true to continue the traversal, false to exit the traversal immediately.
+ */
+ typedef std::function<bool(const DirectoryTree*, const DirectoryEntry&)> DirectoryEntryVisitor;
+
+ /**
+ * Wrapper around directory. Currently provides a Depth-first and Breadth-first traversal of the provided path. This is most likely the class you are
+ * looking for.
+ */
+ class AWS_CORE_API DirectoryTree
+ {
+ public:
+ /**
+ * Create a directory object for use with traversal using the provided path.
+ */
+ DirectoryTree(const Aws::String& path);
+
+ /**
+ * Returns true if the Directory Tree structures match. Otherwise false.
+ */
+ bool operator==(DirectoryTree& other);
+
+ /**
+ * Returns true if the Directory tree structure at path matches. Otherwise false.
+ */
+ bool operator==(const Aws::String& path);
+
+ /**
+ * Computes the difference between two directory trees based on their relative paths.
+ * File contents are not taken into account, only the tree structure.
+ *
+ * Returns the diff between the two trees where the key is the relative path. The Directory entry will
+ * contain the absolute path and file size.
+ */
+ Aws::Map<Aws::String, DirectoryEntry> Diff(DirectoryTree& other);
+
+ /**
+ * If the object is valid for use: true. Otherwise: false.
+ */
+ operator bool() const;
+
+ /**
+ * Performs a depth-first traversal of the directory tree. Upon encountering an entry, visitor will be invoked.
+ * If postOrder is true, a pre-order traversal will be used. otherwise pre-order will be used.
+ */
+ void TraverseDepthFirst(const DirectoryEntryVisitor& visitor, bool postOrderTraversal = false);
+
+ /**
+ * Performs a breadth-first traversal of the directory tree. Upon encountering an entry, visitor will be invoked.
+ */
+ void TraverseBreadthFirst(const DirectoryEntryVisitor& visitor);
+
+ private:
+ bool TraverseDepthFirst(Directory& dir, const DirectoryEntryVisitor& visitor, bool postOrder = false);
+ void TraverseBreadthFirst(Directory& dir, const DirectoryEntryVisitor& visitor);
+
+ Aws::UniquePtr<Directory> m_dir;
+ };
+
+} // namespace FileSystem
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/OSVersionInfo.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/OSVersionInfo.h
index 785d909cb6..e9aa3ea1f0 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/OSVersionInfo.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/OSVersionInfo.h
@@ -2,26 +2,26 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
-namespace OSVersionInfo
-{
- /**
- * computing the version string for the current running operating system.
- */
- AWS_CORE_API Aws::String ComputeOSVersionString();
-
- /**
- * runs a (shell) command string and returns the output; not needed on windows currently
- */
- AWS_CORE_API Aws::String GetSysCommandOutput(const char* command);
-
-} // namespace OSVersionInfo
-} // namespace Aws
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+namespace OSVersionInfo
+{
+ /**
+ * computing the version string for the current running operating system.
+ */
+ AWS_CORE_API Aws::String ComputeOSVersionString();
+
+ /**
+ * runs a (shell) command string and returns the output; not needed on windows currently
+ */
+ AWS_CORE_API Aws::String GetSysCommandOutput(const char* command);
+
+} // namespace OSVersionInfo
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Platform.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Platform.h
index a3e4aae7b3..e1cae5262e 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Platform.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Platform.h
@@ -2,8 +2,8 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/platform/Android.h>
-
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/platform/Android.h>
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Security.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Security.h
index edcd43f96a..d1533dd19f 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Security.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Security.h
@@ -2,23 +2,23 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <stddef.h>
-
-namespace Aws
-{
-namespace Security
-{
-
- /*
- * Securely clears a block of memory
- */
- AWS_CORE_API void SecureMemClear(unsigned char *data, size_t length);
-
-} // namespace Security
-} // namespace Aws
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <stddef.h>
+
+namespace Aws
+{
+namespace Security
+{
+
+ /*
+ * Securely clears a block of memory
+ */
+ AWS_CORE_API void SecureMemClear(unsigned char *data, size_t length);
+
+} // namespace Security
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Time.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Time.h
index 17bd557cbe..ecf802db66 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Time.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/Time.h
@@ -2,31 +2,31 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <ctime>
-
-namespace Aws
-{
-namespace Time
-{
-
- /*
- * A platform-agnostic implementation of the timegm function from gnu extensions
- */
- AWS_CORE_API time_t TimeGM(tm* const t);
-
- /*
- * Converts from a time value of std::time_t type to a C tm structure for easier date analysis
- */
- AWS_CORE_API void LocalTime(tm* t, std::time_t time);
-
- /*
- * Converts from a time value of std::time_t type to a C tm structure for easier date analysis
- */
- AWS_CORE_API void GMTime(tm* t, std::time_t time);
-
-} // namespace Time
-} // namespace Aws
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <ctime>
+
+namespace Aws
+{
+namespace Time
+{
+
+ /*
+ * A platform-agnostic implementation of the timegm function from gnu extensions
+ */
+ AWS_CORE_API time_t TimeGM(tm* const t);
+
+ /*
+ * Converts from a time value of std::time_t type to a C tm structure for easier date analysis
+ */
+ AWS_CORE_API void LocalTime(tm* t, std::time_t time);
+
+ /*
+ * Converts from a time value of std::time_t type to a C tm structure for easier date analysis
+ */
+ AWS_CORE_API void GMTime(tm* t, std::time_t time);
+
+} // namespace Time
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Array.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Array.h
index 5982831a94..2b5bbc566d 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Array.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Array.h
@@ -2,249 +2,249 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/AWSMemory.h>
-#include <aws/core/utils/memory/stl/AWSVector.h>
-#include <memory>
-#include <cassert>
-#include <cstring>
-#include <algorithm>
-
-#ifdef _WIN32
-
-#include <iterator>
-
-#endif // _WIN32
-
-namespace Aws
-{
- namespace Utils
- {
- static const char* ARRAY_ALLOCATION_TAG = "Aws::Array";
-
- /**
- * Safe array class with move and copy semantics.
- */
- template<typename T>
- class Array
- {
-
- public:
- /**
- * Create new empty array of size arraySize. Default argument is 0. If it is empty then no allocation happens.
- */
- Array(size_t arraySize = 0) :
- m_size(arraySize),
- m_data(arraySize > 0 ? Aws::MakeUniqueArray<T>(arraySize, ARRAY_ALLOCATION_TAG) : nullptr)
- {
- }
-
- /**
- * Create new array and initialize it to a raw array
- */
- Array(const T* arrayToCopy, size_t arraySize) :
- m_size(arraySize),
- m_data(nullptr)
- {
- if (arrayToCopy != nullptr && m_size > 0)
- {
- m_data.reset(Aws::NewArray<T>(m_size, ARRAY_ALLOCATION_TAG));
-
-#ifdef _WIN32
- std::copy(arrayToCopy, arrayToCopy + arraySize, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
-#else
- std::copy(arrayToCopy, arrayToCopy + arraySize, m_data.get());
-#endif // MSVC
- }
- }
-
- /**
- * Merge multiple arrays into one
- */
- Array(Aws::Vector<Array*>&& toMerge)
- {
- size_t totalSize = 0;
- for(auto& array : toMerge)
- {
- totalSize += array->m_size;
- }
-
- m_size = totalSize;
- m_data.reset(Aws::NewArray<T>(m_size, ARRAY_ALLOCATION_TAG));
-
- size_t location = 0;
- for(auto& arr : toMerge)
- {
- if(arr->m_size > 0 && arr->m_data)
- {
- size_t arraySize = arr->m_size;
-#ifdef _WIN32
- std::copy(arr->m_data.get(), arr->m_data.get() + arraySize, stdext::checked_array_iterator< T * >(m_data.get() + location, m_size));
-#else
- std::copy(arr->m_data.get(), arr->m_data.get() + arraySize, m_data.get() + location);
-#endif // MSVC
- location += arraySize;
- }
- }
- }
-
- Array(const Array& other)
- {
- m_size = other.m_size;
- m_data = nullptr;
-
- if (m_size > 0)
- {
- m_data.reset(Aws::NewArray<T>(m_size, ARRAY_ALLOCATION_TAG));
-
-#ifdef _WIN32
- std::copy(other.m_data.get(), other.m_data.get() + other.m_size, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
-#else
- std::copy(other.m_data.get(), other.m_data.get() + other.m_size, m_data.get());
-#endif // MSVC
- }
- }
-
- //move c_tor
- Array(Array&& other) :
- m_size(other.m_size),
- m_data(std::move(other.m_data))
- {
- other.m_size = 0;
- other.m_data = nullptr;
- }
-
- virtual ~Array() = default;
-
- Array& operator=(const Array& other)
- {
- if (this == &other)
- {
- return *this;
- }
-
- m_size = other.m_size;
- m_data = nullptr;
-
- if (m_size > 0)
- {
- m_data.reset(Aws::NewArray<T>(m_size, ARRAY_ALLOCATION_TAG));
-
-#ifdef _WIN32
- std::copy(other.m_data.get(), other.m_data.get() + other.m_size, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
-#else
- std::copy(other.m_data.get(), other.m_data.get() + other.m_size, m_data.get());
-#endif // MSVC
- }
-
- return *this;
- }
-
- Array& operator=(Array&& other)
- {
- m_size = other.m_size;
- m_data = std::move(other.m_data);
-
- return *this;
- }
-
- bool operator==(const Array& other) const
- {
- if (this == &other)
- return true;
-
- if (m_size == 0 && other.m_size == 0)
- {
- return true;
- }
-
- if (m_size == other.m_size && m_data && other.m_data)
- {
- for (unsigned i = 0; i < m_size; ++i)
- {
- if (m_data.get()[i] != other.m_data.get()[i])
- return false;
- }
-
- return true;
- }
-
- return false;
- }
-
- bool operator!=(const Array& other) const
- {
- return !(*this == other);
- }
-
- T const& GetItem(size_t index) const
- {
- assert(index < m_size);
- return m_data.get()[index];
- }
-
- T& GetItem(size_t index)
- {
- assert(index < m_size);
- return m_data.get()[index];
- }
-
- T& operator[](size_t index)
- {
- return GetItem(index);
- }
-
- T const& operator[](size_t index) const
- {
- return GetItem(index);
- }
-
- inline size_t GetLength() const
- {
- return m_size;
- }
-
- inline T* GetUnderlyingData() const
- {
- return m_data.get();
- }
-
- protected:
- size_t m_size;
-
- Aws::UniqueArrayPtr<T> m_data;
- };
-
- typedef Array<unsigned char> ByteBuffer;
-
- /**
- * Buffer for cryptographic operations. It zeroes itself back out upon deletion. Everything else is identical
- * to byte buffer.
- */
- class AWS_CORE_API CryptoBuffer : public ByteBuffer
- {
- public:
- CryptoBuffer(size_t arraySize = 0) : ByteBuffer(arraySize) {}
- CryptoBuffer(const unsigned char* arrayToCopy, size_t arraySize) : ByteBuffer(arrayToCopy, arraySize) {}
- CryptoBuffer(Aws::Vector<ByteBuffer*>&& toMerge) : ByteBuffer(std::move(toMerge)) {}
- CryptoBuffer(const ByteBuffer& other) : ByteBuffer(other) {}
- CryptoBuffer(const CryptoBuffer& other) : ByteBuffer(other) {}
- CryptoBuffer(CryptoBuffer&& other) : ByteBuffer(std::move(other)) {}
- CryptoBuffer& operator=(const CryptoBuffer&) = default;
- CryptoBuffer& operator=(CryptoBuffer&& other) { ByteBuffer::operator=(std::move(other)); return *this; }
- bool operator==(const CryptoBuffer& other) const { return ByteBuffer::operator==(other); }
- bool operator!=(const CryptoBuffer& other) const { return ByteBuffer::operator!=(other); }
-
- ~CryptoBuffer() { Zero(); }
-
- Array<CryptoBuffer> Slice(size_t sizeOfSlice) const;
- CryptoBuffer& operator^(const CryptoBuffer& operand);
- void Zero();
- };
-
- } // namespace Utils
-} // namespace Aws
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/AWSMemory.h>
+#include <aws/core/utils/memory/stl/AWSVector.h>
+#include <memory>
+#include <cassert>
+#include <cstring>
+#include <algorithm>
+
+#ifdef _WIN32
+
+#include <iterator>
+
+#endif // _WIN32
+
+namespace Aws
+{
+ namespace Utils
+ {
+ static const char* ARRAY_ALLOCATION_TAG = "Aws::Array";
+
+ /**
+ * Safe array class with move and copy semantics.
+ */
+ template<typename T>
+ class Array
+ {
+
+ public:
+ /**
+ * Create new empty array of size arraySize. Default argument is 0. If it is empty then no allocation happens.
+ */
+ Array(size_t arraySize = 0) :
+ m_size(arraySize),
+ m_data(arraySize > 0 ? Aws::MakeUniqueArray<T>(arraySize, ARRAY_ALLOCATION_TAG) : nullptr)
+ {
+ }
+
+ /**
+ * Create new array and initialize it to a raw array
+ */
+ Array(const T* arrayToCopy, size_t arraySize) :
+ m_size(arraySize),
+ m_data(nullptr)
+ {
+ if (arrayToCopy != nullptr && m_size > 0)
+ {
+ m_data.reset(Aws::NewArray<T>(m_size, ARRAY_ALLOCATION_TAG));
+
+#ifdef _WIN32
+ std::copy(arrayToCopy, arrayToCopy + arraySize, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
+#else
+ std::copy(arrayToCopy, arrayToCopy + arraySize, m_data.get());
+#endif // MSVC
+ }
+ }
+
+ /**
+ * Merge multiple arrays into one
+ */
+ Array(Aws::Vector<Array*>&& toMerge)
+ {
+ size_t totalSize = 0;
+ for(auto& array : toMerge)
+ {
+ totalSize += array->m_size;
+ }
+
+ m_size = totalSize;
+ m_data.reset(Aws::NewArray<T>(m_size, ARRAY_ALLOCATION_TAG));
+
+ size_t location = 0;
+ for(auto& arr : toMerge)
+ {
+ if(arr->m_size > 0 && arr->m_data)
+ {
+ size_t arraySize = arr->m_size;
+#ifdef _WIN32
+ std::copy(arr->m_data.get(), arr->m_data.get() + arraySize, stdext::checked_array_iterator< T * >(m_data.get() + location, m_size));
+#else
+ std::copy(arr->m_data.get(), arr->m_data.get() + arraySize, m_data.get() + location);
+#endif // MSVC
+ location += arraySize;
+ }
+ }
+ }
+
+ Array(const Array& other)
+ {
+ m_size = other.m_size;
+ m_data = nullptr;
+
+ if (m_size > 0)
+ {
+ m_data.reset(Aws::NewArray<T>(m_size, ARRAY_ALLOCATION_TAG));
+
+#ifdef _WIN32
+ std::copy(other.m_data.get(), other.m_data.get() + other.m_size, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
+#else
+ std::copy(other.m_data.get(), other.m_data.get() + other.m_size, m_data.get());
+#endif // MSVC
+ }
+ }
+
+ //move c_tor
+ Array(Array&& other) :
+ m_size(other.m_size),
+ m_data(std::move(other.m_data))
+ {
+ other.m_size = 0;
+ other.m_data = nullptr;
+ }
+
+ virtual ~Array() = default;
+
+ Array& operator=(const Array& other)
+ {
+ if (this == &other)
+ {
+ return *this;
+ }
+
+ m_size = other.m_size;
+ m_data = nullptr;
+
+ if (m_size > 0)
+ {
+ m_data.reset(Aws::NewArray<T>(m_size, ARRAY_ALLOCATION_TAG));
+
+#ifdef _WIN32
+ std::copy(other.m_data.get(), other.m_data.get() + other.m_size, stdext::checked_array_iterator< T * >(m_data.get(), m_size));
+#else
+ std::copy(other.m_data.get(), other.m_data.get() + other.m_size, m_data.get());
+#endif // MSVC
+ }
+
+ return *this;
+ }
+
+ Array& operator=(Array&& other)
+ {
+ m_size = other.m_size;
+ m_data = std::move(other.m_data);
+
+ return *this;
+ }
+
+ bool operator==(const Array& other) const
+ {
+ if (this == &other)
+ return true;
+
+ if (m_size == 0 && other.m_size == 0)
+ {
+ return true;
+ }
+
+ if (m_size == other.m_size && m_data && other.m_data)
+ {
+ for (unsigned i = 0; i < m_size; ++i)
+ {
+ if (m_data.get()[i] != other.m_data.get()[i])
+ return false;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ bool operator!=(const Array& other) const
+ {
+ return !(*this == other);
+ }
+
+ T const& GetItem(size_t index) const
+ {
+ assert(index < m_size);
+ return m_data.get()[index];
+ }
+
+ T& GetItem(size_t index)
+ {
+ assert(index < m_size);
+ return m_data.get()[index];
+ }
+
+ T& operator[](size_t index)
+ {
+ return GetItem(index);
+ }
+
+ T const& operator[](size_t index) const
+ {
+ return GetItem(index);
+ }
+
+ inline size_t GetLength() const
+ {
+ return m_size;
+ }
+
+ inline T* GetUnderlyingData() const
+ {
+ return m_data.get();
+ }
+
+ protected:
+ size_t m_size;
+
+ Aws::UniqueArrayPtr<T> m_data;
+ };
+
+ typedef Array<unsigned char> ByteBuffer;
+
+ /**
+ * Buffer for cryptographic operations. It zeroes itself back out upon deletion. Everything else is identical
+ * to byte buffer.
+ */
+ class AWS_CORE_API CryptoBuffer : public ByteBuffer
+ {
+ public:
+ CryptoBuffer(size_t arraySize = 0) : ByteBuffer(arraySize) {}
+ CryptoBuffer(const unsigned char* arrayToCopy, size_t arraySize) : ByteBuffer(arrayToCopy, arraySize) {}
+ CryptoBuffer(Aws::Vector<ByteBuffer*>&& toMerge) : ByteBuffer(std::move(toMerge)) {}
+ CryptoBuffer(const ByteBuffer& other) : ByteBuffer(other) {}
+ CryptoBuffer(const CryptoBuffer& other) : ByteBuffer(other) {}
+ CryptoBuffer(CryptoBuffer&& other) : ByteBuffer(std::move(other)) {}
+ CryptoBuffer& operator=(const CryptoBuffer&) = default;
+ CryptoBuffer& operator=(CryptoBuffer&& other) { ByteBuffer::operator=(std::move(other)); return *this; }
+ bool operator==(const CryptoBuffer& other) const { return ByteBuffer::operator==(other); }
+ bool operator!=(const CryptoBuffer& other) const { return ByteBuffer::operator!=(other); }
+
+ ~CryptoBuffer() { Zero(); }
+
+ Array<CryptoBuffer> Slice(size_t sizeOfSlice) const;
+ CryptoBuffer& operator^(const CryptoBuffer& operand);
+ void Zero();
+ };
+
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DNS.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DNS.h
index efca36bbff..7472a386c0 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DNS.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DNS.h
@@ -2,17 +2,17 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace Utils
- {
- AWS_CORE_API bool IsValidDnsLabel(const Aws::String& label);
+
+#pragma once
+
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ AWS_CORE_API bool IsValidDnsLabel(const Aws::String& label);
AWS_CORE_API bool IsValidHost(const Aws::String& host);
- }
-}
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DateTime.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DateTime.h
index 7235193ca8..a410279011 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DateTime.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/DateTime.h
@@ -2,249 +2,249 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <chrono>
-
-namespace Aws
-{
- namespace Utils
- {
- enum class DateFormat
- {
- RFC822, //for http headers
- ISO_8601, //for query and xml payloads
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <chrono>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ enum class DateFormat
+ {
+ RFC822, //for http headers
+ ISO_8601, //for query and xml payloads
ISO_8601_BASIC, // for retry headers and signers
- AutoDetect
- };
-
- enum class Month
- {
- January = 0,
- February,
- March,
- April,
- May,
- June,
- July,
- August,
- September,
- October,
- November,
- December
- };
-
- enum class DayOfWeek
- {
- Sunday = 0,
- Monday,
- Tuesday,
- Wednesday,
- Thursday,
- Friday,
- Saturday
- };
-
- /**
+ AutoDetect
+ };
+
+ enum class Month
+ {
+ January = 0,
+ February,
+ March,
+ April,
+ May,
+ June,
+ July,
+ August,
+ September,
+ October,
+ November,
+ December
+ };
+
+ enum class DayOfWeek
+ {
+ Sunday = 0,
+ Monday,
+ Tuesday,
+ Wednesday,
+ Thursday,
+ Friday,
+ Saturday
+ };
+
+ /**
* Wrapper for all the weird crap we need to do with timestamps.
- */
- class AWS_CORE_API DateTime
- {
- public:
- /**
- * Initializes time point to epoch
- */
- DateTime();
-
- /**
+ */
+ class AWS_CORE_API DateTime
+ {
+ public:
+ /**
+ * Initializes time point to epoch
+ */
+ DateTime();
+
+ /**
* Initializes time point to any other arbitrary timepoint
- */
- DateTime(const std::chrono::system_clock::time_point& timepointToAssign);
-
- /**
+ */
+ DateTime(const std::chrono::system_clock::time_point& timepointToAssign);
+
+ /**
* Initializes time point to millis Since epoch
- */
- DateTime(int64_t millisSinceEpoch);
-
- /**
- * Initializes time point to epoch time in seconds.millis
- */
- DateTime(double epoch_millis);
-
- /**
- * Initializes time point to value represented by timestamp and format.
- */
- DateTime(const Aws::String& timestamp, DateFormat format);
-
- /**
- * Initializes time point to value represented by timestamp and format.
- */
- DateTime(const char* timestamp, DateFormat format);
-
- bool operator == (const DateTime& other) const;
- bool operator < (const DateTime& other) const;
- bool operator > (const DateTime& other) const;
- bool operator != (const DateTime& other) const;
- bool operator <= (const DateTime& other) const;
- bool operator >= (const DateTime& other) const;
-
- DateTime operator+(const std::chrono::milliseconds& a) const;
- DateTime operator-(const std::chrono::milliseconds& a) const;
-
- /**
- * Assign from seconds.millis since epoch.
- */
- DateTime& operator=(double secondsSinceEpoch);
-
- /**
- * Assign from millis since epoch.
- */
- DateTime& operator=(int64_t millisSinceEpoch);
-
- /**
- * Assign from another time_point
- */
- DateTime& operator=(const std::chrono::system_clock::time_point& timepointToAssign);
-
- /**
- * Assign from an ISO8601 or RFC822 formatted string
- */
- DateTime& operator=(const Aws::String& timestamp);
-
- /**
- * Whether or not parsing the timestamp from string was successful.
- */
- inline bool WasParseSuccessful() const { return m_valid; }
-
- /**
- * Convert dateTime to local time string using predefined format.
- */
- Aws::String ToLocalTimeString(DateFormat format) const;
-
- /**
- * Convert dateTime to local time string using arbitrary format.
- */
- Aws::String ToLocalTimeString(const char* formatStr) const;
-
- /**
- * Convert dateTime to GMT time string using predefined format.
- */
- Aws::String ToGmtString(DateFormat format) const;
-
- /**
- * Convert dateTime to GMT time string using arbitrary format.
- */
- Aws::String ToGmtString(const char* formatStr) const;
-
- /**
- * Get the representation of this datetime as seconds.milliseconds since epoch
- */
- double SecondsWithMSPrecision() const;
-
- /**
- * Milliseconds since epoch of this datetime.
- */
- int64_t Millis() const;
-
- /**
- * In the likely case this class doesn't do everything you need to do, here's a copy of the time_point structure. Have fun.
- */
- std::chrono::system_clock::time_point UnderlyingTimestamp() const;
-
- /**
- * Get the Year portion of this dateTime. localTime if true, return local time, otherwise return UTC
- */
- int GetYear(bool localTime = false) const;
-
- /**
- * Get the Month portion of this dateTime. localTime if true, return local time, otherwise return UTC
- */
- Month GetMonth(bool localTime = false) const;
-
- /**
- * Get the Day of the Month portion of this dateTime. localTime if true, return local time, otherwise return UTC
- */
- int GetDay(bool localTime = false) const;
-
- /**
- * Get the Day of the Week portion of this dateTime. localTime if true, return local time, otherwise return UTC
- */
- DayOfWeek GetDayOfWeek(bool localTime = false) const;
-
- /**
- * Get the Hour portion of this dateTime. localTime if true, return local time, otherwise return UTC
- */
- int GetHour(bool localTime = false) const;
-
- /**
- * Get the Minute portion of this dateTime. localTime if true, return local time, otherwise return UTC
- */
- int GetMinute(bool localTime = false) const;
-
- /**
- * Get the Second portion of this dateTime. localTime if true, return local time, otherwise return UTC
- */
- int GetSecond(bool localTime = false) const;
-
- /**
- * Get whether or not this dateTime is in Daylight savings time. localTime if true, return local time, otherwise return UTC
- */
- bool IsDST(bool localTime = false) const;
-
- /**
- * Get an instance of DateTime representing this very instant.
- */
- static DateTime Now();
-
- /**
- * Get the millis since epoch representing this very instant.
- */
- static int64_t CurrentTimeMillis();
-
- /**
- * Calculates the current local timestamp, formats it and returns it as a string
- */
- static Aws::String CalculateLocalTimestampAsString(const char* formatStr);
-
- /**
- * Calculates the current gmt timestamp, formats it, and returns it as a string
- */
- static Aws::String CalculateGmtTimestampAsString(const char* formatStr);
-
- /**
- * Calculates the current hour of the day in localtime.
- */
- static int CalculateCurrentHour();
-
- /**
- * The amazon timestamp format is a double with seconds.milliseconds
- */
- static double ComputeCurrentTimestampInAmazonFormat();
-
- /**
+ */
+ DateTime(int64_t millisSinceEpoch);
+
+ /**
+ * Initializes time point to epoch time in seconds.millis
+ */
+ DateTime(double epoch_millis);
+
+ /**
+ * Initializes time point to value represented by timestamp and format.
+ */
+ DateTime(const Aws::String& timestamp, DateFormat format);
+
+ /**
+ * Initializes time point to value represented by timestamp and format.
+ */
+ DateTime(const char* timestamp, DateFormat format);
+
+ bool operator == (const DateTime& other) const;
+ bool operator < (const DateTime& other) const;
+ bool operator > (const DateTime& other) const;
+ bool operator != (const DateTime& other) const;
+ bool operator <= (const DateTime& other) const;
+ bool operator >= (const DateTime& other) const;
+
+ DateTime operator+(const std::chrono::milliseconds& a) const;
+ DateTime operator-(const std::chrono::milliseconds& a) const;
+
+ /**
+ * Assign from seconds.millis since epoch.
+ */
+ DateTime& operator=(double secondsSinceEpoch);
+
+ /**
+ * Assign from millis since epoch.
+ */
+ DateTime& operator=(int64_t millisSinceEpoch);
+
+ /**
+ * Assign from another time_point
+ */
+ DateTime& operator=(const std::chrono::system_clock::time_point& timepointToAssign);
+
+ /**
+ * Assign from an ISO8601 or RFC822 formatted string
+ */
+ DateTime& operator=(const Aws::String& timestamp);
+
+ /**
+ * Whether or not parsing the timestamp from string was successful.
+ */
+ inline bool WasParseSuccessful() const { return m_valid; }
+
+ /**
+ * Convert dateTime to local time string using predefined format.
+ */
+ Aws::String ToLocalTimeString(DateFormat format) const;
+
+ /**
+ * Convert dateTime to local time string using arbitrary format.
+ */
+ Aws::String ToLocalTimeString(const char* formatStr) const;
+
+ /**
+ * Convert dateTime to GMT time string using predefined format.
+ */
+ Aws::String ToGmtString(DateFormat format) const;
+
+ /**
+ * Convert dateTime to GMT time string using arbitrary format.
+ */
+ Aws::String ToGmtString(const char* formatStr) const;
+
+ /**
+ * Get the representation of this datetime as seconds.milliseconds since epoch
+ */
+ double SecondsWithMSPrecision() const;
+
+ /**
+ * Milliseconds since epoch of this datetime.
+ */
+ int64_t Millis() const;
+
+ /**
+ * In the likely case this class doesn't do everything you need to do, here's a copy of the time_point structure. Have fun.
+ */
+ std::chrono::system_clock::time_point UnderlyingTimestamp() const;
+
+ /**
+ * Get the Year portion of this dateTime. localTime if true, return local time, otherwise return UTC
+ */
+ int GetYear(bool localTime = false) const;
+
+ /**
+ * Get the Month portion of this dateTime. localTime if true, return local time, otherwise return UTC
+ */
+ Month GetMonth(bool localTime = false) const;
+
+ /**
+ * Get the Day of the Month portion of this dateTime. localTime if true, return local time, otherwise return UTC
+ */
+ int GetDay(bool localTime = false) const;
+
+ /**
+ * Get the Day of the Week portion of this dateTime. localTime if true, return local time, otherwise return UTC
+ */
+ DayOfWeek GetDayOfWeek(bool localTime = false) const;
+
+ /**
+ * Get the Hour portion of this dateTime. localTime if true, return local time, otherwise return UTC
+ */
+ int GetHour(bool localTime = false) const;
+
+ /**
+ * Get the Minute portion of this dateTime. localTime if true, return local time, otherwise return UTC
+ */
+ int GetMinute(bool localTime = false) const;
+
+ /**
+ * Get the Second portion of this dateTime. localTime if true, return local time, otherwise return UTC
+ */
+ int GetSecond(bool localTime = false) const;
+
+ /**
+ * Get whether or not this dateTime is in Daylight savings time. localTime if true, return local time, otherwise return UTC
+ */
+ bool IsDST(bool localTime = false) const;
+
+ /**
+ * Get an instance of DateTime representing this very instant.
+ */
+ static DateTime Now();
+
+ /**
+ * Get the millis since epoch representing this very instant.
+ */
+ static int64_t CurrentTimeMillis();
+
+ /**
+ * Calculates the current local timestamp, formats it and returns it as a string
+ */
+ static Aws::String CalculateLocalTimestampAsString(const char* formatStr);
+
+ /**
+ * Calculates the current gmt timestamp, formats it, and returns it as a string
+ */
+ static Aws::String CalculateGmtTimestampAsString(const char* formatStr);
+
+ /**
+ * Calculates the current hour of the day in localtime.
+ */
+ static int CalculateCurrentHour();
+
+ /**
+ * The amazon timestamp format is a double with seconds.milliseconds
+ */
+ static double ComputeCurrentTimestampInAmazonFormat();
+
+ /**
* Calculates the current time in GMT with millisecond precision using the format
* "Year-month-day hours:minutes:seconds.milliseconds"
*/
static Aws::String CalculateGmtTimeWithMsPrecision();
/**
- * Compute the difference between two timestamps.
- */
- static std::chrono::milliseconds Diff(const DateTime& a, const DateTime& b);
-
+ * Compute the difference between two timestamps.
+ */
+ static std::chrono::milliseconds Diff(const DateTime& a, const DateTime& b);
+
std::chrono::milliseconds operator - (const DateTime& other) const;
- private:
- std::chrono::system_clock::time_point m_time;
- bool m_valid;
-
- void ConvertTimestampStringToTimePoint(const char* timestamp, DateFormat format);
- tm GetTimeStruct(bool localTime) const;
- tm ConvertTimestampToLocalTimeStruct() const;
+ private:
+ std::chrono::system_clock::time_point m_time;
+ bool m_valid;
+
+ void ConvertTimestampStringToTimePoint(const char* timestamp, DateFormat format);
+ tm GetTimeStruct(bool localTime) const;
+ tm ConvertTimestampToLocalTimeStruct() const;
tm ConvertTimestampToGmtStruct() const;
- };
-
- } // namespace Utils
-} // namespace Aws
+ };
+
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/EnumParseOverflowContainer.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/EnumParseOverflowContainer.h
index 6f1aca21e2..0302e2bd36 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/EnumParseOverflowContainer.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/EnumParseOverflowContainer.h
@@ -2,35 +2,35 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/utils/memory/stl/AWSMap.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/threading/ReaderWriterLock.h>
-
-namespace Aws
-{
- namespace Utils
- {
- /**
- * This container is for storing unknown enum values that are encountered during parsing.
- * This is to work around the round-tripping enums problem. It's really just a simple thread-safe
- * hashmap.
- */
- class AWS_CORE_API EnumParseOverflowContainer
- {
- public:
- const Aws::String& RetrieveOverflow(int hashCode) const;
- void StoreOverflow(int hashCode, const Aws::String& value);
-
- private:
- mutable Aws::Utils::Threading::ReaderWriterLock m_overflowLock;
- Aws::Map<int, Aws::String> m_overflowMap;
- Aws::String m_emptyString;
- };
- }
-}
-
-
+
+#pragma once
+
+#include <aws/core/utils/memory/stl/AWSMap.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/threading/ReaderWriterLock.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ /**
+ * This container is for storing unknown enum values that are encountered during parsing.
+ * This is to work around the round-tripping enums problem. It's really just a simple thread-safe
+ * hashmap.
+ */
+ class AWS_CORE_API EnumParseOverflowContainer
+ {
+ public:
+ const Aws::String& RetrieveOverflow(int hashCode) const;
+ void StoreOverflow(int hashCode, const Aws::String& value);
+
+ private:
+ mutable Aws::Utils::Threading::ReaderWriterLock m_overflowLock;
+ Aws::Map<int, Aws::String> m_overflowMap;
+ Aws::String m_emptyString;
+ };
+ }
+}
+
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/FileSystemUtils.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/FileSystemUtils.h
index 07b56a2e80..d62ff4c094 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/FileSystemUtils.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/FileSystemUtils.h
@@ -2,69 +2,69 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/platform/FileSystem.h>
-
-#include <fstream>
-
-namespace Aws
-{
- namespace Utils
- {
-
- class AWS_CORE_API FStreamWithFileName : public Aws::FStream
- {
- public:
- FStreamWithFileName(const Aws::String& fileName, std::ios_base::openmode openFlags) :
- Aws::FStream(fileName.c_str(), openFlags), m_fileName(fileName) {}
-
- virtual ~FStreamWithFileName() = default;
-
- const Aws::String& GetFileName() const { return m_fileName; }
- protected:
- Aws::String m_fileName;
- };
-
- /**
- * Provides a fstream around a temporary file. This file gets deleted upon an instance of this class's destructor being called.
- */
- class AWS_CORE_API TempFile : public Aws::Utils::FStreamWithFileName
- {
- public:
- /**
- * Creates a temporary file with [prefix][temp name][suffix] e.g.
- * prefix of "foo" and suffix of ".bar" will generate foo[some random string].bar
- */
- TempFile(const char* prefix, const char* suffix, std::ios_base::openmode openFlags);
- /**
- * Creates a temporary file with [prefix][temp name] e.g.
- * prefix of "foo" will generate foo[some random string]
- */
- TempFile(const char* prefix, std::ios_base::openmode openFlags);
- /**
- * Creates a temporary file with a randome string for the name.
- */
- TempFile(std::ios_base::openmode openFlags);
-
- ~TempFile();
- };
-
- class AWS_CORE_API PathUtils
- {
- public:
-
- /**
- * Get file name from it's full path, e.g get "file1" from "/path/to/file1.ext"; get "file2" from "/path/to/file2"
- */
- static Aws::String GetFileNameFromPathWithoutExt(const Aws::String& path);
-
- /**
- * Get file name from it's full path, e.g get "file1.ext" from "/path/to/file1.ext"; get "file2" from "/path/to/file2"
- */
- static Aws::String GetFileNameFromPathWithExt(const Aws::String& path);
- };
- }
-}
+#pragma once
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/platform/FileSystem.h>
+
+#include <fstream>
+
+namespace Aws
+{
+ namespace Utils
+ {
+
+ class AWS_CORE_API FStreamWithFileName : public Aws::FStream
+ {
+ public:
+ FStreamWithFileName(const Aws::String& fileName, std::ios_base::openmode openFlags) :
+ Aws::FStream(fileName.c_str(), openFlags), m_fileName(fileName) {}
+
+ virtual ~FStreamWithFileName() = default;
+
+ const Aws::String& GetFileName() const { return m_fileName; }
+ protected:
+ Aws::String m_fileName;
+ };
+
+ /**
+ * Provides a fstream around a temporary file. This file gets deleted upon an instance of this class's destructor being called.
+ */
+ class AWS_CORE_API TempFile : public Aws::Utils::FStreamWithFileName
+ {
+ public:
+ /**
+ * Creates a temporary file with [prefix][temp name][suffix] e.g.
+ * prefix of "foo" and suffix of ".bar" will generate foo[some random string].bar
+ */
+ TempFile(const char* prefix, const char* suffix, std::ios_base::openmode openFlags);
+ /**
+ * Creates a temporary file with [prefix][temp name] e.g.
+ * prefix of "foo" will generate foo[some random string]
+ */
+ TempFile(const char* prefix, std::ios_base::openmode openFlags);
+ /**
+ * Creates a temporary file with a randome string for the name.
+ */
+ TempFile(std::ios_base::openmode openFlags);
+
+ ~TempFile();
+ };
+
+ class AWS_CORE_API PathUtils
+ {
+ public:
+
+ /**
+ * Get file name from it's full path, e.g get "file1" from "/path/to/file1.ext"; get "file2" from "/path/to/file2"
+ */
+ static Aws::String GetFileNameFromPathWithoutExt(const Aws::String& path);
+
+ /**
+ * Get file name from it's full path, e.g get "file1.ext" from "/path/to/file1.ext"; get "file2" from "/path/to/file2"
+ */
+ static Aws::String GetFileNameFromPathWithExt(const Aws::String& path);
+ };
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/GetTheLights.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/GetTheLights.h
index 2d7875833b..f42475c8e4 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/GetTheLights.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/GetTheLights.h
@@ -2,34 +2,34 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSStack.h>
-#include <functional>
-#include <atomic>
-
-namespace Aws
-{
- namespace Utils
- {
- /**
- * Make initialization and cleanup of shared resources less painful.
- * If you have this problem. Create a static instance of GetTheLights,
- * have each actor call Enter the room with your callable.
- *
- * When you are finished with the shared resources call LeaveRoom(). The last caller will
- * have its callable executed.
- */
- class AWS_CORE_API GetTheLights
- {
- public:
- GetTheLights();
- void EnterRoom(std::function<void()>&&);
- void LeaveRoom(std::function<void()>&&);
- private:
- std::atomic<int> m_value;
- };
- }
-} \ No newline at end of file
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSStack.h>
+#include <functional>
+#include <atomic>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ /**
+ * Make initialization and cleanup of shared resources less painful.
+ * If you have this problem. Create a static instance of GetTheLights,
+ * have each actor call Enter the room with your callable.
+ *
+ * When you are finished with the shared resources call LeaveRoom(). The last caller will
+ * have its callable executed.
+ */
+ class AWS_CORE_API GetTheLights
+ {
+ public:
+ GetTheLights();
+ void EnterRoom(std::function<void()>&&);
+ void LeaveRoom(std::function<void()>&&);
+ private:
+ std::atomic<int> m_value;
+ };
+ }
+} \ No newline at end of file
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/HashingUtils.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/HashingUtils.h
index 986e2a247e..48c04daf59 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/HashingUtils.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/HashingUtils.h
@@ -2,85 +2,85 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/Array.h>
-
-namespace Aws
-{
- namespace Utils
- {
-
- /**
- * Generic utils for hashing strings
- */
- class AWS_CORE_API HashingUtils
- {
- public:
- /**
- * Base64 encodes string
- */
- static Aws::String Base64Encode(const ByteBuffer& byteBuffer);
-
- /**
- * Base64 decodes string
- */
- static ByteBuffer Base64Decode(const Aws::String&);
-
- /**
- * Hex encodes string
- */
- static Aws::String HexEncode(const ByteBuffer& byteBuffer);
-
- /**
- * Hex encodes string
- */
- static ByteBuffer HexDecode(const Aws::String& str);
-
- /**
- * Calculates a SHA256 HMAC digest (not hex encoded)
- */
- static ByteBuffer CalculateSHA256HMAC(const ByteBuffer& toSign, const ByteBuffer& secret);
-
- /**
- * Calculates a SHA256 Hash digest (not hex encoded)
- */
- static ByteBuffer CalculateSHA256(const Aws::String& str);
-
- /**
- * Calculates a SHA256 Hash digest on a stream (the entire stream is read, not hex encoded.)
- */
- static ByteBuffer CalculateSHA256(Aws::IOStream& stream);
-
- /**
- * Calculates a SHA256 Tree Hash digest (not hex encoded, see tree hash definition: http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html)
- */
- static ByteBuffer CalculateSHA256TreeHash(const Aws::String& str);
-
- /**
- * Calculates a SHA256 Tree Hash digest on a stream (the entire stream is read, not hex encoded.)
- */
- static ByteBuffer CalculateSHA256TreeHash(Aws::IOStream& stream);
-
- /**
- * Calculates a MD5 Hash value
- */
- static ByteBuffer CalculateMD5(const Aws::String& str);
-
- /**
- * Calculates a MD5 Hash value
- */
- static ByteBuffer CalculateMD5(Aws::IOStream& stream);
-
- static int HashString(const char* strToHash);
-
- };
-
- } // namespace Utils
-} // namespace Aws
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/Array.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+
+ /**
+ * Generic utils for hashing strings
+ */
+ class AWS_CORE_API HashingUtils
+ {
+ public:
+ /**
+ * Base64 encodes string
+ */
+ static Aws::String Base64Encode(const ByteBuffer& byteBuffer);
+
+ /**
+ * Base64 decodes string
+ */
+ static ByteBuffer Base64Decode(const Aws::String&);
+
+ /**
+ * Hex encodes string
+ */
+ static Aws::String HexEncode(const ByteBuffer& byteBuffer);
+
+ /**
+ * Hex encodes string
+ */
+ static ByteBuffer HexDecode(const Aws::String& str);
+
+ /**
+ * Calculates a SHA256 HMAC digest (not hex encoded)
+ */
+ static ByteBuffer CalculateSHA256HMAC(const ByteBuffer& toSign, const ByteBuffer& secret);
+
+ /**
+ * Calculates a SHA256 Hash digest (not hex encoded)
+ */
+ static ByteBuffer CalculateSHA256(const Aws::String& str);
+
+ /**
+ * Calculates a SHA256 Hash digest on a stream (the entire stream is read, not hex encoded.)
+ */
+ static ByteBuffer CalculateSHA256(Aws::IOStream& stream);
+
+ /**
+ * Calculates a SHA256 Tree Hash digest (not hex encoded, see tree hash definition: http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html)
+ */
+ static ByteBuffer CalculateSHA256TreeHash(const Aws::String& str);
+
+ /**
+ * Calculates a SHA256 Tree Hash digest on a stream (the entire stream is read, not hex encoded.)
+ */
+ static ByteBuffer CalculateSHA256TreeHash(Aws::IOStream& stream);
+
+ /**
+ * Calculates a MD5 Hash value
+ */
+ static ByteBuffer CalculateMD5(const Aws::String& str);
+
+ /**
+ * Calculates a MD5 Hash value
+ */
+ static ByteBuffer CalculateMD5(Aws::IOStream& stream);
+
+ static int HashString(const char* strToHash);
+
+ };
+
+ } // namespace Utils
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Outcome.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Outcome.h
index 4b15c73977..70e9e4be26 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Outcome.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/Outcome.h
@@ -2,52 +2,52 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
#include <cassert>
-#include <utility>
-
-namespace Aws
-{
- namespace Utils
- {
-
- /**
- * Template class representing the outcome of making a request. It will contain
- * either a successful result or the failure error. The caller must check
- * whether the outcome of the request was a success before attempting to access
- * the result or the error.
- */
- template<typename R, typename E> // Result, Error
- class Outcome
- {
- public:
-
+#include <utility>
+
+namespace Aws
+{
+ namespace Utils
+ {
+
+ /**
+ * Template class representing the outcome of making a request. It will contain
+ * either a successful result or the failure error. The caller must check
+ * whether the outcome of the request was a success before attempting to access
+ * the result or the error.
+ */
+ template<typename R, typename E> // Result, Error
+ class Outcome
+ {
+ public:
+
Outcome() : result(), error(), success(false)
- {
+ {
}
Outcome(const R& r) : result(r), error(), success(true)
- {
+ {
}
Outcome(const E& e) : result(), error(e), success(false)
- {
+ {
}
Outcome(R&& r) : result(std::forward<R>(r)), error(), success(true)
- {
+ {
}
Outcome(E&& e) : result(), error(std::forward<E>(e)), success(false)
- {
- }
- Outcome(const Outcome& o) :
- result(o.result),
- error(o.error),
- success(o.success)
- {
- }
-
+ {
+ }
+ Outcome(const Outcome& o) :
+ result(o.result),
+ error(o.error),
+ success(o.success)
+ {
+ }
+
template<typename RT, typename ET>
friend class Outcome;
@@ -94,77 +94,77 @@ namespace Aws
{
}
- Outcome& operator=(const Outcome& o)
- {
- if (this != &o)
- {
- result = o.result;
- error = o.error;
- success = o.success;
- }
-
- return *this;
- }
-
- Outcome(Outcome&& o) : // Required to force Move Constructor
- result(std::move(o.result)),
- error(std::move(o.error)),
- success(o.success)
- {
- }
-
- Outcome& operator=(Outcome&& o)
- {
- if (this != &o)
- {
- result = std::move(o.result);
- error = std::move(o.error);
- success = o.success;
- }
-
- return *this;
- }
-
- inline const R& GetResult() const
- {
- return result;
- }
-
- inline R& GetResult()
- {
- return result;
- }
-
- /**
- * casts the underlying result to an r-value so that caller can take ownership of underlying resources.
- * this is necessary when streams are involved.
- */
- inline R&& GetResultWithOwnership()
- {
- return std::move(result);
- }
-
- inline const E& GetError() const
- {
- return error;
- }
-
+ Outcome& operator=(const Outcome& o)
+ {
+ if (this != &o)
+ {
+ result = o.result;
+ error = o.error;
+ success = o.success;
+ }
+
+ return *this;
+ }
+
+ Outcome(Outcome&& o) : // Required to force Move Constructor
+ result(std::move(o.result)),
+ error(std::move(o.error)),
+ success(o.success)
+ {
+ }
+
+ Outcome& operator=(Outcome&& o)
+ {
+ if (this != &o)
+ {
+ result = std::move(o.result);
+ error = std::move(o.error);
+ success = o.success;
+ }
+
+ return *this;
+ }
+
+ inline const R& GetResult() const
+ {
+ return result;
+ }
+
+ inline R& GetResult()
+ {
+ return result;
+ }
+
+ /**
+ * casts the underlying result to an r-value so that caller can take ownership of underlying resources.
+ * this is necessary when streams are involved.
+ */
+ inline R&& GetResultWithOwnership()
+ {
+ return std::move(result);
+ }
+
+ inline const E& GetError() const
+ {
+ return error;
+ }
+
template<typename T>
inline T GetError()
{
return error.template GetModeledError<T>();
}
- inline bool IsSuccess() const
- {
- return this->success;
- }
-
- private:
- R result;
- E error;
- bool success;
- };
-
- } // namespace Utils
-} // namespace Aws
+ inline bool IsSuccess() const
+ {
+ return this->success;
+ }
+
+ private:
+ R result;
+ E error;
+ bool success;
+ };
+
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ResourceManager.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ResourceManager.h
index dec4a56c74..517f65d0fa 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ResourceManager.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ResourceManager.h
@@ -2,121 +2,121 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-
-#include <aws/core/utils/memory/stl/AWSVector.h>
-#include <mutex>
-#include <condition_variable>
-#include <atomic>
-#include <cassert>
-
-namespace Aws
-{
- namespace Utils
- {
- /**
- * Generic resource manager with Acquire/Release semantics. Acquire will block waiting on a an available resource. Release will
- * cause one blocked acquisition to unblock.
- *
+#pragma once
+
+#include <aws/core/utils/memory/stl/AWSVector.h>
+#include <mutex>
+#include <condition_variable>
+#include <atomic>
+#include <cassert>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ /**
+ * Generic resource manager with Acquire/Release semantics. Acquire will block waiting on a an available resource. Release will
+ * cause one blocked acquisition to unblock.
+ *
* You must call ShutdownAndWait() when finished with this container, this unblocks the listening thread and gives you a chance to
* clean up the resource if needed.
- * After calling ShutdownAndWait(), you must not call Acquire any more.
- */
- template< typename RESOURCE_TYPE>
- class ExclusiveOwnershipResourceManager
- {
- public:
- ExclusiveOwnershipResourceManager() : m_shutdown(false) {}
+ * After calling ShutdownAndWait(), you must not call Acquire any more.
+ */
+ template< typename RESOURCE_TYPE>
+ class ExclusiveOwnershipResourceManager
+ {
+ public:
+ ExclusiveOwnershipResourceManager() : m_shutdown(false) {}
- /**
- * Returns a resource with exclusive ownership. You must call Release on the resource when you are finished or other
- * threads will block waiting to acquire it.
- *
- * @return instance of RESOURCE_TYPE
- */
- RESOURCE_TYPE Acquire()
- {
- std::unique_lock<std::mutex> locker(m_queueLock);
- while(!m_shutdown.load() && m_resources.size() == 0)
- {
+ /**
+ * Returns a resource with exclusive ownership. You must call Release on the resource when you are finished or other
+ * threads will block waiting to acquire it.
+ *
+ * @return instance of RESOURCE_TYPE
+ */
+ RESOURCE_TYPE Acquire()
+ {
+ std::unique_lock<std::mutex> locker(m_queueLock);
+ while(!m_shutdown.load() && m_resources.size() == 0)
+ {
m_semaphore.wait(locker, [&](){ return m_shutdown.load() || m_resources.size() > 0; });
- }
-
- assert(!m_shutdown.load());
-
- RESOURCE_TYPE resource = m_resources.back();
- m_resources.pop_back();
-
- return resource;
- }
-
- /**
- * Returns whether or not resources are currently available for acquisition
- *
- * @return true means that at this instant some resources are available (though another thread may grab them from under you),
- * this is only a hint.
- */
- bool HasResourcesAvailable()
- {
- std::lock_guard<std::mutex> locker(m_queueLock);
- return m_resources.size() > 0 && !m_shutdown.load();
- }
-
- /**
- * Releases a resource back to the pool. This will unblock one waiting Acquire call if any are waiting.
- *
- * @param resource resource to release back to the pool
- */
- void Release(RESOURCE_TYPE resource)
- {
- std::unique_lock<std::mutex> locker(m_queueLock);
- m_resources.push_back(resource);
- locker.unlock();
- m_semaphore.notify_one();
- }
-
- /**
- * Does not block or even touch the semaphores. This is intended for setup only, do not use this after Acquire has been called for the first time.
- *
- * @param resource resource to be managed.
- */
- void PutResource(RESOURCE_TYPE resource)
- {
- m_resources.push_back(resource);
- }
-
- /**
+ }
+
+ assert(!m_shutdown.load());
+
+ RESOURCE_TYPE resource = m_resources.back();
+ m_resources.pop_back();
+
+ return resource;
+ }
+
+ /**
+ * Returns whether or not resources are currently available for acquisition
+ *
+ * @return true means that at this instant some resources are available (though another thread may grab them from under you),
+ * this is only a hint.
+ */
+ bool HasResourcesAvailable()
+ {
+ std::lock_guard<std::mutex> locker(m_queueLock);
+ return m_resources.size() > 0 && !m_shutdown.load();
+ }
+
+ /**
+ * Releases a resource back to the pool. This will unblock one waiting Acquire call if any are waiting.
+ *
+ * @param resource resource to release back to the pool
+ */
+ void Release(RESOURCE_TYPE resource)
+ {
+ std::unique_lock<std::mutex> locker(m_queueLock);
+ m_resources.push_back(resource);
+ locker.unlock();
+ m_semaphore.notify_one();
+ }
+
+ /**
+ * Does not block or even touch the semaphores. This is intended for setup only, do not use this after Acquire has been called for the first time.
+ *
+ * @param resource resource to be managed.
+ */
+ void PutResource(RESOURCE_TYPE resource)
+ {
+ m_resources.push_back(resource);
+ }
+
+ /**
* Waits for all acquired resources to be released, then empties the queue.
- * You must call ShutdownAndWait() when finished with this container, this unblocks the listening thread and gives you a chance to
- * clean up the resource if needed.
- * After calling ShutdownAndWait(), you must not call Acquire any more.
- *
+ * You must call ShutdownAndWait() when finished with this container, this unblocks the listening thread and gives you a chance to
+ * clean up the resource if needed.
+ * After calling ShutdownAndWait(), you must not call Acquire any more.
+ *
* @params resourceCount the number of resources you've added to the resource manager.
- * @return the previously managed resources that are now available for cleanup.
- */
- Aws::Vector<RESOURCE_TYPE> ShutdownAndWait(size_t resourceCount)
- {
- Aws::Vector<RESOURCE_TYPE> resources;
- std::unique_lock<std::mutex> locker(m_queueLock);
- m_shutdown = true;
-
+ * @return the previously managed resources that are now available for cleanup.
+ */
+ Aws::Vector<RESOURCE_TYPE> ShutdownAndWait(size_t resourceCount)
+ {
+ Aws::Vector<RESOURCE_TYPE> resources;
+ std::unique_lock<std::mutex> locker(m_queueLock);
+ m_shutdown = true;
+
//wait for all acquired resources to be released.
- while (m_resources.size() < resourceCount)
- {
- m_semaphore.wait(locker, [&]() { return m_resources.size() == resourceCount; });
- }
-
- resources = m_resources;
- m_resources.clear();
+ while (m_resources.size() < resourceCount)
+ {
+ m_semaphore.wait(locker, [&]() { return m_resources.size() == resourceCount; });
+ }
+
+ resources = m_resources;
+ m_resources.clear();
+
+ return resources;
+ }
- return resources;
- }
-
- private:
- Aws::Vector<RESOURCE_TYPE> m_resources;
- std::mutex m_queueLock;
- std::condition_variable m_semaphore;
- std::atomic<bool> m_shutdown;
- };
- }
-}
+ private:
+ Aws::Vector<RESOURCE_TYPE> m_resources;
+ std::mutex m_queueLock;
+ std::condition_variable m_semaphore;
+ std::atomic<bool> m_shutdown;
+ };
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/StringUtils.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/StringUtils.h
index 445e297f59..312342b86a 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/StringUtils.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/StringUtils.h
@@ -2,71 +2,71 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/memory/stl/AWSVector.h>
-#include <aws/core/utils/memory/stl/AWSStringStream.h>
-
-
-
-namespace Aws
-{
- namespace Utils
- {
- /**
- * All the things the c++ stdlib is missing for string operations that I needed.
- */
- class AWS_CORE_API StringUtils
- {
- public:
- static void Replace(Aws::String& s, const char* search, const char* replace);
-
-
- /**
- * Converts a string to lower case.
- */
- static Aws::String ToLower(const char* source);
-
-
- /**
- * Converts a string to upper case.
- */
- static Aws::String ToUpper(const char* source);
-
-
- /**
- * Does a caseless comparison of two strings.
- */
- static bool CaselessCompare(const char* value1, const char* value2);
-
-
- /**
- * URL encodes a string (uses %20 not + for spaces).
- */
- static Aws::String URLEncode(const char* unsafe);
-
- /**
- * Http Clients tend to escape some characters but not all. Escaping all of them causes problems, because the client
- * will also try to escape them.
- * So this only escapes non-ascii characters and the + character
- */
- static Aws::String UTF8Escape(const char* unicodeString, const char* delimiter);
-
- /**
- * URL encodes a double (if it ends up going to scientific notation) otherwise it just returns it as a string.
- */
- static Aws::String URLEncode(double unsafe);
-
-
- /**
- * Decodes a URL encoded string (will handle both encoding schemes for spaces).
- */
- static Aws::String URLDecode(const char* safe);
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSVector.h>
+#include <aws/core/utils/memory/stl/AWSStringStream.h>
+
+
+
+namespace Aws
+{
+ namespace Utils
+ {
+ /**
+ * All the things the c++ stdlib is missing for string operations that I needed.
+ */
+ class AWS_CORE_API StringUtils
+ {
+ public:
+ static void Replace(Aws::String& s, const char* search, const char* replace);
+
+
+ /**
+ * Converts a string to lower case.
+ */
+ static Aws::String ToLower(const char* source);
+
+
+ /**
+ * Converts a string to upper case.
+ */
+ static Aws::String ToUpper(const char* source);
+
+
+ /**
+ * Does a caseless comparison of two strings.
+ */
+ static bool CaselessCompare(const char* value1, const char* value2);
+
+
+ /**
+ * URL encodes a string (uses %20 not + for spaces).
+ */
+ static Aws::String URLEncode(const char* unsafe);
+
+ /**
+ * Http Clients tend to escape some characters but not all. Escaping all of them causes problems, because the client
+ * will also try to escape them.
+ * So this only escapes non-ascii characters and the + character
+ */
+ static Aws::String UTF8Escape(const char* unicodeString, const char* delimiter);
+
+ /**
+ * URL encodes a double (if it ends up going to scientific notation) otherwise it just returns it as a string.
+ */
+ static Aws::String URLEncode(double unsafe);
+
+
+ /**
+ * Decodes a URL encoded string (will handle both encoding schemes for spaces).
+ */
+ static Aws::String URLDecode(const char* safe);
+
enum class SplitOptions
{
/**
@@ -79,14 +79,14 @@ namespace Aws
INCLUDE_EMPTY_ENTRIES
};
- /**
- * @brief Splits a string on a delimiter (empty items are excluded).
- * @param toSplit, the original string to split
- * @param splitOn, the delemiter you want to use.
- */
- static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn);
-
- /**
+ /**
+ * @brief Splits a string on a delimiter (empty items are excluded).
+ * @param toSplit, the original string to split
+ * @param splitOn, the delemiter you want to use.
+ */
+ static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn);
+
+ /**
* @brief Splits a string on a delimiter.
* @param toSplit, the original string to split
* @param splitOn, the delemiter you want to use.
@@ -95,13 +95,13 @@ namespace Aws
static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn, SplitOptions option);
/**
- * @brief Splits a string on a delimiter (empty items are excluded).
- * @param toSplit, the original string to split
- * @param splitOn, the delemiter you want to use.
- * @param numOfTargetParts, how many target parts you want to get, if it is 0, as many as possible.
- */
- static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn, size_t numOfTargetParts);
-
+ * @brief Splits a string on a delimiter (empty items are excluded).
+ * @param toSplit, the original string to split
+ * @param splitOn, the delemiter you want to use.
+ * @param numOfTargetParts, how many target parts you want to get, if it is 0, as many as possible.
+ */
+ static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn, size_t numOfTargetParts);
+
/**
* @brief Splits a string on a delimiter.
* @param toSplit, the original string to split
@@ -110,77 +110,77 @@ namespace Aws
* @param option, if INCLUDE_EMPTY_ENTRIES, includes empty entries in the result, otherwise removes empty entries.
*/
static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn, size_t numOfTargetParts, SplitOptions option);
-
- /**
- * Splits a string on new line characters.
- */
- static Aws::Vector<Aws::String> SplitOnLine(const Aws::String& toSplit);
-
-
- /** static Aws::Vector<Aws::String> SplitOnRegex(Aws::String regex);
- * trim from start
- */
- static Aws::String LTrim(const char* source);
-
-
- /**
- * trim from end
- */
- static Aws::String RTrim(const char* source);
-
- /**
- * trim from both ends
- */
- static Aws::String Trim(const char* source);
-
-
- /**
- * convert to int 64
- */
- static long long ConvertToInt64(const char* source);
-
-
- /**
- * convert to int 32
- */
- static long ConvertToInt32(const char* source);
-
-
- /**
- * convert to bool
- */
- static bool ConvertToBool(const char* source);
-
-
- /**
- * convert to double
- */
- static double ConvertToDouble(const char* source);
-
-
-#ifdef _WIN32
- /**
- * Converts a string to wstring.
- */
- static Aws::WString ToWString(const char* source);
-
- /**
- * Converts a wstring to string.
- */
- static Aws::String FromWString(const wchar_t* source);
-#endif
-
- /**
- * not all platforms (Android) have std::to_string
+
+ /**
+ * Splits a string on new line characters.
+ */
+ static Aws::Vector<Aws::String> SplitOnLine(const Aws::String& toSplit);
+
+
+ /** static Aws::Vector<Aws::String> SplitOnRegex(Aws::String regex);
+ * trim from start
+ */
+ static Aws::String LTrim(const char* source);
+
+
+ /**
+ * trim from end
+ */
+ static Aws::String RTrim(const char* source);
+
+ /**
+ * trim from both ends
+ */
+ static Aws::String Trim(const char* source);
+
+
+ /**
+ * convert to int 64
+ */
+ static long long ConvertToInt64(const char* source);
+
+
+ /**
+ * convert to int 32
+ */
+ static long ConvertToInt32(const char* source);
+
+
+ /**
+ * convert to bool
+ */
+ static bool ConvertToBool(const char* source);
+
+
+ /**
+ * convert to double
*/
- template< typename T >
- static Aws::String to_string(T value)
- {
- Aws::OStringStream os;
- os << value;
- return os.str();
- }
-
+ static double ConvertToDouble(const char* source);
+
+
+#ifdef _WIN32
+ /**
+ * Converts a string to wstring.
+ */
+ static Aws::WString ToWString(const char* source);
+
+ /**
+ * Converts a wstring to string.
+ */
+ static Aws::String FromWString(const wchar_t* source);
+#endif
+
+ /**
+ * not all platforms (Android) have std::to_string
+ */
+ template< typename T >
+ static Aws::String to_string(T value)
+ {
+ Aws::OStringStream os;
+ os << value;
+ return os.str();
+ }
+
/**
* locale agnostic implementation of std::isalnum
*/
@@ -212,8 +212,8 @@ namespace Aws
std::reverse(s.begin(), s.end());
return s;
}
- };
-
-
- } // namespace Utils
+ };
+
+
+ } // namespace Utils
} // namespace Aws \ No newline at end of file
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UUID.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UUID.h
index b9b73d6e8e..e6320d14ef 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UUID.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UUID.h
@@ -2,51 +2,51 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/Array.h>
-
-namespace Aws
-{
- namespace Utils
- {
- static const size_t UUID_BINARY_SIZE = 0x10;
-
- /**
- * Class encapsulating a UUID. This is platform dependent. The method you are most likely interested in is RandomUUID().
- */
- class AWS_CORE_API UUID
- {
- public:
- /**
- * Parses a GUID string into the raw data.
- */
- UUID(const Aws::String&);
- /**
- * Sets the raw uuid data
- */
- UUID(const unsigned char uuid[UUID_BINARY_SIZE]);
-
- /**
- * Returns the current UUID as a GUID string
- */
- operator Aws::String() const;
- /**
- * Returns a copy of the raw uuid
- */
- inline operator ByteBuffer() const { return ByteBuffer(m_uuid, sizeof(m_uuid)); }
-
- /**
- * Generates a UUID. It will always try to prefer a random implementation from the entropy source on the machine. If none, is available, it will
- * fallback to the mac address and timestamp implementation.
- */
- static UUID RandomUUID();
-
- private:
- unsigned char m_uuid[UUID_BINARY_SIZE];
- };
- }
-}
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/Array.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ static const size_t UUID_BINARY_SIZE = 0x10;
+
+ /**
+ * Class encapsulating a UUID. This is platform dependent. The method you are most likely interested in is RandomUUID().
+ */
+ class AWS_CORE_API UUID
+ {
+ public:
+ /**
+ * Parses a GUID string into the raw data.
+ */
+ UUID(const Aws::String&);
+ /**
+ * Sets the raw uuid data
+ */
+ UUID(const unsigned char uuid[UUID_BINARY_SIZE]);
+
+ /**
+ * Returns the current UUID as a GUID string
+ */
+ operator Aws::String() const;
+ /**
+ * Returns a copy of the raw uuid
+ */
+ inline operator ByteBuffer() const { return ByteBuffer(m_uuid, sizeof(m_uuid)); }
+
+ /**
+ * Generates a UUID. It will always try to prefer a random implementation from the entropy source on the machine. If none, is available, it will
+ * fallback to the mac address and timestamp implementation.
+ */
+ static UUID RandomUUID();
+
+ private:
+ unsigned char m_uuid[UUID_BINARY_SIZE];
+ };
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UnreferencedParam.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UnreferencedParam.h
index 6997f6f79c..d1bb74467d 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UnreferencedParam.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/UnreferencedParam.h
@@ -2,17 +2,17 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-// taken from http://stackoverflow.com/questions/3020584/avoid-warning-unreferenced-formal-parameter, ugly but avoids having to #include the definition of an unreferenced struct/class
-
-#if defined (_MSC_VER)
-
- #define AWS_UNREFERENCED_PARAM(x) (&reinterpret_cast<const int &>(x))
-
-#else
-
- #define AWS_UNREFERENCED_PARAM(x) ((void)(x))
-
-#endif // _MSC_VER
+
+#pragma once
+
+// taken from http://stackoverflow.com/questions/3020584/avoid-warning-unreferenced-formal-parameter, ugly but avoids having to #include the definition of an unreferenced struct/class
+
+#if defined (_MSC_VER)
+
+ #define AWS_UNREFERENCED_PARAM(x) (&reinterpret_cast<const int &>(x))
+
+#else
+
+ #define AWS_UNREFERENCED_PARAM(x) ((void)(x))
+
+#endif // _MSC_VER
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/base64/Base64.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/base64/Base64.h
index c4953b4b51..454d20c262 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/base64/Base64.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/base64/Base64.h
@@ -2,69 +2,69 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#ifdef __APPLE__
-
-#ifdef __clang__
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif // __clang__
-
-#ifdef __GNUC__
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif // __GNUC__
-
-#endif // __APPLE__
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/Array.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Base64
- {
-
- /**
- * interface for platform specific Base64 encoding/decoding.
- */
- class AWS_CORE_API Base64
- {
- public:
- Base64(const char *encodingTable = nullptr);
-
- /**
- * Encode a byte buffer into a base64 stream.
- *
- * throws Base64Exception if encoding fails.
- */
- Aws::String Encode(const ByteBuffer&) const;
-
- /**
- * Decode a base64 string into a byte buffer.
- */
- ByteBuffer Decode(const Aws::String&) const;
-
- /**
- * Calculates the required length of a base64 buffer after decoding the
- * input string.
- */
- static size_t CalculateBase64DecodedLength(const Aws::String& b64input);
- /**
- * Calculates the length of an encoded base64 string based on the buffer being encoded
- */
- static size_t CalculateBase64EncodedLength(const ByteBuffer& buffer);
-
- private:
- char m_mimeBase64EncodingTable[64];
- uint8_t m_mimeBase64DecodingTable[256];
-
- };
-
- } // namespace Base64
- } // namespace Utils
-} // namespace Aws
-
+
+#pragma once
+
+#ifdef __APPLE__
+
+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif // __clang__
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // __GNUC__
+
+#endif // __APPLE__
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/Array.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Base64
+ {
+
+ /**
+ * interface for platform specific Base64 encoding/decoding.
+ */
+ class AWS_CORE_API Base64
+ {
+ public:
+ Base64(const char *encodingTable = nullptr);
+
+ /**
+ * Encode a byte buffer into a base64 stream.
+ *
+ * throws Base64Exception if encoding fails.
+ */
+ Aws::String Encode(const ByteBuffer&) const;
+
+ /**
+ * Decode a base64 string into a byte buffer.
+ */
+ ByteBuffer Decode(const Aws::String&) const;
+
+ /**
+ * Calculates the required length of a base64 buffer after decoding the
+ * input string.
+ */
+ static size_t CalculateBase64DecodedLength(const Aws::String& b64input);
+ /**
+ * Calculates the length of an encoded base64 string based on the buffer being encoded
+ */
+ static size_t CalculateBase64EncodedLength(const ByteBuffer& buffer);
+
+ private:
+ char m_mimeBase64EncodingTable[64];
+ uint8_t m_mimeBase64DecodingTable[256];
+
+ };
+
+ } // namespace Base64
+ } // namespace Utils
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Cipher.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Cipher.h
index 5cabba55cf..fb31628b0e 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Cipher.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Cipher.h
@@ -2,205 +2,205 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/Array.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- static const size_t SYMMETRIC_KEY_LENGTH = 32;
- static const size_t MIN_IV_LENGTH = 12;
-
- AWS_CORE_API CryptoBuffer IncrementCTRCounter(const CryptoBuffer& counter, uint32_t numberOfBlocks);
-
- /**
- * Interface for symmetric encryption and decryption providers. An instance of this class is good for exactly one encryption or decryption run.
- * It should not be used to encrypt or decrypt multiple messages.
- */
- class AWS_CORE_API SymmetricCipher
- {
- public:
- /**
- * Initialize with key and an auto-generated initializationVector. Copies key.
- * ivGenerationInCtrMode, if true, initializes the iv with a 4 byte counter at the end.
- */
- SymmetricCipher(const CryptoBuffer& key, size_t ivSize, bool ivGenerationInCtrMode = false) :
- m_key(key),
- m_initializationVector(ivSize > 0 ? GenerateIV(ivSize, ivGenerationInCtrMode) : 0),
- m_failure(false)
- {
- }
-
- /**
- * Initialize with key and initializationVector, set tag for decryption of authenticated modes (makes copies of the buffers)
- */
- SymmetricCipher(const CryptoBuffer& key, const CryptoBuffer& initializationVector, const CryptoBuffer& tag = CryptoBuffer(0)) :
- m_key(key),
- m_initializationVector(initializationVector),
- m_tag(tag),
- m_failure(false)
- {
- }
-
- /**
- * Initialize with key and initializationVector, set tag for decryption of authenticated modes (move the buffers)
- */
- SymmetricCipher(CryptoBuffer&& key, CryptoBuffer&& initializationVector, CryptoBuffer&& tag = CryptoBuffer(0)) :
- m_key(std::move(key)),
- m_initializationVector(std::move(initializationVector)),
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/Array.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ static const size_t SYMMETRIC_KEY_LENGTH = 32;
+ static const size_t MIN_IV_LENGTH = 12;
+
+ AWS_CORE_API CryptoBuffer IncrementCTRCounter(const CryptoBuffer& counter, uint32_t numberOfBlocks);
+
+ /**
+ * Interface for symmetric encryption and decryption providers. An instance of this class is good for exactly one encryption or decryption run.
+ * It should not be used to encrypt or decrypt multiple messages.
+ */
+ class AWS_CORE_API SymmetricCipher
+ {
+ public:
+ /**
+ * Initialize with key and an auto-generated initializationVector. Copies key.
+ * ivGenerationInCtrMode, if true, initializes the iv with a 4 byte counter at the end.
+ */
+ SymmetricCipher(const CryptoBuffer& key, size_t ivSize, bool ivGenerationInCtrMode = false) :
+ m_key(key),
+ m_initializationVector(ivSize > 0 ? GenerateIV(ivSize, ivGenerationInCtrMode) : 0),
+ m_failure(false)
+ {
+ }
+
+ /**
+ * Initialize with key and initializationVector, set tag for decryption of authenticated modes (makes copies of the buffers)
+ */
+ SymmetricCipher(const CryptoBuffer& key, const CryptoBuffer& initializationVector, const CryptoBuffer& tag = CryptoBuffer(0)) :
+ m_key(key),
+ m_initializationVector(initializationVector),
+ m_tag(tag),
+ m_failure(false)
+ {
+ }
+
+ /**
+ * Initialize with key and initializationVector, set tag for decryption of authenticated modes (move the buffers)
+ */
+ SymmetricCipher(CryptoBuffer&& key, CryptoBuffer&& initializationVector, CryptoBuffer&& tag = CryptoBuffer(0)) :
+ m_key(std::move(key)),
+ m_initializationVector(std::move(initializationVector)),
m_tag(std::move(tag)),
- m_failure(false)
- {
- }
-
- SymmetricCipher(const SymmetricCipher& other) = delete;
- SymmetricCipher& operator=(const SymmetricCipher& other) = delete;
-
- /**
- * Normally we don't work around VS 2013 not auto-generating these, but they are kind of expensive,
- * so let's go ahead and optimize by defining default move operations. Implementors of this class
- * need to be sure to define the move operations and call the base class.
- */
- SymmetricCipher(SymmetricCipher&& toMove) :
- m_key(std::move(toMove.m_key)),
- m_initializationVector(std::move(toMove.m_initializationVector)),
- m_tag(std::move(toMove.m_tag)),
- m_failure(toMove.m_failure)
- {
- }
-
- /**
- * Normally we don't work around VS 2013 not auto-generating these, but they are kind of expensive,
- * so let's go ahead and optimize by defining default move operations. Implementors of this class
- * need to be sure to define the move operations and call the base class.
- */
- SymmetricCipher& operator=(SymmetricCipher&& toMove)
- {
- m_key = std::move(toMove.m_key);
- m_initializationVector = std::move(toMove.m_initializationVector);
- m_tag = std::move(toMove.m_tag);
- m_failure = toMove.m_failure;
-
- return *this;
- }
-
- virtual ~SymmetricCipher() = default;
-
- /**
- * Whether or not the cipher is in a good state. If this ever returns false, throw away all buffers
- * it has vended.
- */
- virtual operator bool() const { return Good(); }
-
- /**
+ m_failure(false)
+ {
+ }
+
+ SymmetricCipher(const SymmetricCipher& other) = delete;
+ SymmetricCipher& operator=(const SymmetricCipher& other) = delete;
+
+ /**
+ * Normally we don't work around VS 2013 not auto-generating these, but they are kind of expensive,
+ * so let's go ahead and optimize by defining default move operations. Implementors of this class
+ * need to be sure to define the move operations and call the base class.
+ */
+ SymmetricCipher(SymmetricCipher&& toMove) :
+ m_key(std::move(toMove.m_key)),
+ m_initializationVector(std::move(toMove.m_initializationVector)),
+ m_tag(std::move(toMove.m_tag)),
+ m_failure(toMove.m_failure)
+ {
+ }
+
+ /**
+ * Normally we don't work around VS 2013 not auto-generating these, but they are kind of expensive,
+ * so let's go ahead and optimize by defining default move operations. Implementors of this class
+ * need to be sure to define the move operations and call the base class.
+ */
+ SymmetricCipher& operator=(SymmetricCipher&& toMove)
+ {
+ m_key = std::move(toMove.m_key);
+ m_initializationVector = std::move(toMove.m_initializationVector);
+ m_tag = std::move(toMove.m_tag);
+ m_failure = toMove.m_failure;
+
+ return *this;
+ }
+
+ virtual ~SymmetricCipher() = default;
+
+ /**
+ * Whether or not the cipher is in a good state. If this ever returns false, throw away all buffers
+ * it has vended.
+ */
+ virtual operator bool() const { return Good(); }
+
+ /**
* Encrypt a buffer of data. Part of the contract for this interface is that intention that
- * a user call this function multiple times for a large stream. As such, multiple calls to this function
- * on the same instance should produce valid sequential output for an encrypted stream.
- */
- virtual CryptoBuffer EncryptBuffer( const CryptoBuffer& unEncryptedData) = 0;
-
- /**
- * Finalize Encryption, returns anything remaining in the last block
- */
- virtual CryptoBuffer FinalizeEncryption () = 0;
-
- /**
- * Decrypt a buffer of data. Part of the contract for this interface is that intention that
- * a user call this function multiple times for a large stream. As such, multiple calls to this function
- * on the same instance should produce valid sequential output from an encrypted stream.
- */
- virtual CryptoBuffer DecryptBuffer(const CryptoBuffer& encryptedData) = 0;
-
- /**
- * Finalize Decryption, returns anything remaining in the last block
- */
- virtual CryptoBuffer FinalizeDecryption () = 0;
-
- virtual void Reset() = 0;
-
- /**
- * IV used for encryption/decryption
- */
- inline const CryptoBuffer& GetIV() const { return m_initializationVector; }
-
- /**
- * Tag generated by encryption and used for the decryption.
- * This will be set in an authenticated mode, otherwise empty
- */
- inline const CryptoBuffer& GetTag() const { return m_tag; }
-
- inline bool Fail() const { return m_failure; }
- inline bool Good() const { return !Fail(); }
-
- /**
- * Generates a non-deterministic random IV. The first call is somewhat expensive but subsequent calls
- * should be fast. If ctrMode is true, it will pad nonce in the first 1/4 of the iv and initialize
- * the back 1/4 to 1.
- */
- static CryptoBuffer GenerateIV(size_t ivLengthBytes, bool ctrMode = false);
-
- /**
- * Generates a non-deterministic random symmetric key. Default (and minimum bar for security) is 256 bits.
- */
+ * a user call this function multiple times for a large stream. As such, multiple calls to this function
+ * on the same instance should produce valid sequential output for an encrypted stream.
+ */
+ virtual CryptoBuffer EncryptBuffer( const CryptoBuffer& unEncryptedData) = 0;
+
+ /**
+ * Finalize Encryption, returns anything remaining in the last block
+ */
+ virtual CryptoBuffer FinalizeEncryption () = 0;
+
+ /**
+ * Decrypt a buffer of data. Part of the contract for this interface is that intention that
+ * a user call this function multiple times for a large stream. As such, multiple calls to this function
+ * on the same instance should produce valid sequential output from an encrypted stream.
+ */
+ virtual CryptoBuffer DecryptBuffer(const CryptoBuffer& encryptedData) = 0;
+
+ /**
+ * Finalize Decryption, returns anything remaining in the last block
+ */
+ virtual CryptoBuffer FinalizeDecryption () = 0;
+
+ virtual void Reset() = 0;
+
+ /**
+ * IV used for encryption/decryption
+ */
+ inline const CryptoBuffer& GetIV() const { return m_initializationVector; }
+
+ /**
+ * Tag generated by encryption and used for the decryption.
+ * This will be set in an authenticated mode, otherwise empty
+ */
+ inline const CryptoBuffer& GetTag() const { return m_tag; }
+
+ inline bool Fail() const { return m_failure; }
+ inline bool Good() const { return !Fail(); }
+
+ /**
+ * Generates a non-deterministic random IV. The first call is somewhat expensive but subsequent calls
+ * should be fast. If ctrMode is true, it will pad nonce in the first 1/4 of the iv and initialize
+ * the back 1/4 to 1.
+ */
+ static CryptoBuffer GenerateIV(size_t ivLengthBytes, bool ctrMode = false);
+
+ /**
+ * Generates a non-deterministic random symmetric key. Default (and minimum bar for security) is 256 bits.
+ */
static CryptoBuffer GenerateKey(size_t keyLengthBytes = SYMMETRIC_KEY_LENGTH);
-
- protected:
-
- SymmetricCipher() : m_failure(false) {}
-
- CryptoBuffer m_key;
- CryptoBuffer m_initializationVector;
- CryptoBuffer m_tag;
- bool m_failure;
- };
-
- /**
- * Abstract factory class for Creating platform specific implementations of a Symmetric Cipher
- */
- class SymmetricCipherFactory
- {
- public:
- virtual ~SymmetricCipherFactory() {}
-
- /**
- * Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
- */
- virtual std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key) const = 0;
- /**
- * Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
- */
+
+ protected:
+
+ SymmetricCipher() : m_failure(false) {}
+
+ CryptoBuffer m_key;
+ CryptoBuffer m_initializationVector;
+ CryptoBuffer m_tag;
+ bool m_failure;
+ };
+
+ /**
+ * Abstract factory class for Creating platform specific implementations of a Symmetric Cipher
+ */
+ class SymmetricCipherFactory
+ {
+ public:
+ virtual ~SymmetricCipherFactory() {}
+
+ /**
+ * Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
+ */
+ virtual std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key) const = 0;
+ /**
+ * Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
+ */
virtual std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer*) const
{
return CreateImplementation(key);
}
- /**
- * Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
- */
+ /**
+ * Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
+ */
virtual std::shared_ptr<SymmetricCipher> CreateImplementation(const CryptoBuffer& key, const CryptoBuffer& iv, const CryptoBuffer& tag = CryptoBuffer(0), const CryptoBuffer& aad = CryptoBuffer(0)) const = 0;
/**
* Factory method. Returns cipher implementation. See the SymmetricCipher class for more details.
*/
virtual std::shared_ptr<SymmetricCipher> CreateImplementation(CryptoBuffer&& key, CryptoBuffer&& iv, CryptoBuffer&& tag = CryptoBuffer(0), CryptoBuffer&& aad = CryptoBuffer(0)) const = 0;
-
- /**
- * Only called once per factory, your chance to make static library calls for setup.
- * Default is no-op.
- */
- virtual void InitStaticState() {}
-
- /**
- * Only called once per factory, your chance to cleanup static library calls for setup.
- * Default is no-op.
- */
- virtual void CleanupStaticState() {}
- };
- }
- }
+
+ /**
+ * Only called once per factory, your chance to make static library calls for setup.
+ * Default is no-op.
+ */
+ virtual void InitStaticState() {}
+
+ /**
+ * Only called once per factory, your chance to cleanup static library calls for setup.
+ * Default is no-op.
+ */
+ virtual void CleanupStaticState() {}
+ };
+ }
+ }
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoMaterial.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoMaterial.h
index 525a7ac972..ea99798853 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoMaterial.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoMaterial.h
@@ -2,167 +2,167 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-
-#include <aws/core/Aws.h>
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/crypto/CryptoBuf.h>
-#include <aws/core/utils/crypto/ContentCryptoScheme.h>
-#include <aws/core/utils/crypto/KeyWrapAlgorithm.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- class AWS_CORE_API ContentCryptoMaterial
- {
- public:
- /*
- Default constructor.
- */
- ContentCryptoMaterial();
- /*
- Initialize content crypto material with content crypto scheme. Constructor will also generate the cek automatically.
- Since the creation of the crypto content material will be within the S3 crypto modules, only the crypto scheme is needed for initialization.
- The rest of the data will be set using the accessors below.
- */
- ContentCryptoMaterial(ContentCryptoScheme contentCryptoScheme);
-
- /*
+#pragma once
+
+#include <aws/core/Aws.h>
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/crypto/CryptoBuf.h>
+#include <aws/core/utils/crypto/ContentCryptoScheme.h>
+#include <aws/core/utils/crypto/KeyWrapAlgorithm.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ class AWS_CORE_API ContentCryptoMaterial
+ {
+ public:
+ /*
+ Default constructor.
+ */
+ ContentCryptoMaterial();
+ /*
+ Initialize content crypto material with content crypto scheme. Constructor will also generate the cek automatically.
+ Since the creation of the crypto content material will be within the S3 crypto modules, only the crypto scheme is needed for initialization.
+ The rest of the data will be set using the accessors below.
+ */
+ ContentCryptoMaterial(ContentCryptoScheme contentCryptoScheme);
+
+ /*
Initialize with content encryption key (cek) and content crypto scheme.
- */
- ContentCryptoMaterial(const Aws::Utils::CryptoBuffer& cek, ContentCryptoScheme contentCryptoScheme);
-
- /**
- * Gets the underlying content encryption key.
- */
- inline const Aws::Utils::CryptoBuffer& GetContentEncryptionKey() const
- {
- return m_contentEncryptionKey;
- }
-
- /**
- * Gets the underlying encrypted content encryption key.
- */
- inline const Aws::Utils::CryptoBuffer& GetEncryptedContentEncryptionKey() const
- {
- return m_encryptedContentEncryptionKey;
- }
-
- /**
- * Gets the underlying initialization vector
- */
- inline const Aws::Utils::CryptoBuffer& GetIV() const
- {
- return m_iv;
- }
-
- /**
- * Gets the underlying crypto tag length
- */
- inline size_t GetCryptoTagLength() const
- {
- return m_cryptoTagLength;
- }
-
- /**
- * Gets the underlying materials description map.
- */
- inline const Aws::Map<Aws::String, Aws::String>& GetMaterialsDescription() const
- {
- return m_materialsDescription;
- }
-
- /*
- * Gets the value of the key in the current materials description map.
- */
- inline const Aws::String& GetMaterialsDescription(const Aws::String& key) const
- {
- return m_materialsDescription.at(key);
- }
-
- /**
- * Gets the underlying key wrap algorithm
- */
- inline KeyWrapAlgorithm GetKeyWrapAlgorithm() const
- {
- return m_keyWrapAlgorithm;
- }
-
- /**
- * Gets the underlying content crypto scheme.
- */
- inline ContentCryptoScheme GetContentCryptoScheme() const
- {
- return m_contentCryptoScheme;
- }
-
- /**
- * Sets the underlying content encryption key. Copies from parameter content encryption key.
- */
- inline void SetContentEncryptionKey(const Aws::Utils::CryptoBuffer& contentEncryptionKey)
- {
- m_contentEncryptionKey = contentEncryptionKey;
- }
-
- /**
- * Sets the underlying encrypted content encryption key. Copies from parameter encrypted content encryption key.
- */
- inline void SetEncryptedContentEncryptionKey(const Aws::Utils::CryptoBuffer& encryptedContentEncryptionKey)
- {
- m_encryptedContentEncryptionKey = encryptedContentEncryptionKey;
- }
-
- /**
- * Sets the underlying iv. Copies from parameter iv.
- */
- inline void SetIV(const Aws::Utils::CryptoBuffer& iv)
- {
- m_iv = iv;
- }
-
- /**
- * Sets the underlying crypto Tag Length. Copies from parameter cryptoTagLength.
- */
- inline void SetCryptoTagLength(size_t cryptoTagLength)
- {
- m_cryptoTagLength = cryptoTagLength;
- }
-
- /**
- * Adds to the current materials description map using a key and a value.
- */
- inline void AddMaterialsDescription(const Aws::String& key, const Aws::String& value)
- {
- m_materialsDescription[key] = value;
- }
-
- /**
- * Sets the underlying materials description. Copies from parameter materials description.
- */
- inline void SetMaterialsDescription(const Aws::Map<Aws::String, Aws::String>& materialsDescription)
- {
- m_materialsDescription = materialsDescription;
- }
-
- /**
- * Sets the underlying Key Wrap Algorithm. Copies from parameter keyWrapAlgorithm.
- */
- inline void SetKeyWrapAlgorithm(KeyWrapAlgorithm keyWrapAlgorithm)
- {
- m_keyWrapAlgorithm = keyWrapAlgorithm;
- }
-
- /**
- * Sets the underlying content Crypto Scheme. Copies from parameter contentCryptoScheme.
- */
- inline void SetContentCryptoScheme(ContentCryptoScheme contentCryptoScheme)
- {
- m_contentCryptoScheme = contentCryptoScheme;
- }
-
+ */
+ ContentCryptoMaterial(const Aws::Utils::CryptoBuffer& cek, ContentCryptoScheme contentCryptoScheme);
+
+ /**
+ * Gets the underlying content encryption key.
+ */
+ inline const Aws::Utils::CryptoBuffer& GetContentEncryptionKey() const
+ {
+ return m_contentEncryptionKey;
+ }
+
+ /**
+ * Gets the underlying encrypted content encryption key.
+ */
+ inline const Aws::Utils::CryptoBuffer& GetEncryptedContentEncryptionKey() const
+ {
+ return m_encryptedContentEncryptionKey;
+ }
+
+ /**
+ * Gets the underlying initialization vector
+ */
+ inline const Aws::Utils::CryptoBuffer& GetIV() const
+ {
+ return m_iv;
+ }
+
+ /**
+ * Gets the underlying crypto tag length
+ */
+ inline size_t GetCryptoTagLength() const
+ {
+ return m_cryptoTagLength;
+ }
+
+ /**
+ * Gets the underlying materials description map.
+ */
+ inline const Aws::Map<Aws::String, Aws::String>& GetMaterialsDescription() const
+ {
+ return m_materialsDescription;
+ }
+
+ /*
+ * Gets the value of the key in the current materials description map.
+ */
+ inline const Aws::String& GetMaterialsDescription(const Aws::String& key) const
+ {
+ return m_materialsDescription.at(key);
+ }
+
+ /**
+ * Gets the underlying key wrap algorithm
+ */
+ inline KeyWrapAlgorithm GetKeyWrapAlgorithm() const
+ {
+ return m_keyWrapAlgorithm;
+ }
+
+ /**
+ * Gets the underlying content crypto scheme.
+ */
+ inline ContentCryptoScheme GetContentCryptoScheme() const
+ {
+ return m_contentCryptoScheme;
+ }
+
+ /**
+ * Sets the underlying content encryption key. Copies from parameter content encryption key.
+ */
+ inline void SetContentEncryptionKey(const Aws::Utils::CryptoBuffer& contentEncryptionKey)
+ {
+ m_contentEncryptionKey = contentEncryptionKey;
+ }
+
+ /**
+ * Sets the underlying encrypted content encryption key. Copies from parameter encrypted content encryption key.
+ */
+ inline void SetEncryptedContentEncryptionKey(const Aws::Utils::CryptoBuffer& encryptedContentEncryptionKey)
+ {
+ m_encryptedContentEncryptionKey = encryptedContentEncryptionKey;
+ }
+
+ /**
+ * Sets the underlying iv. Copies from parameter iv.
+ */
+ inline void SetIV(const Aws::Utils::CryptoBuffer& iv)
+ {
+ m_iv = iv;
+ }
+
+ /**
+ * Sets the underlying crypto Tag Length. Copies from parameter cryptoTagLength.
+ */
+ inline void SetCryptoTagLength(size_t cryptoTagLength)
+ {
+ m_cryptoTagLength = cryptoTagLength;
+ }
+
+ /**
+ * Adds to the current materials description map using a key and a value.
+ */
+ inline void AddMaterialsDescription(const Aws::String& key, const Aws::String& value)
+ {
+ m_materialsDescription[key] = value;
+ }
+
+ /**
+ * Sets the underlying materials description. Copies from parameter materials description.
+ */
+ inline void SetMaterialsDescription(const Aws::Map<Aws::String, Aws::String>& materialsDescription)
+ {
+ m_materialsDescription = materialsDescription;
+ }
+
+ /**
+ * Sets the underlying Key Wrap Algorithm. Copies from parameter keyWrapAlgorithm.
+ */
+ inline void SetKeyWrapAlgorithm(KeyWrapAlgorithm keyWrapAlgorithm)
+ {
+ m_keyWrapAlgorithm = keyWrapAlgorithm;
+ }
+
+ /**
+ * Sets the underlying content Crypto Scheme. Copies from parameter contentCryptoScheme.
+ */
+ inline void SetContentCryptoScheme(ContentCryptoScheme contentCryptoScheme)
+ {
+ m_contentCryptoScheme = contentCryptoScheme;
+ }
+
/**
* Sets the underlying AAD for GCM if needed.
*/
@@ -223,22 +223,22 @@ namespace Aws
return m_finalCEK;
}
- private:
- Aws::Utils::CryptoBuffer m_contentEncryptionKey;
- Aws::Utils::CryptoBuffer m_encryptedContentEncryptionKey;
+ private:
+ Aws::Utils::CryptoBuffer m_contentEncryptionKey;
+ Aws::Utils::CryptoBuffer m_encryptedContentEncryptionKey;
/* if using AES_GCM key wrap algorithm, then final CEK is iv + encrypted_key + tag
* otherwise it's the same as m_encryptedContentEncryptionKey
*/
Aws::Utils::CryptoBuffer m_finalCEK;
- Aws::Utils::CryptoBuffer m_iv;
+ Aws::Utils::CryptoBuffer m_iv;
Aws::Utils::CryptoBuffer m_cekIV;
Aws::Utils::CryptoBuffer m_gcmAAD;
Aws::Utils::CryptoBuffer m_cekGCMTag;
- size_t m_cryptoTagLength;
- Aws::Map<Aws::String, Aws::String> m_materialsDescription;
- KeyWrapAlgorithm m_keyWrapAlgorithm;
- ContentCryptoScheme m_contentCryptoScheme;
- };
- }
- }
+ size_t m_cryptoTagLength;
+ Aws::Map<Aws::String, Aws::String> m_materialsDescription;
+ KeyWrapAlgorithm m_keyWrapAlgorithm;
+ ContentCryptoScheme m_contentCryptoScheme;
+ };
+ }
+ }
}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoScheme.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoScheme.h
index 6d89da6585..605ad4e375 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoScheme.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/ContentCryptoScheme.h
@@ -2,31 +2,31 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- enum class ContentCryptoScheme
- {
- CBC,
- CTR,
- GCM,
- NONE
- };
-
- namespace ContentCryptoSchemeMapper
- {
- AWS_CORE_API ContentCryptoScheme GetContentCryptoSchemeForName(const Aws::String& name);
-
- AWS_CORE_API Aws::String GetNameForContentCryptoScheme(ContentCryptoScheme enumValue);
- }
- } //namespace Crypto
-
- }//namespace Utils
-}//namespace Aws \ No newline at end of file
+#pragma once
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ enum class ContentCryptoScheme
+ {
+ CBC,
+ CTR,
+ GCM,
+ NONE
+ };
+
+ namespace ContentCryptoSchemeMapper
+ {
+ AWS_CORE_API ContentCryptoScheme GetContentCryptoSchemeForName(const Aws::String& name);
+
+ AWS_CORE_API Aws::String GetNameForContentCryptoScheme(ContentCryptoScheme enumValue);
+ }
+ } //namespace Crypto
+
+ }//namespace Utils
+}//namespace Aws \ No newline at end of file
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoBuf.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoBuf.h
index 3d4b2b7436..1270c6b427 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoBuf.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoBuf.h
@@ -2,148 +2,148 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-
-#include <aws/core/utils/crypto/Cipher.h>
-#include <aws/core/Core_EXPORTS.h>
-#include <ios>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- typedef std::mbstate_t FPOS_TYPE;
- static const size_t DEFAULT_BUF_SIZE = 1024;
- static const size_t PUT_BACK_SIZE = 1;
-
- /**
- * Which mode a cipher is being used for. Encryption or Decryption
- */
- enum class CipherMode
- {
- Encrypt,
- Decrypt
- };
-
- /**
- * Generic base class for a streambuf that handles cryptography.
- */
- class AWS_CORE_API CryptoBuf : public std::streambuf
- {
- public:
- CryptoBuf() = default;
- virtual ~CryptoBuf() = default;
- CryptoBuf(const CryptoBuf&) = delete;
- CryptoBuf(CryptoBuf&& rhs) = delete;
- /**
- * If the buffer needs to do a final push to the sink or needs to empty the cipher blocks etc...
- */
- virtual void Finalize() {}
- };
-
- /**
- * StreamBuf that takes data from an input stream, encrypts or decrypts it, and causes all input received from the stream that is using it
- * to go through the cipher. A common use case is a file that is encrypted on disk being read via ifstream and then read decrypted into memory.
- * Or you could send a plain text file through an iostream and have it encrypted when the stream is read.
- *
- * This streambuf is seekable, but it is very expensive to seek backwards since we have to reset the cipher and re-encrypt everything up to that point.
- * So seeking should be avoided if at all possible.
- */
- class AWS_CORE_API SymmetricCryptoBufSrc : public CryptoBuf
- {
- public:
- /**
- * stream to src from
- * cipher to encrypt or decrypt the src stream with
+#pragma once
+
+#include <aws/core/utils/crypto/Cipher.h>
+#include <aws/core/Core_EXPORTS.h>
+#include <ios>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ typedef std::mbstate_t FPOS_TYPE;
+ static const size_t DEFAULT_BUF_SIZE = 1024;
+ static const size_t PUT_BACK_SIZE = 1;
+
+ /**
+ * Which mode a cipher is being used for. Encryption or Decryption
+ */
+ enum class CipherMode
+ {
+ Encrypt,
+ Decrypt
+ };
+
+ /**
+ * Generic base class for a streambuf that handles cryptography.
+ */
+ class AWS_CORE_API CryptoBuf : public std::streambuf
+ {
+ public:
+ CryptoBuf() = default;
+ virtual ~CryptoBuf() = default;
+ CryptoBuf(const CryptoBuf&) = delete;
+ CryptoBuf(CryptoBuf&& rhs) = delete;
+ /**
+ * If the buffer needs to do a final push to the sink or needs to empty the cipher blocks etc...
+ */
+ virtual void Finalize() {}
+ };
+
+ /**
+ * StreamBuf that takes data from an input stream, encrypts or decrypts it, and causes all input received from the stream that is using it
+ * to go through the cipher. A common use case is a file that is encrypted on disk being read via ifstream and then read decrypted into memory.
+ * Or you could send a plain text file through an iostream and have it encrypted when the stream is read.
+ *
+ * This streambuf is seekable, but it is very expensive to seek backwards since we have to reset the cipher and re-encrypt everything up to that point.
+ * So seeking should be avoided if at all possible.
+ */
+ class AWS_CORE_API SymmetricCryptoBufSrc : public CryptoBuf
+ {
+ public:
+ /**
+ * stream to src from
+ * cipher to encrypt or decrypt the src stream with
* mode to use cipher in. Encryption or Decryption
- * buffersize, the size of the src buffers to read at a time. Defaults to 1kb
- */
- SymmetricCryptoBufSrc(Aws::IStream& stream, SymmetricCipher& cipher, CipherMode cipherMode, size_t bufferSize = DEFAULT_BUF_SIZE);
-
- SymmetricCryptoBufSrc(const SymmetricCryptoBufSrc&) = delete;
- SymmetricCryptoBufSrc(SymmetricCryptoBufSrc&&) = delete;
-
- SymmetricCryptoBufSrc& operator=(const SymmetricCryptoBufSrc&) = delete;
- SymmetricCryptoBufSrc& operator=(SymmetricCryptoBufSrc&&) = delete;
-
- virtual ~SymmetricCryptoBufSrc() { FinalizeCipher(); }
-
- /**
- * This call isn't necessary if you loop over the stream.read until you reach EOF, if you happen to read the exact
- * amount as the in memory buffers and finish the stream, but never finish the finalize call you'll need to be sure
- * to call this. This is automatically called by the destructor.
- */
- void Finalize() override { FinalizeCipher(); }
-
- protected:
- pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out ) override;
- pos_type seekpos(pos_type pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out ) override;
-
- private:
- int_type underflow() override;
- off_type ComputeAbsSeekPosition(off_type, std::ios_base::seekdir, std::fpos<FPOS_TYPE>);
- void FinalizeCipher();
-
- CryptoBuffer m_isBuf;
- SymmetricCipher& m_cipher;
- Aws::IStream& m_stream;
- CipherMode m_cipherMode;
- bool m_isFinalized;
- size_t m_bufferSize;
- size_t m_putBack;
- };
-
- /**
- * Stream buf that takes it's input, encrypts or decrypts it using the cipher, and writes it to the sink stream. This is particularly useful
- * when receiving an encrypted file over the internet and writing it decrypted to disk. Another case may be that you have an ofstream and you want
- * to write text to it from your program but have it go encrypted to disk.
- *
- * This stream buf is not seekable.
- */
- class AWS_CORE_API SymmetricCryptoBufSink : public CryptoBuf
- {
- public:
- /**
- * stream, sink to push the encrypted or decrypted data to.
- * cipher, symmetric cipher to use to transform the input before sending it to the sink.
- * cipherMode, encrypt or decrypt
- * bufferSize, amount of data to encrypt/decrypt at a time.
- */
- SymmetricCryptoBufSink(Aws::OStream& stream, SymmetricCipher& cipher, CipherMode cipherMode, size_t bufferSize = DEFAULT_BUF_SIZE, int16_t blockOffset = 0);
- SymmetricCryptoBufSink(const SymmetricCryptoBufSink&) = delete;
- SymmetricCryptoBufSink(SymmetricCryptoBufSink&&) = delete;
-
- SymmetricCryptoBufSink& operator=(const SymmetricCryptoBufSink&) = delete;
- /**
- * Not move assignable since it contains reference members
- */
- SymmetricCryptoBufSink& operator=(SymmetricCryptoBufSink&&) = delete;
-
- virtual ~SymmetricCryptoBufSink();
-
- /**
- * Finalizes the cipher and pushes all remaining data to the sink. Once this has been called, this streambuf cannot be used any further.
- */
- void FinalizeCiphersAndFlushSink();
- /**
- * Simply calls FinalizeCiphersAndFlushSink()
- */
- void Finalize() override { FinalizeCiphersAndFlushSink(); }
-
- private:
- int_type overflow(int_type ch) override;
- int sync() override;
- bool writeOutput(bool finalize);
-
- CryptoBuffer m_osBuf;
- SymmetricCipher& m_cipher;
- Aws::OStream& m_stream;
- CipherMode m_cipherMode;
- bool m_isFinalized;
- int16_t m_blockOffset;
- };
- }
- }
-}
+ * buffersize, the size of the src buffers to read at a time. Defaults to 1kb
+ */
+ SymmetricCryptoBufSrc(Aws::IStream& stream, SymmetricCipher& cipher, CipherMode cipherMode, size_t bufferSize = DEFAULT_BUF_SIZE);
+
+ SymmetricCryptoBufSrc(const SymmetricCryptoBufSrc&) = delete;
+ SymmetricCryptoBufSrc(SymmetricCryptoBufSrc&&) = delete;
+
+ SymmetricCryptoBufSrc& operator=(const SymmetricCryptoBufSrc&) = delete;
+ SymmetricCryptoBufSrc& operator=(SymmetricCryptoBufSrc&&) = delete;
+
+ virtual ~SymmetricCryptoBufSrc() { FinalizeCipher(); }
+
+ /**
+ * This call isn't necessary if you loop over the stream.read until you reach EOF, if you happen to read the exact
+ * amount as the in memory buffers and finish the stream, but never finish the finalize call you'll need to be sure
+ * to call this. This is automatically called by the destructor.
+ */
+ void Finalize() override { FinalizeCipher(); }
+
+ protected:
+ pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out ) override;
+ pos_type seekpos(pos_type pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out ) override;
+
+ private:
+ int_type underflow() override;
+ off_type ComputeAbsSeekPosition(off_type, std::ios_base::seekdir, std::fpos<FPOS_TYPE>);
+ void FinalizeCipher();
+
+ CryptoBuffer m_isBuf;
+ SymmetricCipher& m_cipher;
+ Aws::IStream& m_stream;
+ CipherMode m_cipherMode;
+ bool m_isFinalized;
+ size_t m_bufferSize;
+ size_t m_putBack;
+ };
+
+ /**
+ * Stream buf that takes it's input, encrypts or decrypts it using the cipher, and writes it to the sink stream. This is particularly useful
+ * when receiving an encrypted file over the internet and writing it decrypted to disk. Another case may be that you have an ofstream and you want
+ * to write text to it from your program but have it go encrypted to disk.
+ *
+ * This stream buf is not seekable.
+ */
+ class AWS_CORE_API SymmetricCryptoBufSink : public CryptoBuf
+ {
+ public:
+ /**
+ * stream, sink to push the encrypted or decrypted data to.
+ * cipher, symmetric cipher to use to transform the input before sending it to the sink.
+ * cipherMode, encrypt or decrypt
+ * bufferSize, amount of data to encrypt/decrypt at a time.
+ */
+ SymmetricCryptoBufSink(Aws::OStream& stream, SymmetricCipher& cipher, CipherMode cipherMode, size_t bufferSize = DEFAULT_BUF_SIZE, int16_t blockOffset = 0);
+ SymmetricCryptoBufSink(const SymmetricCryptoBufSink&) = delete;
+ SymmetricCryptoBufSink(SymmetricCryptoBufSink&&) = delete;
+
+ SymmetricCryptoBufSink& operator=(const SymmetricCryptoBufSink&) = delete;
+ /**
+ * Not move assignable since it contains reference members
+ */
+ SymmetricCryptoBufSink& operator=(SymmetricCryptoBufSink&&) = delete;
+
+ virtual ~SymmetricCryptoBufSink();
+
+ /**
+ * Finalizes the cipher and pushes all remaining data to the sink. Once this has been called, this streambuf cannot be used any further.
+ */
+ void FinalizeCiphersAndFlushSink();
+ /**
+ * Simply calls FinalizeCiphersAndFlushSink()
+ */
+ void Finalize() override { FinalizeCiphersAndFlushSink(); }
+
+ private:
+ int_type overflow(int_type ch) override;
+ int sync() override;
+ bool writeOutput(bool finalize);
+
+ CryptoBuffer m_osBuf;
+ SymmetricCipher& m_cipher;
+ Aws::OStream& m_stream;
+ CipherMode m_cipherMode;
+ bool m_isFinalized;
+ int16_t m_blockOffset;
+ };
+ }
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoStream.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoStream.h
index 68178c32d4..048d44392e 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoStream.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/CryptoStream.h
@@ -2,80 +2,80 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-
-#include <aws/core/utils/crypto/CryptoBuf.h>
-#include <aws/core/Core_EXPORTS.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- /**
- * IOStream that can either take a src buffer as an input stream and create a wrapper iostream that can be used to receive encrypted or decrypted
- * input.
- *
- * A common use case is a file that is encrypted on disk being read via ifstream and then read decrypted into memory.
- * Or you could send a plain text file through an iostream and have it encrypted when the stream is read.
- *
+#pragma once
+
+#include <aws/core/utils/crypto/CryptoBuf.h>
+#include <aws/core/Core_EXPORTS.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ /**
+ * IOStream that can either take a src buffer as an input stream and create a wrapper iostream that can be used to receive encrypted or decrypted
+ * input.
+ *
+ * A common use case is a file that is encrypted on disk being read via ifstream and then read decrypted into memory.
+ * Or you could send a plain text file through an iostream and have it encrypted when the stream is read.
+ *
* This stream is seekable, but it is very expensive to seek backwards since we have to reset the cipher and re-encrypt everything up to that point.
- * So seeking should be avoided if at all possible.
- *
- * Or it can be used in the opposite direction where the stream is a sink and all input to the stream will be encrypted or decrypted and then sent to the
- * sink stream.
- *
- * This is particularly useful
- * when receiving an encrypted file over the internet and writing it decrypted to disk. Another case may be that you have an ofstream and you want
- * to write text to it from your program but have it go encrypted to disk.
- *
- * In output mode, this stream is not seekable.
- */
- class AWS_CORE_API SymmetricCryptoStream : public Aws::IOStream
- {
- public:
- /**
- * src stream to read from and encrypt or decrypt in transit
- * mode of operation for cipher encryption or decryption
- * cipher to use on the data
- */
- SymmetricCryptoStream(Aws::IStream& src, CipherMode mode, SymmetricCipher& cipher, size_t bufLen = DEFAULT_BUF_SIZE);
- /**
- * sink stream to write the data to and encrypt or decrypt in transit
- * mode of operation for cipher encryption or decryption
- * cipher to use on the data
- */
- SymmetricCryptoStream(Aws::OStream& sink, CipherMode mode, SymmetricCipher& cipher, size_t bufLen = DEFAULT_BUF_SIZE, int16_t blockOffset = 0 );
- /**
- * bufSrc streambuf to use
- */
- SymmetricCryptoStream(Aws::Utils::Crypto::SymmetricCryptoBufSrc& bufSrc);
- /**
- * bufSink streambuf to use
- */
- SymmetricCryptoStream(Aws::Utils::Crypto::SymmetricCryptoBufSink& bufSink);
-
- SymmetricCryptoStream(const SymmetricCryptoStream&) = delete;
- SymmetricCryptoStream(SymmetricCryptoStream&&) = delete;
-
- virtual ~SymmetricCryptoStream();
-
- SymmetricCryptoStream& operator=(const SymmetricCryptoStream&) = delete;
- SymmetricCryptoStream& operator=(SymmetricCryptoStream&&) = delete;
-
-
- /**
- * Call this in output stream mode when you want to flush the output to file.
- * It will be called by the destructor, but if you want to sync before then, call this method.
- * This stream is unusable after this method has been called.
- */
- void Finalize();
-
- private:
- CryptoBuf* m_cryptoBuf;
- bool m_hasOwnership;
- };
- }
- }
-} \ No newline at end of file
+ * So seeking should be avoided if at all possible.
+ *
+ * Or it can be used in the opposite direction where the stream is a sink and all input to the stream will be encrypted or decrypted and then sent to the
+ * sink stream.
+ *
+ * This is particularly useful
+ * when receiving an encrypted file over the internet and writing it decrypted to disk. Another case may be that you have an ofstream and you want
+ * to write text to it from your program but have it go encrypted to disk.
+ *
+ * In output mode, this stream is not seekable.
+ */
+ class AWS_CORE_API SymmetricCryptoStream : public Aws::IOStream
+ {
+ public:
+ /**
+ * src stream to read from and encrypt or decrypt in transit
+ * mode of operation for cipher encryption or decryption
+ * cipher to use on the data
+ */
+ SymmetricCryptoStream(Aws::IStream& src, CipherMode mode, SymmetricCipher& cipher, size_t bufLen = DEFAULT_BUF_SIZE);
+ /**
+ * sink stream to write the data to and encrypt or decrypt in transit
+ * mode of operation for cipher encryption or decryption
+ * cipher to use on the data
+ */
+ SymmetricCryptoStream(Aws::OStream& sink, CipherMode mode, SymmetricCipher& cipher, size_t bufLen = DEFAULT_BUF_SIZE, int16_t blockOffset = 0 );
+ /**
+ * bufSrc streambuf to use
+ */
+ SymmetricCryptoStream(Aws::Utils::Crypto::SymmetricCryptoBufSrc& bufSrc);
+ /**
+ * bufSink streambuf to use
+ */
+ SymmetricCryptoStream(Aws::Utils::Crypto::SymmetricCryptoBufSink& bufSink);
+
+ SymmetricCryptoStream(const SymmetricCryptoStream&) = delete;
+ SymmetricCryptoStream(SymmetricCryptoStream&&) = delete;
+
+ virtual ~SymmetricCryptoStream();
+
+ SymmetricCryptoStream& operator=(const SymmetricCryptoStream&) = delete;
+ SymmetricCryptoStream& operator=(SymmetricCryptoStream&&) = delete;
+
+
+ /**
+ * Call this in output stream mode when you want to flush the output to file.
+ * It will be called by the destructor, but if you want to sync before then, call this method.
+ * This stream is unusable after this method has been called.
+ */
+ void Finalize();
+
+ private:
+ CryptoBuf* m_cryptoBuf;
+ bool m_hasOwnership;
+ };
+ }
+ }
+} \ No newline at end of file
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/EncryptionMaterials.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/EncryptionMaterials.h
index 22116c400f..0fbc77c6b4 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/EncryptionMaterials.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/EncryptionMaterials.h
@@ -2,45 +2,45 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/crypto/CryptoBuf.h>
-#include <aws/core/utils/Outcome.h>
-#include <aws/core/client/AWSError.h>
-#include <aws/core/utils/crypto/ContentCryptoMaterial.h>
-#include <aws/core/NoResult.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- enum class CryptoErrors
- {
- ENCRYPT_CONTENT_ENCRYPTION_KEY_FAILED,
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/crypto/CryptoBuf.h>
+#include <aws/core/utils/Outcome.h>
+#include <aws/core/client/AWSError.h>
+#include <aws/core/utils/crypto/ContentCryptoMaterial.h>
+#include <aws/core/NoResult.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ enum class CryptoErrors
+ {
+ ENCRYPT_CONTENT_ENCRYPTION_KEY_FAILED,
DECRYPT_CONTENT_ENCRYPTION_KEY_FAILED,
GENERATE_CONTENT_ENCRYPTION_KEY_FAILED
- };
-
- typedef Outcome<Aws::NoResult, Aws::Client::AWSError<CryptoErrors>> CryptoOutcome;
-
- class AWS_CORE_API EncryptionMaterials
- {
- public:
- virtual ~EncryptionMaterials();
-
- /*
- * Override this method to control how to encrypt the content encryption key (CEK). This occurs in place.
- */
- virtual CryptoOutcome EncryptCEK(ContentCryptoMaterial& contentCryptoMaterial) = 0;
-
- /*
- * Override this method to control how to decrypt the content encryption key (CEK). This occurs in place.
- */
- virtual CryptoOutcome DecryptCEK(ContentCryptoMaterial& contentCryptoMaterial) = 0;
- };
- }//namespace Crypto
- }//namespace Utils
-}//namespace Aws
+ };
+
+ typedef Outcome<Aws::NoResult, Aws::Client::AWSError<CryptoErrors>> CryptoOutcome;
+
+ class AWS_CORE_API EncryptionMaterials
+ {
+ public:
+ virtual ~EncryptionMaterials();
+
+ /*
+ * Override this method to control how to encrypt the content encryption key (CEK). This occurs in place.
+ */
+ virtual CryptoOutcome EncryptCEK(ContentCryptoMaterial& contentCryptoMaterial) = 0;
+
+ /*
+ * Override this method to control how to decrypt the content encryption key (CEK). This occurs in place.
+ */
+ virtual CryptoOutcome DecryptCEK(ContentCryptoMaterial& contentCryptoMaterial) = 0;
+ };
+ }//namespace Crypto
+ }//namespace Utils
+}//namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Factories.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Factories.h
index ff4eceb6eb..b4c17b2a96 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Factories.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Factories.h
@@ -2,146 +2,146 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/Array.h>
-#include <memory>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- class Hash;
- class HMAC;
- class SymmetricCipher;
- class HashFactory;
- class HMACFactory;
- class SymmetricCipherFactory;
- class SecureRandomBytes;
- class SecureRandomFactory;
-
- /**
- * You need to call this before using any of the cryptography libs. Should be called after setting the factories.
- */
- AWS_CORE_API void InitCrypto();
- /**
- * You need to call this upon program shutdown.
- */
- AWS_CORE_API void CleanupCrypto();
- /**
- * OpenSSL infects everything with its global state. If it is being used then we automatically initialize and clean it up.
- * If this is a problem for you, set this to false. Be aware that if you don't use our init and cleanup and you are using
- * crypto functionality, you are responsible for installing thread locking, and loading strings and error messages.
- */
- AWS_CORE_API void SetInitCleanupOpenSSLFlag(bool initCleanupFlag);
-
- /**
- * Create an MD5 Hash provider
- */
- AWS_CORE_API std::shared_ptr<Hash> CreateMD5Implementation();
- /**
- * Create a Sha256 Hash provider
- */
- AWS_CORE_API std::shared_ptr<Hash> CreateSha256Implementation();
- /**
- * Create a Sha256 HMACHash provider
- */
- AWS_CORE_API std::shared_ptr<HMAC> CreateSha256HMACImplementation();
-
- /**
- * Create AES in CBC mode off of a 256 bit key. Auto Generates a 16 byte secure random IV
- */
- AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CBCImplementation(const CryptoBuffer& key);
- /**
- * Create AES in CBC mode off of a 256 bit key and 16 byte IV
- */
- AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CBCImplementation(const CryptoBuffer& key, const CryptoBuffer& iv);
- /**
- * Create AES in CBC mode off of a 256 bit key and 16 byte IV
- */
- AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CBCImplementation(CryptoBuffer&& key, CryptoBuffer&& iv);
-
- /**
- * Create AES in CTR mode off of a 256 bit key. Auto Generates a 16 byte IV in the format
- * [nonce 4bytes ] [securely random iv 8 bytes] [ CTR init 4bytes ]
- */
- AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CTRImplementation(const CryptoBuffer& key);
- /**
- * Create AES in CTR mode off of a 256 bit key and 16 byte IV
- */
- AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CTRImplementation(const CryptoBuffer& key, const CryptoBuffer& iv);
- /**
- * Create AES in CTR mode off of a 256 bit key and 16 byte IV
- */
- AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CTRImplementation(CryptoBuffer&& key, CryptoBuffer&& iv);
-
- /**
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/Array.h>
+#include <memory>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ class Hash;
+ class HMAC;
+ class SymmetricCipher;
+ class HashFactory;
+ class HMACFactory;
+ class SymmetricCipherFactory;
+ class SecureRandomBytes;
+ class SecureRandomFactory;
+
+ /**
+ * You need to call this before using any of the cryptography libs. Should be called after setting the factories.
+ */
+ AWS_CORE_API void InitCrypto();
+ /**
+ * You need to call this upon program shutdown.
+ */
+ AWS_CORE_API void CleanupCrypto();
+ /**
+ * OpenSSL infects everything with its global state. If it is being used then we automatically initialize and clean it up.
+ * If this is a problem for you, set this to false. Be aware that if you don't use our init and cleanup and you are using
+ * crypto functionality, you are responsible for installing thread locking, and loading strings and error messages.
+ */
+ AWS_CORE_API void SetInitCleanupOpenSSLFlag(bool initCleanupFlag);
+
+ /**
+ * Create an MD5 Hash provider
+ */
+ AWS_CORE_API std::shared_ptr<Hash> CreateMD5Implementation();
+ /**
+ * Create a Sha256 Hash provider
+ */
+ AWS_CORE_API std::shared_ptr<Hash> CreateSha256Implementation();
+ /**
+ * Create a Sha256 HMACHash provider
+ */
+ AWS_CORE_API std::shared_ptr<HMAC> CreateSha256HMACImplementation();
+
+ /**
+ * Create AES in CBC mode off of a 256 bit key. Auto Generates a 16 byte secure random IV
+ */
+ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CBCImplementation(const CryptoBuffer& key);
+ /**
+ * Create AES in CBC mode off of a 256 bit key and 16 byte IV
+ */
+ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CBCImplementation(const CryptoBuffer& key, const CryptoBuffer& iv);
+ /**
+ * Create AES in CBC mode off of a 256 bit key and 16 byte IV
+ */
+ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CBCImplementation(CryptoBuffer&& key, CryptoBuffer&& iv);
+
+ /**
+ * Create AES in CTR mode off of a 256 bit key. Auto Generates a 16 byte IV in the format
+ * [nonce 4bytes ] [securely random iv 8 bytes] [ CTR init 4bytes ]
+ */
+ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CTRImplementation(const CryptoBuffer& key);
+ /**
+ * Create AES in CTR mode off of a 256 bit key and 16 byte IV
+ */
+ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CTRImplementation(const CryptoBuffer& key, const CryptoBuffer& iv);
+ /**
+ * Create AES in CTR mode off of a 256 bit key and 16 byte IV
+ */
+ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_CTRImplementation(CryptoBuffer&& key, CryptoBuffer&& iv);
+
+ /**
* Create AES in GCM mode off of a 256 bit key. Auto Generates a 12 byte secure random IV.
- */
- AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(const CryptoBuffer& key);
- /**
+ */
+ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(const CryptoBuffer& key);
+ /**
* Create AES in GCM mode off of a 256 bit key. Auto Generates a 12 byte secure random IV and aad.
*/
AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(const CryptoBuffer& key, const CryptoBuffer* aad);
/**
* Create AES in GCM mode off of a 256 bit key, a 12 byte secure random IV, and an optional 16 byte Tag. If you are using this
- * cipher to decrypt an encrypted payload, you must set the tag here.
- */
- AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(const CryptoBuffer& key, const CryptoBuffer& iv,
+ * cipher to decrypt an encrypted payload, you must set the tag here.
+ */
+ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(const CryptoBuffer& key, const CryptoBuffer& iv,
const CryptoBuffer& tag = CryptoBuffer(0), const CryptoBuffer& aad = CryptoBuffer(0));
- /**
+ /**
* Create AES in GCM mode off of a 256 bit key, a 16 byte secure random IV, and an optional 16 byte Tag, as well an optional add. If you are using this
- * cipher to decrypt an encrypted payload, you must set the tag here.
- */
- AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(CryptoBuffer&& key, CryptoBuffer&& iv,
+ * cipher to decrypt an encrypted payload, you must set the tag here.
+ */
+ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_GCMImplementation(CryptoBuffer&& key, CryptoBuffer&& iv,
CryptoBuffer&& tag = CryptoBuffer(0), CryptoBuffer&& aad = CryptoBuffer(0));
- /**
- * Create AES in Key Wrap mode off of a 256 bit key.
- */
- AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_KeyWrapImplementation(const CryptoBuffer& key);
-
- /**
- * Create SecureRandomBytes instance
- */
- AWS_CORE_API std::shared_ptr<SecureRandomBytes> CreateSecureRandomBytesImplementation();
-
- /**
- * Set the global factory for MD5 Hash providers
- */
- AWS_CORE_API void SetMD5Factory(const std::shared_ptr<HashFactory>& factory);
- /**
- * Set the global factory for Sha256 Hash providers
- */
- AWS_CORE_API void SetSha256Factory(const std::shared_ptr<HashFactory>& factory);
- /**
- * Set the global factory for Sha256 HMAC Hash providers
- */
- AWS_CORE_API void SetSha256HMACFactory(const std::shared_ptr<HMACFactory>& factory);
- /**
- * Set the global factory for AES in CBC mode providers
- */
- AWS_CORE_API void SetAES_CBCFactory(const std::shared_ptr<SymmetricCipherFactory>& factory);
- /**
- * Set the global factory for AES in CTR mode providers
- */
- AWS_CORE_API void SetAES_CTRFactory(const std::shared_ptr<SymmetricCipherFactory>& factory);
- /**
- * Set the global factory for AES in GCM mode providers
- */
- AWS_CORE_API void SetAES_GCMFactory(const std::shared_ptr<SymmetricCipherFactory>& factory);
- /**
- * Set the global factory for AES in Key Wrap mode providers
- */
- AWS_CORE_API void SetAES_KeyWrapFactory(const std::shared_ptr<SymmetricCipherFactory>& factory);
- /**
- * Set the global factory for secure random bytes
- */
- AWS_CORE_API void SetSecureRandomFactory(const std::shared_ptr<SecureRandomFactory>& factory);
-
- } // namespace Crypto
- } // namespace Utils
-} // namespace Aws
+ /**
+ * Create AES in Key Wrap mode off of a 256 bit key.
+ */
+ AWS_CORE_API std::shared_ptr<SymmetricCipher> CreateAES_KeyWrapImplementation(const CryptoBuffer& key);
+
+ /**
+ * Create SecureRandomBytes instance
+ */
+ AWS_CORE_API std::shared_ptr<SecureRandomBytes> CreateSecureRandomBytesImplementation();
+
+ /**
+ * Set the global factory for MD5 Hash providers
+ */
+ AWS_CORE_API void SetMD5Factory(const std::shared_ptr<HashFactory>& factory);
+ /**
+ * Set the global factory for Sha256 Hash providers
+ */
+ AWS_CORE_API void SetSha256Factory(const std::shared_ptr<HashFactory>& factory);
+ /**
+ * Set the global factory for Sha256 HMAC Hash providers
+ */
+ AWS_CORE_API void SetSha256HMACFactory(const std::shared_ptr<HMACFactory>& factory);
+ /**
+ * Set the global factory for AES in CBC mode providers
+ */
+ AWS_CORE_API void SetAES_CBCFactory(const std::shared_ptr<SymmetricCipherFactory>& factory);
+ /**
+ * Set the global factory for AES in CTR mode providers
+ */
+ AWS_CORE_API void SetAES_CTRFactory(const std::shared_ptr<SymmetricCipherFactory>& factory);
+ /**
+ * Set the global factory for AES in GCM mode providers
+ */
+ AWS_CORE_API void SetAES_GCMFactory(const std::shared_ptr<SymmetricCipherFactory>& factory);
+ /**
+ * Set the global factory for AES in Key Wrap mode providers
+ */
+ AWS_CORE_API void SetAES_KeyWrapFactory(const std::shared_ptr<SymmetricCipherFactory>& factory);
+ /**
+ * Set the global factory for secure random bytes
+ */
+ AWS_CORE_API void SetSecureRandomFactory(const std::shared_ptr<SecureRandomFactory>& factory);
+
+ } // namespace Crypto
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HMAC.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HMAC.h
index 9caa5033d7..450997c736 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HMAC.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HMAC.h
@@ -2,67 +2,67 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
- /*
- * Interface for Sha256 encryptor and hmac
- */
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/Array.h>
-#include <aws/core/utils/crypto/HashResult.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- /**
- * Interface for HMAC hash providers. To implement an HMAC provider, inherit from this class and override Calculate.
- */
- class AWS_CORE_API HMAC
- {
- public:
- HMAC() {};
- virtual ~HMAC() {};
-
- /**
- * Calculates an HMAC digest
- */
- virtual HashResult Calculate(const Aws::Utils::ByteBuffer& toSign, const Aws::Utils::ByteBuffer& secret) = 0;
-
- };
-
- /**
- * Simple abstract factory interface. Subclass this and create a factory if you want to control
- * how HMAC Hash objects are created.
- */
- class AWS_CORE_API HMACFactory
- {
- public:
- virtual ~HMACFactory() {}
-
- /**
- * Factory method. Returns hmac hash implementation.
- */
- virtual std::shared_ptr<HMAC> CreateImplementation() const = 0;
-
- /**
- * Opportunity to make any static initialization calls you need to make.
- * Will only be called once.
- */
- virtual void InitStaticState() {}
-
- /**
- * Opportunity to make any static cleanup calls you need to make.
- * will only be called at the end of the application.
- */
- virtual void CleanupStaticState() {}
- };
-
- } // namespace Crypto
- } // namespace Utils
-} // namespace Aws
-
+
+ /*
+ * Interface for Sha256 encryptor and hmac
+ */
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/Array.h>
+#include <aws/core/utils/crypto/HashResult.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ /**
+ * Interface for HMAC hash providers. To implement an HMAC provider, inherit from this class and override Calculate.
+ */
+ class AWS_CORE_API HMAC
+ {
+ public:
+ HMAC() {};
+ virtual ~HMAC() {};
+
+ /**
+ * Calculates an HMAC digest
+ */
+ virtual HashResult Calculate(const Aws::Utils::ByteBuffer& toSign, const Aws::Utils::ByteBuffer& secret) = 0;
+
+ };
+
+ /**
+ * Simple abstract factory interface. Subclass this and create a factory if you want to control
+ * how HMAC Hash objects are created.
+ */
+ class AWS_CORE_API HMACFactory
+ {
+ public:
+ virtual ~HMACFactory() {}
+
+ /**
+ * Factory method. Returns hmac hash implementation.
+ */
+ virtual std::shared_ptr<HMAC> CreateImplementation() const = 0;
+
+ /**
+ * Opportunity to make any static initialization calls you need to make.
+ * Will only be called once.
+ */
+ virtual void InitStaticState() {}
+
+ /**
+ * Opportunity to make any static cleanup calls you need to make.
+ * will only be called at the end of the application.
+ */
+ virtual void CleanupStaticState() {}
+ };
+
+ } // namespace Crypto
+ } // namespace Utils
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Hash.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Hash.h
index a60b5eba7a..8ebbe009fc 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Hash.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Hash.h
@@ -2,72 +2,72 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/crypto/HashResult.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- /**
- * Interface for computing hash codes using various hash algorithms
- */
- class AWS_CORE_API Hash
- {
- public:
-
- Hash() {}
- virtual ~Hash() {}
-
- /**
- * Calculates a Hash digest
- */
- virtual HashResult Calculate(const Aws::String& str) = 0;
-
- /**
- * Calculates a Hash digest on a stream (the entire stream is read)
- */
- virtual HashResult Calculate(Aws::IStream& stream) = 0;
-
- // when hashing streams, this is the size of our internal buffer we read the stream into
- static const uint32_t INTERNAL_HASH_STREAM_BUFFER_SIZE = 8192;
- };
-
- /**
- * Simple abstract factory interface. Subclass this and create a factory if you want to control
- * how Hash objects are created.
- */
- class AWS_CORE_API HashFactory
- {
- public:
- virtual ~HashFactory() {}
-
- /**
- * Factory method. Returns hash implementation.
- */
- virtual std::shared_ptr<Hash> CreateImplementation() const = 0;
-
- /**
- * Opportunity to make any static initialization calls you need to make.
- * Will only be called once.
- */
- virtual void InitStaticState() {}
-
- /**
- * Opportunity to make any static cleanup calls you need to make.
- * will only be called at the end of the application.
- */
- virtual void CleanupStaticState() {}
- };
-
- } // namespace Crypto
- } // namespace Utils
-} // namespace Aws
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/crypto/HashResult.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ /**
+ * Interface for computing hash codes using various hash algorithms
+ */
+ class AWS_CORE_API Hash
+ {
+ public:
+
+ Hash() {}
+ virtual ~Hash() {}
+
+ /**
+ * Calculates a Hash digest
+ */
+ virtual HashResult Calculate(const Aws::String& str) = 0;
+
+ /**
+ * Calculates a Hash digest on a stream (the entire stream is read)
+ */
+ virtual HashResult Calculate(Aws::IStream& stream) = 0;
+
+ // when hashing streams, this is the size of our internal buffer we read the stream into
+ static const uint32_t INTERNAL_HASH_STREAM_BUFFER_SIZE = 8192;
+ };
+
+ /**
+ * Simple abstract factory interface. Subclass this and create a factory if you want to control
+ * how Hash objects are created.
+ */
+ class AWS_CORE_API HashFactory
+ {
+ public:
+ virtual ~HashFactory() {}
+
+ /**
+ * Factory method. Returns hash implementation.
+ */
+ virtual std::shared_ptr<Hash> CreateImplementation() const = 0;
+
+ /**
+ * Opportunity to make any static initialization calls you need to make.
+ * Will only be called once.
+ */
+ virtual void InitStaticState() {}
+
+ /**
+ * Opportunity to make any static cleanup calls you need to make.
+ * will only be called at the end of the application.
+ */
+ virtual void CleanupStaticState() {}
+ };
+
+ } // namespace Crypto
+ } // namespace Utils
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HashResult.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HashResult.h
index 0831e1c132..46b46d8095 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HashResult.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/HashResult.h
@@ -2,24 +2,24 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/Array.h>
-
-namespace Aws
-{
- namespace Utils
- {
-
- template< typename R, typename E > class Outcome;
-
- namespace Crypto
- {
- using HashResult = Outcome< ByteBuffer, bool >;
-
- } // namespace Crypto
- } // namespace Utils
-} // namespace Aws
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/Array.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+
+ template< typename R, typename E > class Outcome;
+
+ namespace Crypto
+ {
+ using HashResult = Outcome< ByteBuffer, bool >;
+
+ } // namespace Crypto
+ } // namespace Utils
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/KeyWrapAlgorithm.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/KeyWrapAlgorithm.h
index 6702f5625d..0715f64740 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/KeyWrapAlgorithm.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/KeyWrapAlgorithm.h
@@ -2,32 +2,32 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- enum class KeyWrapAlgorithm
- {
+#pragma once
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ enum class KeyWrapAlgorithm
+ {
KMS, // Deprecated
KMS_CONTEXT,
AES_KEY_WRAP, // Deprecated
AES_GCM,
- NONE
- };
-
- namespace KeyWrapAlgorithmMapper
- {
- AWS_CORE_API KeyWrapAlgorithm GetKeyWrapAlgorithmForName(const Aws::String& name);
-
- AWS_CORE_API Aws::String GetNameForKeyWrapAlgorithm(KeyWrapAlgorithm enumValue);
- }
- } //namespace Crypto
-
- }//namespace Utils
-}//namespace Aws
+ NONE
+ };
+
+ namespace KeyWrapAlgorithmMapper
+ {
+ AWS_CORE_API KeyWrapAlgorithm GetKeyWrapAlgorithmForName(const Aws::String& name);
+
+ AWS_CORE_API Aws::String GetNameForKeyWrapAlgorithm(KeyWrapAlgorithm enumValue);
+ }
+ } //namespace Crypto
+
+ }//namespace Utils
+}//namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/MD5.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/MD5.h
index 115213e928..59304a4a88 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/MD5.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/MD5.h
@@ -2,65 +2,65 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
- /*
- * Interface for Sha256 encryptor and hmac
- */
-#pragma once
-
-#ifdef __APPLE__
-
-#ifdef __clang__
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif // __clang__
-
-#ifdef __GNUC__
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif // __GNUC__
-
-#endif // __APPLE__
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/crypto/Hash.h>
-#include <aws/core/utils/Outcome.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- class WindowsHashImpl;
-
- /**
- * Md5 hash implementation
- */
- class AWS_CORE_API MD5 : public Hash
- {
- public:
- /**
+
+ /*
+ * Interface for Sha256 encryptor and hmac
+ */
+#pragma once
+
+#ifdef __APPLE__
+
+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif // __clang__
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // __GNUC__
+
+#endif // __APPLE__
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/crypto/Hash.h>
+#include <aws/core/utils/Outcome.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ class WindowsHashImpl;
+
+ /**
+ * Md5 hash implementation
+ */
+ class AWS_CORE_API MD5 : public Hash
+ {
+ public:
+ /**
* Initializes platform crypto libs for md5
- */
- MD5();
- virtual ~MD5();
-
- /**
- * Calculates an MD5 hash
- */
- virtual HashResult Calculate(const Aws::String& str) override;
-
- /**
- * Calculates a Hash digest on a stream (the entire stream is read)
- */
- virtual HashResult Calculate(Aws::IStream& stream) override;
-
- private:
-
- std::shared_ptr<Hash> m_hashImpl;
- };
-
- } // namespace Crypto
- } // namespace Utils
-} // namespace Aws
-
+ */
+ MD5();
+ virtual ~MD5();
+
+ /**
+ * Calculates an MD5 hash
+ */
+ virtual HashResult Calculate(const Aws::String& str) override;
+
+ /**
+ * Calculates a Hash digest on a stream (the entire stream is read)
+ */
+ virtual HashResult Calculate(Aws::IStream& stream) override;
+
+ private:
+
+ std::shared_ptr<Hash> m_hashImpl;
+ };
+
+ } // namespace Crypto
+ } // namespace Utils
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/SecureRandom.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/SecureRandom.h
index 4f5a372a01..7f48dc008d 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/SecureRandom.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/SecureRandom.h
@@ -2,115 +2,115 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-#include <type_traits>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- /**
- * Interface for generating Random Bytes with guaranteed entropy for use with cryptographic functions.
- * An instance is not guaranteed to be thread safe. This is intentional, that is needless overhead to
- * pay for something you probably don't need. If you encounter a need for thread safety, you are responsible
- * for memory fencing.
- */
- class SecureRandomBytes
- {
- public:
- SecureRandomBytes() : m_failure(false)
- {
- }
-
- virtual ~SecureRandomBytes() = default;
-
- /**
- * fill in buffer of size bufferSize with random bytes
- */
- virtual void GetBytes(unsigned char* buffer, size_t bufferSize) = 0;
-
- /**
- * Always check this. If anything goes wrong, this tells you
- */
- operator bool() const { return !m_failure; }
-
- protected:
- bool m_failure;
- };
-
- /**
- * Random Number generator for integral types. Guaranteed to have entropy or your program will crash.
- */
- template <typename DataType = uint64_t>
- class SecureRandom
- {
- public:
- /**
- * Initialize with the results of CreateSecureRandomBytesImplementation().
- * An instance is not guaranteed to be thread safe. This is intentional, that is needless overhead to
- * pay for something you probably don't need. If you encounter a need for thread safety, you are responsible
- * for memory fencing.
- */
- SecureRandom(const std::shared_ptr<SecureRandomBytes>& entropySource) : m_entropy(entropySource)
- { static_assert(std::is_unsigned<DataType>::value, "Type DataType must be integral"); }
-
- virtual ~SecureRandom() = default;
-
- virtual void Reset() {}
-
- /**
- * Generate a random number of DataType
- */
- virtual DataType operator()()
- {
- DataType value(0);
- unsigned char buffer[sizeof(DataType)];
- m_entropy->GetBytes(buffer, sizeof(DataType));
-
- assert(*m_entropy);
- if(*m_entropy)
- {
- for (size_t i = 0; i < sizeof(DataType); ++i)
- {
- value <<= 8;
- value |= buffer[i];
-
- }
- }
-
- return value;
- }
-
- operator bool() const { return *m_entropy; }
-
- private:
- std::shared_ptr<SecureRandomBytes> m_entropy;
- };
-
- class SecureRandomFactory
- {
- public:
- virtual ~SecureRandomFactory() = default;
-
- /**
- * Factory method. Returns SecureRandom implementation.
- */
- virtual std::shared_ptr<SecureRandomBytes> CreateImplementation() const = 0;
-
- /**
- * Opportunity to make any static initialization calls you need to make.
- * Will only be called once.
- */
- virtual void InitStaticState() {}
-
- /**
- * Opportunity to make any static cleanup calls you need to make.
- * will only be called at the end of the application.
- */
- virtual void CleanupStaticState() {}
- };
- }
- }
-}
+#pragma once
+#include <type_traits>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ /**
+ * Interface for generating Random Bytes with guaranteed entropy for use with cryptographic functions.
+ * An instance is not guaranteed to be thread safe. This is intentional, that is needless overhead to
+ * pay for something you probably don't need. If you encounter a need for thread safety, you are responsible
+ * for memory fencing.
+ */
+ class SecureRandomBytes
+ {
+ public:
+ SecureRandomBytes() : m_failure(false)
+ {
+ }
+
+ virtual ~SecureRandomBytes() = default;
+
+ /**
+ * fill in buffer of size bufferSize with random bytes
+ */
+ virtual void GetBytes(unsigned char* buffer, size_t bufferSize) = 0;
+
+ /**
+ * Always check this. If anything goes wrong, this tells you
+ */
+ operator bool() const { return !m_failure; }
+
+ protected:
+ bool m_failure;
+ };
+
+ /**
+ * Random Number generator for integral types. Guaranteed to have entropy or your program will crash.
+ */
+ template <typename DataType = uint64_t>
+ class SecureRandom
+ {
+ public:
+ /**
+ * Initialize with the results of CreateSecureRandomBytesImplementation().
+ * An instance is not guaranteed to be thread safe. This is intentional, that is needless overhead to
+ * pay for something you probably don't need. If you encounter a need for thread safety, you are responsible
+ * for memory fencing.
+ */
+ SecureRandom(const std::shared_ptr<SecureRandomBytes>& entropySource) : m_entropy(entropySource)
+ { static_assert(std::is_unsigned<DataType>::value, "Type DataType must be integral"); }
+
+ virtual ~SecureRandom() = default;
+
+ virtual void Reset() {}
+
+ /**
+ * Generate a random number of DataType
+ */
+ virtual DataType operator()()
+ {
+ DataType value(0);
+ unsigned char buffer[sizeof(DataType)];
+ m_entropy->GetBytes(buffer, sizeof(DataType));
+
+ assert(*m_entropy);
+ if(*m_entropy)
+ {
+ for (size_t i = 0; i < sizeof(DataType); ++i)
+ {
+ value <<= 8;
+ value |= buffer[i];
+
+ }
+ }
+
+ return value;
+ }
+
+ operator bool() const { return *m_entropy; }
+
+ private:
+ std::shared_ptr<SecureRandomBytes> m_entropy;
+ };
+
+ class SecureRandomFactory
+ {
+ public:
+ virtual ~SecureRandomFactory() = default;
+
+ /**
+ * Factory method. Returns SecureRandom implementation.
+ */
+ virtual std::shared_ptr<SecureRandomBytes> CreateImplementation() const = 0;
+
+ /**
+ * Opportunity to make any static initialization calls you need to make.
+ * Will only be called once.
+ */
+ virtual void InitStaticState() {}
+
+ /**
+ * Opportunity to make any static cleanup calls you need to make.
+ * will only be called at the end of the application.
+ */
+ virtual void CleanupStaticState() {}
+ };
+ }
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256.h
index 7fc46727f1..441752b0a6 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256.h
@@ -2,64 +2,64 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
- /*
- * Interface for Sha256 encryptor and hmac
- */
-#pragma once
-
-#ifdef __APPLE__
-
-#ifdef __clang__
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif // __clang__
-
-#ifdef __GNUC__
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif // __GNUC__
-
-#endif // __APPLE__
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/crypto/Hash.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- class WindowsHashImpl;
-
- /**
- * Sha256 hash implementation.
- */
- class AWS_CORE_API Sha256 : public Hash
- {
- public:
- /**
- * Initializes platform crypto libs.
- */
- Sha256();
- virtual ~Sha256();
-
- /**
- * Calculates a SHA256 Hash digest (not hex encoded)
- */
- virtual HashResult Calculate(const Aws::String& str) override;
-
- /**
- * Calculates a Hash digest on a stream (the entire stream is read)
- */
- virtual HashResult Calculate(Aws::IStream& stream) override;
-
- private:
-
- std::shared_ptr< Hash > m_hashImpl;
- };
-
- } // namespace Crypto
- } // namespace Utils
-} // namespace Aws
-
+
+ /*
+ * Interface for Sha256 encryptor and hmac
+ */
+#pragma once
+
+#ifdef __APPLE__
+
+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif // __clang__
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // __GNUC__
+
+#endif // __APPLE__
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/crypto/Hash.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ class WindowsHashImpl;
+
+ /**
+ * Sha256 hash implementation.
+ */
+ class AWS_CORE_API Sha256 : public Hash
+ {
+ public:
+ /**
+ * Initializes platform crypto libs.
+ */
+ Sha256();
+ virtual ~Sha256();
+
+ /**
+ * Calculates a SHA256 Hash digest (not hex encoded)
+ */
+ virtual HashResult Calculate(const Aws::String& str) override;
+
+ /**
+ * Calculates a Hash digest on a stream (the entire stream is read)
+ */
+ virtual HashResult Calculate(Aws::IStream& stream) override;
+
+ private:
+
+ std::shared_ptr< Hash > m_hashImpl;
+ };
+
+ } // namespace Crypto
+ } // namespace Utils
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256HMAC.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256HMAC.h
index b78624186d..d035b99da5 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256HMAC.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/Sha256HMAC.h
@@ -2,58 +2,58 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
- /*
- * Interface for Sha256 encryptor and hmac
- */
-#pragma once
-
-#ifdef __APPLE__
-
-#ifdef __clang__
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif // __clang__
-
-#ifdef __GNUC__
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif // __GNUC__
-
-#endif // __APPLE__
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/crypto/HMAC.h>
-#include <aws/core/utils/memory/AWSMemory.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- /**
- * Sha256 HMAC implementation
- */
- class AWS_CORE_API Sha256HMAC : public HMAC
- {
- public:
- /**
- * initializes platform specific libs.
- */
- Sha256HMAC();
- virtual ~Sha256HMAC();
-
- /**
- * Calculates a SHA256 HMAC digest (not hex encoded)
- */
- virtual HashResult Calculate(const Aws::Utils::ByteBuffer& toSign, const Aws::Utils::ByteBuffer& secret) override;
-
- private:
-
- std::shared_ptr< HMAC > m_hmacImpl;
- };
-
- } // namespace Sha256
- } // namespace Utils
-} // namespace Aws
-
+
+ /*
+ * Interface for Sha256 encryptor and hmac
+ */
+#pragma once
+
+#ifdef __APPLE__
+
+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif // __clang__
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // __GNUC__
+
+#endif // __APPLE__
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/crypto/HMAC.h>
+#include <aws/core/utils/memory/AWSMemory.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ /**
+ * Sha256 HMAC implementation
+ */
+ class AWS_CORE_API Sha256HMAC : public HMAC
+ {
+ public:
+ /**
+ * initializes platform specific libs.
+ */
+ Sha256HMAC();
+ virtual ~Sha256HMAC();
+
+ /**
+ * Calculates a SHA256 HMAC digest (not hex encoded)
+ */
+ virtual HashResult Calculate(const Aws::Utils::ByteBuffer& toSign, const Aws::Utils::ByteBuffer& secret) override;
+
+ private:
+
+ std::shared_ptr< HMAC > m_hmacImpl;
+ };
+
+ } // namespace Sha256
+ } // namespace Utils
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/openssl/CryptoImpl.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/openssl/CryptoImpl.h
index 5c6980ae08..e3f37edda9 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/openssl/CryptoImpl.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/crypto/openssl/CryptoImpl.h
@@ -2,277 +2,277 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-#pragma once
-
-#include <aws/core/utils/crypto/Hash.h>
-#include <aws/core/utils/crypto/HMAC.h>
-#include <aws/core/utils/crypto/Cipher.h>
-#include <aws/core/utils/crypto/SecureRandom.h>
-#include <aws/core/utils/GetTheLights.h>
-#include <openssl/ossl_typ.h>
-#include <openssl/evp.h>
-#include <openssl/hmac.h>
-#include <openssl/rand.h>
-#include <atomic>
-#include <mutex>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Crypto
- {
- namespace OpenSSL
- {
- extern GetTheLights getTheLights;
-
- void init_static_state();
-
- void cleanup_static_state();
-
- void locking_fn(int mode, int n, const char* file, int line);
-
- unsigned long id_fn();
- }
-
- /**
- * OpenSSL implementation for SecureRandomBytes.
+#pragma once
+
+#include <aws/core/utils/crypto/Hash.h>
+#include <aws/core/utils/crypto/HMAC.h>
+#include <aws/core/utils/crypto/Cipher.h>
+#include <aws/core/utils/crypto/SecureRandom.h>
+#include <aws/core/utils/GetTheLights.h>
+#include <openssl/ossl_typ.h>
+#include <openssl/evp.h>
+#include <openssl/hmac.h>
+#include <openssl/rand.h>
+#include <atomic>
+#include <mutex>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Crypto
+ {
+ namespace OpenSSL
+ {
+ extern GetTheLights getTheLights;
+
+ void init_static_state();
+
+ void cleanup_static_state();
+
+ void locking_fn(int mode, int n, const char* file, int line);
+
+ unsigned long id_fn();
+ }
+
+ /**
+ * OpenSSL implementation for SecureRandomBytes.
* Incidentally, this implementation is thread safe, though it is not
- * on other platforms. You should treat an instance of SecureRandomBytes
- * as needed to be memory fenced if you will be using accross multiple threads
- */
- class SecureRandomBytes_OpenSSLImpl : public SecureRandomBytes
- {
- public:
- SecureRandomBytes_OpenSSLImpl()
- { }
-
- ~SecureRandomBytes_OpenSSLImpl() = default;
-
- /**
- * Reads bufferSize bytes from RAND_bytes into buffer.
- */
- void GetBytes(unsigned char* buffer, size_t bufferSize) override;
- };
-
- class MD5OpenSSLImpl : public Hash
- {
- public:
-
- MD5OpenSSLImpl()
- { }
-
- virtual ~MD5OpenSSLImpl() = default;
-
- virtual HashResult Calculate(const Aws::String& str) override;
-
- virtual HashResult Calculate(Aws::IStream& stream) override;
-
- };
-
- class Sha256OpenSSLImpl : public Hash
- {
- public:
- Sha256OpenSSLImpl()
- { }
-
- virtual ~Sha256OpenSSLImpl() = default;
-
- virtual HashResult Calculate(const Aws::String& str) override;
-
- virtual HashResult Calculate(Aws::IStream& stream) override;
- };
-
- class Sha256HMACOpenSSLImpl : public HMAC
- {
- public:
- virtual ~Sha256HMACOpenSSLImpl() = default;
-
- virtual HashResult Calculate(const ByteBuffer& toSign, const ByteBuffer& secret) override;
- };
-
- /**
- * OpenSSL implementation for SymmetricCipher
- */
- class OpenSSLCipher : public SymmetricCipher
- {
- public:
- /**
- * Creates new OpenSSL based cipher for key, and autogenerates a secure IV of size ivSize
- */
- OpenSSLCipher(const CryptoBuffer& key, size_t ivSize, bool ctrMode = false);
-
- /**
- * Creates new OpenSSL based cipher for key, initializationVector, and optional tag. If this is an authenticated
- * cipher being used for decryption.
- */
- OpenSSLCipher(CryptoBuffer&& key, CryptoBuffer&& initializationVector,
- CryptoBuffer&& tag = CryptoBuffer(0));
-
- /**
- * Creates new OpenSSL based cipher for key, initializationVector, and optional tag. If this is an authenticated
- * cipher being used for decryption.
- */
- OpenSSLCipher(const CryptoBuffer& key, const CryptoBuffer& initializationVector,
- const CryptoBuffer& tag = CryptoBuffer(0));
-
- OpenSSLCipher(const OpenSSLCipher& other) = delete;
-
- OpenSSLCipher& operator=(const OpenSSLCipher& other) = delete;
-
- /**
- * Normally we don't work around VS 2013 not auto-generating these, but they are kind of expensive,
- * so let's go ahead and optimize by defining default move operations. Implementors of this class
- * need to be sure to define the move operations and call the base class.
- */
- OpenSSLCipher(OpenSSLCipher&& toMove);
-
- /**
- * Normally we don't work around VS 2013 not auto-generating these, but they are kind of expensive,
- * so let's go ahead and optimize by defining default move operations. Implementors of this class
- * need to be sure to define the move operations and call the base class.
- */
- OpenSSLCipher& operator=(OpenSSLCipher&& toMove) = default;
-
-
- virtual ~OpenSSLCipher();
-
- /**
- * Encrypt a buffer of data. Part of the contract for this interface is that intention that
- * a user call this function multiple times for a large stream. As such, multiple calls to this function
- * on the same instance should produce valid sequential output for an encrypted stream.
- */
- CryptoBuffer EncryptBuffer(const CryptoBuffer& unEncryptedData) override;
-
- /**
- * Finalize Encryption, returns anything remaining in the last block
- */
- CryptoBuffer FinalizeEncryption() override;
-
- /**
- * Decrypt a buffer of data. Part of the contract for this interface is that intention that
+ * on other platforms. You should treat an instance of SecureRandomBytes
+ * as needed to be memory fenced if you will be using accross multiple threads
+ */
+ class SecureRandomBytes_OpenSSLImpl : public SecureRandomBytes
+ {
+ public:
+ SecureRandomBytes_OpenSSLImpl()
+ { }
+
+ ~SecureRandomBytes_OpenSSLImpl() = default;
+
+ /**
+ * Reads bufferSize bytes from RAND_bytes into buffer.
+ */
+ void GetBytes(unsigned char* buffer, size_t bufferSize) override;
+ };
+
+ class MD5OpenSSLImpl : public Hash
+ {
+ public:
+
+ MD5OpenSSLImpl()
+ { }
+
+ virtual ~MD5OpenSSLImpl() = default;
+
+ virtual HashResult Calculate(const Aws::String& str) override;
+
+ virtual HashResult Calculate(Aws::IStream& stream) override;
+
+ };
+
+ class Sha256OpenSSLImpl : public Hash
+ {
+ public:
+ Sha256OpenSSLImpl()
+ { }
+
+ virtual ~Sha256OpenSSLImpl() = default;
+
+ virtual HashResult Calculate(const Aws::String& str) override;
+
+ virtual HashResult Calculate(Aws::IStream& stream) override;
+ };
+
+ class Sha256HMACOpenSSLImpl : public HMAC
+ {
+ public:
+ virtual ~Sha256HMACOpenSSLImpl() = default;
+
+ virtual HashResult Calculate(const ByteBuffer& toSign, const ByteBuffer& secret) override;
+ };
+
+ /**
+ * OpenSSL implementation for SymmetricCipher
+ */
+ class OpenSSLCipher : public SymmetricCipher
+ {
+ public:
+ /**
+ * Creates new OpenSSL based cipher for key, and autogenerates a secure IV of size ivSize
+ */
+ OpenSSLCipher(const CryptoBuffer& key, size_t ivSize, bool ctrMode = false);
+
+ /**
+ * Creates new OpenSSL based cipher for key, initializationVector, and optional tag. If this is an authenticated
+ * cipher being used for decryption.
+ */
+ OpenSSLCipher(CryptoBuffer&& key, CryptoBuffer&& initializationVector,
+ CryptoBuffer&& tag = CryptoBuffer(0));
+
+ /**
+ * Creates new OpenSSL based cipher for key, initializationVector, and optional tag. If this is an authenticated
+ * cipher being used for decryption.
+ */
+ OpenSSLCipher(const CryptoBuffer& key, const CryptoBuffer& initializationVector,
+ const CryptoBuffer& tag = CryptoBuffer(0));
+
+ OpenSSLCipher(const OpenSSLCipher& other) = delete;
+
+ OpenSSLCipher& operator=(const OpenSSLCipher& other) = delete;
+
+ /**
+ * Normally we don't work around VS 2013 not auto-generating these, but they are kind of expensive,
+ * so let's go ahead and optimize by defining default move operations. Implementors of this class
+ * need to be sure to define the move operations and call the base class.
+ */
+ OpenSSLCipher(OpenSSLCipher&& toMove);
+
+ /**
+ * Normally we don't work around VS 2013 not auto-generating these, but they are kind of expensive,
+ * so let's go ahead and optimize by defining default move operations. Implementors of this class
+ * need to be sure to define the move operations and call the base class.
+ */
+ OpenSSLCipher& operator=(OpenSSLCipher&& toMove) = default;
+
+
+ virtual ~OpenSSLCipher();
+
+ /**
+ * Encrypt a buffer of data. Part of the contract for this interface is that intention that
+ * a user call this function multiple times for a large stream. As such, multiple calls to this function
+ * on the same instance should produce valid sequential output for an encrypted stream.
+ */
+ CryptoBuffer EncryptBuffer(const CryptoBuffer& unEncryptedData) override;
+
+ /**
+ * Finalize Encryption, returns anything remaining in the last block
+ */
+ CryptoBuffer FinalizeEncryption() override;
+
+ /**
+ * Decrypt a buffer of data. Part of the contract for this interface is that intention that
* a user call this function multiple times for a large stream. As such, multiple calls to this function
- * on the same instance should produce valid sequential output from an encrypted stream.
- */
- CryptoBuffer DecryptBuffer(const CryptoBuffer& encryptedData) override;
-
- /**
- * Finalize Decryption, returns anything remaining in the last block
- */
- CryptoBuffer FinalizeDecryption() override;
-
- void Reset() override;
-
- protected:
- virtual size_t GetBlockSizeBytes() const = 0;
- virtual size_t GetKeyLengthBits() const = 0;
+ * on the same instance should produce valid sequential output from an encrypted stream.
+ */
+ CryptoBuffer DecryptBuffer(const CryptoBuffer& encryptedData) override;
+
+ /**
+ * Finalize Decryption, returns anything remaining in the last block
+ */
+ CryptoBuffer FinalizeDecryption() override;
+
+ void Reset() override;
+
+ protected:
+ virtual size_t GetBlockSizeBytes() const = 0;
+ virtual size_t GetKeyLengthBits() const = 0;
bool CheckKeyAndIVLength(size_t expectedKeyLength, size_t expectedIVLength);
-
- EVP_CIPHER_CTX* m_encryptor_ctx;
- EVP_CIPHER_CTX* m_decryptor_ctx;
- private:
- void Init();
- void Cleanup();
+
+ EVP_CIPHER_CTX* m_encryptor_ctx;
+ EVP_CIPHER_CTX* m_decryptor_ctx;
+ private:
+ void Init();
+ void Cleanup();
/* openssl has bug finalize decryption of an empty string */
bool m_emptyPlaintext;
- };
-
- /**
- * OpenSSL implementation for AES in CBC mode
- */
- class AES_CBC_Cipher_OpenSSL : public OpenSSLCipher
- {
- public:
- /**
- * Create AES in CBC mode off of a 256 bit key. Auto Generates a 16 byte secure random IV
- */
- AES_CBC_Cipher_OpenSSL(const CryptoBuffer& key);
-
- /**
- * Create AES in CBC mode off of a 256 bit key and 16 byte IV
- */
- AES_CBC_Cipher_OpenSSL(CryptoBuffer&& key, CryptoBuffer&& initializationVector);
-
- /**
- * Create AES in CBC mode off of a 256 bit key and 16 byte IV
- */
- AES_CBC_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer& initializationVector);
-
- AES_CBC_Cipher_OpenSSL(const AES_CBC_Cipher_OpenSSL& other) = delete;
-
- AES_CBC_Cipher_OpenSSL& operator=(const AES_CBC_Cipher_OpenSSL& other) = delete;
-
- AES_CBC_Cipher_OpenSSL(AES_CBC_Cipher_OpenSSL&& toMove) = default;
-
+ };
+
+ /**
+ * OpenSSL implementation for AES in CBC mode
+ */
+ class AES_CBC_Cipher_OpenSSL : public OpenSSLCipher
+ {
+ public:
+ /**
+ * Create AES in CBC mode off of a 256 bit key. Auto Generates a 16 byte secure random IV
+ */
+ AES_CBC_Cipher_OpenSSL(const CryptoBuffer& key);
+
+ /**
+ * Create AES in CBC mode off of a 256 bit key and 16 byte IV
+ */
+ AES_CBC_Cipher_OpenSSL(CryptoBuffer&& key, CryptoBuffer&& initializationVector);
+
+ /**
+ * Create AES in CBC mode off of a 256 bit key and 16 byte IV
+ */
+ AES_CBC_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer& initializationVector);
+
+ AES_CBC_Cipher_OpenSSL(const AES_CBC_Cipher_OpenSSL& other) = delete;
+
+ AES_CBC_Cipher_OpenSSL& operator=(const AES_CBC_Cipher_OpenSSL& other) = delete;
+
+ AES_CBC_Cipher_OpenSSL(AES_CBC_Cipher_OpenSSL&& toMove) = default;
+
void Reset() override;
- protected:
- size_t GetBlockSizeBytes() const override;
-
- size_t GetKeyLengthBits() const override;
-
- private:
- void InitCipher();
-
- static size_t BlockSizeBytes;
- static size_t KeyLengthBits;
- };
-
- /**
- * OpenSSL implementation for AES in CTR mode
- */
- class AES_CTR_Cipher_OpenSSL : public OpenSSLCipher
- {
- public:
- /**
- * Create AES in CTR mode off of a 256 bit key. Auto Generates a 16 byte IV in the format
- * [nonce 4bytes ] [securely random iv 8 bytes] [ CTR init 4bytes ]
- */
- AES_CTR_Cipher_OpenSSL(const CryptoBuffer& key);
-
- /**
- * Create AES in CTR mode off of a 256 bit key and 16 byte IV
- */
- AES_CTR_Cipher_OpenSSL(CryptoBuffer&& key, CryptoBuffer&& initializationVector);
-
- /**
- * Create AES in CTR mode off of a 256 bit key and 16 byte IV
- */
- AES_CTR_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer& initializationVector);
-
- AES_CTR_Cipher_OpenSSL(const AES_CTR_Cipher_OpenSSL& other) = delete;
-
- AES_CTR_Cipher_OpenSSL& operator=(const AES_CTR_Cipher_OpenSSL& other) = delete;
-
- AES_CTR_Cipher_OpenSSL(AES_CTR_Cipher_OpenSSL&& toMove) = default;
-
+ protected:
+ size_t GetBlockSizeBytes() const override;
+
+ size_t GetKeyLengthBits() const override;
+
+ private:
+ void InitCipher();
+
+ static size_t BlockSizeBytes;
+ static size_t KeyLengthBits;
+ };
+
+ /**
+ * OpenSSL implementation for AES in CTR mode
+ */
+ class AES_CTR_Cipher_OpenSSL : public OpenSSLCipher
+ {
+ public:
+ /**
+ * Create AES in CTR mode off of a 256 bit key. Auto Generates a 16 byte IV in the format
+ * [nonce 4bytes ] [securely random iv 8 bytes] [ CTR init 4bytes ]
+ */
+ AES_CTR_Cipher_OpenSSL(const CryptoBuffer& key);
+
+ /**
+ * Create AES in CTR mode off of a 256 bit key and 16 byte IV
+ */
+ AES_CTR_Cipher_OpenSSL(CryptoBuffer&& key, CryptoBuffer&& initializationVector);
+
+ /**
+ * Create AES in CTR mode off of a 256 bit key and 16 byte IV
+ */
+ AES_CTR_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer& initializationVector);
+
+ AES_CTR_Cipher_OpenSSL(const AES_CTR_Cipher_OpenSSL& other) = delete;
+
+ AES_CTR_Cipher_OpenSSL& operator=(const AES_CTR_Cipher_OpenSSL& other) = delete;
+
+ AES_CTR_Cipher_OpenSSL(AES_CTR_Cipher_OpenSSL&& toMove) = default;
+
void Reset() override;
- protected:
- size_t GetBlockSizeBytes() const override;
-
- size_t GetKeyLengthBits() const override;
-
- private:
- void InitCipher();
-
- static size_t BlockSizeBytes;
- static size_t KeyLengthBits;
- };
-
- /**
- * OpenSSL implementation for AES in GCM mode
- */
- class AES_GCM_Cipher_OpenSSL : public OpenSSLCipher
- {
- public:
- /**
+ protected:
+ size_t GetBlockSizeBytes() const override;
+
+ size_t GetKeyLengthBits() const override;
+
+ private:
+ void InitCipher();
+
+ static size_t BlockSizeBytes;
+ static size_t KeyLengthBits;
+ };
+
+ /**
+ * OpenSSL implementation for AES in GCM mode
+ */
+ class AES_GCM_Cipher_OpenSSL : public OpenSSLCipher
+ {
+ public:
+ /**
* Create AES in GCM mode off of a 256 bit key. Auto Generates a 12 byte secure random IV.
- */
- AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key);
-
- /**
+ */
+ AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key);
+
+ /**
* Create AES in GCM mode off of a 256 bit key and AAD. Auto Generates a 12 byte IV in the format
*/
AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer* aad);
@@ -281,91 +281,91 @@ namespace Aws
* Create AES in GCM mode off of a 256 bit key, a 12 byte secure random IV, and an optional 16 byte Tag and additional authentication data (AAD).
* Note that tag could be acquired from encrypt mode and should only be set for decrypt mode.
* If you are using this cipher to decrypt an encrypted payload, you must set the tag here.
- */
- AES_GCM_Cipher_OpenSSL(CryptoBuffer&& key, CryptoBuffer&& initializationVector,
+ */
+ AES_GCM_Cipher_OpenSSL(CryptoBuffer&& key, CryptoBuffer&& initializationVector,
CryptoBuffer&& tag = CryptoBuffer(0), CryptoBuffer&& aad = CryptoBuffer(0));
-
- /**
+
+ /**
* Create AES in GCM mode off of a 256 bit key, a 12 byte secure random IV, and an optional 16 byte Tag and additional authentication data (AAD).
* Note that tag could be acquired from encrypt mode and should only be set for decrypt mode.
* If you are using this cipher to decrypt an encrypted payload, you must set the tag here.
- */
- AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer& initializationVector,
+ */
+ AES_GCM_Cipher_OpenSSL(const CryptoBuffer& key, const CryptoBuffer& initializationVector,
const CryptoBuffer& tag = CryptoBuffer(0), const CryptoBuffer& aad = CryptoBuffer(0));
-
- AES_GCM_Cipher_OpenSSL(const AES_GCM_Cipher_OpenSSL& other) = delete;
-
- AES_GCM_Cipher_OpenSSL& operator=(const AES_GCM_Cipher_OpenSSL& other) = delete;
-
- AES_GCM_Cipher_OpenSSL(AES_GCM_Cipher_OpenSSL&& toMove) = default;
-
- /**
- * Calls base class first, then grabs the tag from the cipher and sets it on m_tag.
- * After calling FinalizeEncryption, be sure to call GetTag() and do something with it
- * or you will not be able to decrypt the payload.
- */
- CryptoBuffer FinalizeEncryption() override;
-
+
+ AES_GCM_Cipher_OpenSSL(const AES_GCM_Cipher_OpenSSL& other) = delete;
+
+ AES_GCM_Cipher_OpenSSL& operator=(const AES_GCM_Cipher_OpenSSL& other) = delete;
+
+ AES_GCM_Cipher_OpenSSL(AES_GCM_Cipher_OpenSSL&& toMove) = default;
+
+ /**
+ * Calls base class first, then grabs the tag from the cipher and sets it on m_tag.
+ * After calling FinalizeEncryption, be sure to call GetTag() and do something with it
+ * or you will not be able to decrypt the payload.
+ */
+ CryptoBuffer FinalizeEncryption() override;
+
void Reset() override;
- protected:
- size_t GetBlockSizeBytes() const override;
-
- size_t GetKeyLengthBits() const override;
-
- size_t GetTagLengthBytes() const;
-
- private:
- void InitCipher();
-
+ protected:
+ size_t GetBlockSizeBytes() const override;
+
+ size_t GetKeyLengthBits() const override;
+
+ size_t GetTagLengthBytes() const;
+
+ private:
+ void InitCipher();
+
CryptoBuffer m_aad;
- static size_t BlockSizeBytes;
- static size_t IVLengthBytes;
- static size_t KeyLengthBits;
- static size_t TagLengthBytes;
- };
-
- /**
- * OpenSSL implementation for AES in Key Wrap mode. The key for the c_tor is the Kek,
- * it either encrypts a CEK or decrypts it.
- */
- class AES_KeyWrap_Cipher_OpenSSL : public OpenSSLCipher
- {
- public:
-
- /**
- * Create AES in Key Wrap mode off of a 256 bit key.
- */
- AES_KeyWrap_Cipher_OpenSSL(const CryptoBuffer& key);
-
- AES_KeyWrap_Cipher_OpenSSL(const AES_KeyWrap_Cipher_OpenSSL&) = delete;
-
- AES_KeyWrap_Cipher_OpenSSL& operator=(const AES_KeyWrap_Cipher_OpenSSL&) = delete;
-
- AES_KeyWrap_Cipher_OpenSSL(AES_KeyWrap_Cipher_OpenSSL&&) = default;
-
- CryptoBuffer EncryptBuffer(const CryptoBuffer&) override;
- CryptoBuffer FinalizeEncryption() override;
-
- CryptoBuffer DecryptBuffer(const CryptoBuffer&) override;
- CryptoBuffer FinalizeDecryption() override;
-
+ static size_t BlockSizeBytes;
+ static size_t IVLengthBytes;
+ static size_t KeyLengthBits;
+ static size_t TagLengthBytes;
+ };
+
+ /**
+ * OpenSSL implementation for AES in Key Wrap mode. The key for the c_tor is the Kek,
+ * it either encrypts a CEK or decrypts it.
+ */
+ class AES_KeyWrap_Cipher_OpenSSL : public OpenSSLCipher
+ {
+ public:
+
+ /**
+ * Create AES in Key Wrap mode off of a 256 bit key.
+ */
+ AES_KeyWrap_Cipher_OpenSSL(const CryptoBuffer& key);
+
+ AES_KeyWrap_Cipher_OpenSSL(const AES_KeyWrap_Cipher_OpenSSL&) = delete;
+
+ AES_KeyWrap_Cipher_OpenSSL& operator=(const AES_KeyWrap_Cipher_OpenSSL&) = delete;
+
+ AES_KeyWrap_Cipher_OpenSSL(AES_KeyWrap_Cipher_OpenSSL&&) = default;
+
+ CryptoBuffer EncryptBuffer(const CryptoBuffer&) override;
+ CryptoBuffer FinalizeEncryption() override;
+
+ CryptoBuffer DecryptBuffer(const CryptoBuffer&) override;
+ CryptoBuffer FinalizeDecryption() override;
+
void Reset() override;
- protected:
- inline size_t GetBlockSizeBytes() const override { return BlockSizeBytes; }
-
- inline size_t GetKeyLengthBits() const override { return KeyLengthBits; }
-
- private:
- void InitCipher();
-
- static size_t BlockSizeBytes;
- static size_t KeyLengthBits;
-
- CryptoBuffer m_workingKeyBuffer;
- };
-
- } // namespace Crypto
- } // namespace Utils
-} // namespace Aws
+ protected:
+ inline size_t GetBlockSizeBytes() const override { return BlockSizeBytes; }
+
+ inline size_t GetKeyLengthBits() const override { return KeyLengthBits; }
+
+ private:
+ void InitCipher();
+
+ static size_t BlockSizeBytes;
+ static size_t KeyLengthBits;
+
+ CryptoBuffer m_workingKeyBuffer;
+ };
+
+ } // namespace Crypto
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/json/JsonSerializer.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/json/JsonSerializer.h
index 44987dbc7c..657ee6eff4 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/json/JsonSerializer.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/json/JsonSerializer.h
@@ -2,380 +2,380 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/Array.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/memory/stl/AWSMap.h>
-#include <aws/core/external/cjson/cJSON.h>
-
-#include <utility>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Json
- {
- class JsonView;
- /**
- * JSON DOM manipulation class.
- * To read or serialize use @ref View function.
- */
- class AWS_CORE_API JsonValue
- {
- public:
- /**
- * Constructs empty JSON DOM.
- */
- JsonValue();
-
- /**
- * Constructs a JSON DOM by parsing the input string.
- */
- JsonValue(const Aws::String& value);
-
- /**
- * Constructs a JSON DOM by parsing the text in the input stream.
- */
- JsonValue(Aws::IStream& istream);
-
- /**
- * Performs a deep copy of the JSON DOM parameter.
- * Prefer using a @ref JsonView if copying is not needed.
- */
- JsonValue(const JsonValue& value);
-
- /**
- * Moves the ownership of the internal JSON DOM.
- * No copying is performed.
- */
- JsonValue(JsonValue&& value);
-
- ~JsonValue();
-
- /**
- * Performs a deep copy of the JSON DOM parameter.
- */
- JsonValue& operator=(const JsonValue& other);
-
- /**
- * Moves the ownership of the internal JSON DOM of the parameter to the current object.
- * No copying is performed.
- * A DOM currently owned by the object will be freed prior to copying.
- * @warning This will result in invalidating any outstanding views of the current DOM. However, views
- * to the moved-from DOM would still valid.
- */
- JsonValue& operator=(JsonValue&& other);
-
- bool operator==(const JsonValue& other) const;
- bool operator!=(const JsonValue& other) const;
-
- /**
- * Adds a string to the top level of this node with key.
- */
- JsonValue& WithString(const Aws::String& key, const Aws::String& value);
- JsonValue& WithString(const char* key, const Aws::String& value);
-
- /**
- * Converts the current JSON node to a string.
- */
- JsonValue& AsString(const Aws::String& value);
-
- /**
- * Adds a bool value with key to the top level of this node.
- */
- JsonValue& WithBool(const Aws::String& key, bool value);
- JsonValue& WithBool(const char* key, bool value);
-
- /**
- * Converts the current JSON node to a bool.
- */
- JsonValue& AsBool(bool value);
-
- /**
- * Adds an integer value at key at the top level of this node.
- */
- JsonValue& WithInteger(const Aws::String& key, int value);
- JsonValue& WithInteger(const char* key, int value);
-
- /**
- * Converts the current JSON node to an integer.
- */
- JsonValue& AsInteger(int value);
-
- /**
- * Adds a 64-bit integer value at key to the top level of this node.
- */
- JsonValue& WithInt64(const Aws::String& key, long long value);
- JsonValue& WithInt64(const char* key, long long value);
-
- /**
- * Converts the current JSON node to a 64-bit integer.
- */
- JsonValue& AsInt64(long long value);
-
- /**
- * Adds a double value at key at the top level of this node.
- */
- JsonValue& WithDouble(const Aws::String& key, double value);
- JsonValue& WithDouble(const char* key, double value);
-
- /**
- * Converts the current JSON node to a double.
- */
- JsonValue& AsDouble(double value);
-
- /**
- * Adds an array of strings to the top level of this node at key.
- */
- JsonValue& WithArray(const Aws::String& key, const Array<Aws::String>& array);
- JsonValue& WithArray(const char* key, const Array<Aws::String>& array);
-
- /**
- * Adds an array of arbitrary JSON objects to the top level of this node at key.
- * The values in the array parameter will be deep-copied.
- */
- JsonValue& WithArray(const Aws::String& key, const Array<JsonValue>& array);
-
- /**
- * Adds an array of arbitrary JSON objects to the top level of this node at key.
- * The values in the array parameter will be moved-from.
- */
- JsonValue& WithArray(const Aws::String& key, Array<JsonValue>&& array);
-
- /**
- * Converts the current JSON node to an array whose values are deep-copied from the array parameter.
- */
- JsonValue& AsArray(const Array<JsonValue>& array);
-
- /**
- * Converts the current JSON node to an array whose values are moved from the array parameter.
- */
- JsonValue& AsArray(Array<JsonValue>&& array);
-
- /**
- * Adds a JSON object to the top level of this node at key.
- * The object parameter is deep-copied.
- */
- JsonValue& WithObject(const Aws::String& key, const JsonValue& value);
- JsonValue& WithObject(const char* key, const JsonValue& value);
-
- /**
- * Adds a JSON object to the top level of this node at key.
- */
- JsonValue& WithObject(const Aws::String& key, JsonValue&& value);
- JsonValue& WithObject(const char* key, JsonValue&& value);
-
- /**
- * Converts the current JSON node to a JSON object by deep-copying the parameter.
- */
- JsonValue& AsObject(const JsonValue& value);
-
- /**
- * Converts the current JSON node to a JSON object by moving from the parameter.
- */
- JsonValue& AsObject(JsonValue&& value);
-
- /**
- * Returns true if the last parse request was successful. If this returns false,
- * you can call GetErrorMessage() to find the cause.
- */
- inline bool WasParseSuccessful() const
- {
- return m_wasParseSuccessful;
- }
-
- /**
- * Returns the last error message from a failed parse attempt. Returns empty string if no error.
- */
- inline const Aws::String& GetErrorMessage() const
- {
- return m_errorMessage;
- }
-
- /**
- * Creates a view from the current root JSON node.
- */
- JsonView View() const;
-
- private:
- void Destroy();
- JsonValue(cJSON* value);
- cJSON* m_value;
- bool m_wasParseSuccessful;
- Aws::String m_errorMessage;
- friend class JsonView;
- };
-
- /**
- * Provides read-only view to an existing JsonValue. This allows lightweight copying without making deep
- * copies of the JsonValue.
- * Note: This class does not extend the lifetime of the given JsonValue. It's your responsibility to ensure
- * the lifetime of the JsonValue is extended beyond the lifetime of its view.
- */
- class AWS_CORE_API JsonView
- {
- public:
- /* constructors */
- JsonView();
- JsonView(const JsonValue& v);
- JsonView& operator=(const JsonValue& v);
-
- /**
- * Gets a string from this node by its key.
- */
- Aws::String GetString(const Aws::String& key) const;
-
- /**
- * Returns the value of this node as a string.
- * The behavior is undefined if the node is _not_ of type string.
- */
- Aws::String AsString() const;
-
- /**
- * Gets a boolean value from this node by its key.
- */
- bool GetBool(const Aws::String& key) const;
-
- /**
- * Returns the value of this node as a boolean.
- */
- bool AsBool() const;
-
- /**
- * Gets an integer value from this node by its key.
- * The integer is of the same size as an int on the machine.
- */
- int GetInteger(const Aws::String& key) const;
-
- /**
- * Returns the value of this node as an int.
- */
- int AsInteger() const;
-
- /**
- * Gets a 64-bit integer value from this node by its key.
- * The value is 64-bit regardless of the platform/machine.
- */
- int64_t GetInt64(const Aws::String& key) const;
-
- /**
- * Returns the value of this node as 64-bit integer.
- */
- int64_t AsInt64() const;
-
- /**
- * Gets a double precision floating-point value from this node by its key.
- */
- double GetDouble(const Aws::String& key) const;
-
- /**
- * Returns the value of this node as a double precision floating-point.
- */
- double AsDouble() const;
-
- /**
- * Gets an array of JsonView objects from this node by its key.
- */
- Array<JsonView> GetArray(const Aws::String& key) const;
-
- /**
- * Returns the value of this node as an array of JsonView objects.
- */
- Array<JsonView> AsArray() const;
-
- /**
- * Gets a JsonView object from this node by its key.
- */
- JsonView GetObject(const Aws::String& key) const;
-
- /**
- * Returns the value of this node as a JsonView object.
- */
- JsonView AsObject() const;
-
- /**
- * Reads all json objects at the top level of this node (does not traverse the tree any further)
- * along with their keys.
- */
- Aws::Map<Aws::String, JsonView> GetAllObjects() const;
-
- /**
- * Tests whether a value exists at the current node level for the given key.
- * Returns true if a value has been found and its value is not null, false otherwise.
- */
- bool ValueExists(const Aws::String& key) const;
-
- /**
- * Tests whether a key exists at the current node level.
- */
- bool KeyExists(const Aws::String& key) const;
-
- /**
- * Tests whether the current value is a JSON object.
- */
- bool IsObject() const;
-
- /**
- * Tests whether the current value is a boolean.
- */
- bool IsBool() const;
-
- /**
- * Tests whether the current value is a string.
- */
- bool IsString() const;
-
- /**
- * Tests whether the current value is an int or int64_t.
- * Returns false if the value is floating-point.
- */
- bool IsIntegerType() const;
-
- /**
- * Tests whether the current value is a floating-point.
- */
- bool IsFloatingPointType() const;
-
- /**
- * Tests whether the current value is a JSON array.
- */
- bool IsListType() const;
-
- /**
- * Tests whether the current value is NULL.
- */
- bool IsNull() const;
-
- /**
- * Writes the current JSON view without whitespace characters starting at the current level to a string.
- * @param treatAsObject if the current value is empty, writes out '{}' rather than an empty string.
- */
- Aws::String WriteCompact(bool treatAsObject = true) const;
-
- /**
- * Writes the current JSON view to a string in a human friendly format.
- * @param treatAsObject if the current value is empty, writes out '{}' rather than an empty string.
- */
- Aws::String WriteReadable(bool treatAsObject = true) const;
-
- /**
- * Creates a deep copy of the JSON value rooted in the current JSON view.
- */
- JsonValue Materialize() const;
-
- private:
- JsonView(cJSON* val);
- JsonView& operator=(cJSON* val);
- cJSON* m_value;
- };
-
- } // namespace Json
- } // namespace Utils
-} // namespace Aws
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/Array.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSMap.h>
+#include <aws/core/external/cjson/cJSON.h>
+
+#include <utility>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Json
+ {
+ class JsonView;
+ /**
+ * JSON DOM manipulation class.
+ * To read or serialize use @ref View function.
+ */
+ class AWS_CORE_API JsonValue
+ {
+ public:
+ /**
+ * Constructs empty JSON DOM.
+ */
+ JsonValue();
+
+ /**
+ * Constructs a JSON DOM by parsing the input string.
+ */
+ JsonValue(const Aws::String& value);
+
+ /**
+ * Constructs a JSON DOM by parsing the text in the input stream.
+ */
+ JsonValue(Aws::IStream& istream);
+
+ /**
+ * Performs a deep copy of the JSON DOM parameter.
+ * Prefer using a @ref JsonView if copying is not needed.
+ */
+ JsonValue(const JsonValue& value);
+
+ /**
+ * Moves the ownership of the internal JSON DOM.
+ * No copying is performed.
+ */
+ JsonValue(JsonValue&& value);
+
+ ~JsonValue();
+
+ /**
+ * Performs a deep copy of the JSON DOM parameter.
+ */
+ JsonValue& operator=(const JsonValue& other);
+
+ /**
+ * Moves the ownership of the internal JSON DOM of the parameter to the current object.
+ * No copying is performed.
+ * A DOM currently owned by the object will be freed prior to copying.
+ * @warning This will result in invalidating any outstanding views of the current DOM. However, views
+ * to the moved-from DOM would still valid.
+ */
+ JsonValue& operator=(JsonValue&& other);
+
+ bool operator==(const JsonValue& other) const;
+ bool operator!=(const JsonValue& other) const;
+
+ /**
+ * Adds a string to the top level of this node with key.
+ */
+ JsonValue& WithString(const Aws::String& key, const Aws::String& value);
+ JsonValue& WithString(const char* key, const Aws::String& value);
+
+ /**
+ * Converts the current JSON node to a string.
+ */
+ JsonValue& AsString(const Aws::String& value);
+
+ /**
+ * Adds a bool value with key to the top level of this node.
+ */
+ JsonValue& WithBool(const Aws::String& key, bool value);
+ JsonValue& WithBool(const char* key, bool value);
+
+ /**
+ * Converts the current JSON node to a bool.
+ */
+ JsonValue& AsBool(bool value);
+
+ /**
+ * Adds an integer value at key at the top level of this node.
+ */
+ JsonValue& WithInteger(const Aws::String& key, int value);
+ JsonValue& WithInteger(const char* key, int value);
+
+ /**
+ * Converts the current JSON node to an integer.
+ */
+ JsonValue& AsInteger(int value);
+
+ /**
+ * Adds a 64-bit integer value at key to the top level of this node.
+ */
+ JsonValue& WithInt64(const Aws::String& key, long long value);
+ JsonValue& WithInt64(const char* key, long long value);
+
+ /**
+ * Converts the current JSON node to a 64-bit integer.
+ */
+ JsonValue& AsInt64(long long value);
+
+ /**
+ * Adds a double value at key at the top level of this node.
+ */
+ JsonValue& WithDouble(const Aws::String& key, double value);
+ JsonValue& WithDouble(const char* key, double value);
+
+ /**
+ * Converts the current JSON node to a double.
+ */
+ JsonValue& AsDouble(double value);
+
+ /**
+ * Adds an array of strings to the top level of this node at key.
+ */
+ JsonValue& WithArray(const Aws::String& key, const Array<Aws::String>& array);
+ JsonValue& WithArray(const char* key, const Array<Aws::String>& array);
+
+ /**
+ * Adds an array of arbitrary JSON objects to the top level of this node at key.
+ * The values in the array parameter will be deep-copied.
+ */
+ JsonValue& WithArray(const Aws::String& key, const Array<JsonValue>& array);
+
+ /**
+ * Adds an array of arbitrary JSON objects to the top level of this node at key.
+ * The values in the array parameter will be moved-from.
+ */
+ JsonValue& WithArray(const Aws::String& key, Array<JsonValue>&& array);
+
+ /**
+ * Converts the current JSON node to an array whose values are deep-copied from the array parameter.
+ */
+ JsonValue& AsArray(const Array<JsonValue>& array);
+
+ /**
+ * Converts the current JSON node to an array whose values are moved from the array parameter.
+ */
+ JsonValue& AsArray(Array<JsonValue>&& array);
+
+ /**
+ * Adds a JSON object to the top level of this node at key.
+ * The object parameter is deep-copied.
+ */
+ JsonValue& WithObject(const Aws::String& key, const JsonValue& value);
+ JsonValue& WithObject(const char* key, const JsonValue& value);
+
+ /**
+ * Adds a JSON object to the top level of this node at key.
+ */
+ JsonValue& WithObject(const Aws::String& key, JsonValue&& value);
+ JsonValue& WithObject(const char* key, JsonValue&& value);
+
+ /**
+ * Converts the current JSON node to a JSON object by deep-copying the parameter.
+ */
+ JsonValue& AsObject(const JsonValue& value);
+
+ /**
+ * Converts the current JSON node to a JSON object by moving from the parameter.
+ */
+ JsonValue& AsObject(JsonValue&& value);
+
+ /**
+ * Returns true if the last parse request was successful. If this returns false,
+ * you can call GetErrorMessage() to find the cause.
+ */
+ inline bool WasParseSuccessful() const
+ {
+ return m_wasParseSuccessful;
+ }
+
+ /**
+ * Returns the last error message from a failed parse attempt. Returns empty string if no error.
+ */
+ inline const Aws::String& GetErrorMessage() const
+ {
+ return m_errorMessage;
+ }
+
+ /**
+ * Creates a view from the current root JSON node.
+ */
+ JsonView View() const;
+
+ private:
+ void Destroy();
+ JsonValue(cJSON* value);
+ cJSON* m_value;
+ bool m_wasParseSuccessful;
+ Aws::String m_errorMessage;
+ friend class JsonView;
+ };
+
+ /**
+ * Provides read-only view to an existing JsonValue. This allows lightweight copying without making deep
+ * copies of the JsonValue.
+ * Note: This class does not extend the lifetime of the given JsonValue. It's your responsibility to ensure
+ * the lifetime of the JsonValue is extended beyond the lifetime of its view.
+ */
+ class AWS_CORE_API JsonView
+ {
+ public:
+ /* constructors */
+ JsonView();
+ JsonView(const JsonValue& v);
+ JsonView& operator=(const JsonValue& v);
+
+ /**
+ * Gets a string from this node by its key.
+ */
+ Aws::String GetString(const Aws::String& key) const;
+
+ /**
+ * Returns the value of this node as a string.
+ * The behavior is undefined if the node is _not_ of type string.
+ */
+ Aws::String AsString() const;
+
+ /**
+ * Gets a boolean value from this node by its key.
+ */
+ bool GetBool(const Aws::String& key) const;
+
+ /**
+ * Returns the value of this node as a boolean.
+ */
+ bool AsBool() const;
+
+ /**
+ * Gets an integer value from this node by its key.
+ * The integer is of the same size as an int on the machine.
+ */
+ int GetInteger(const Aws::String& key) const;
+
+ /**
+ * Returns the value of this node as an int.
+ */
+ int AsInteger() const;
+
+ /**
+ * Gets a 64-bit integer value from this node by its key.
+ * The value is 64-bit regardless of the platform/machine.
+ */
+ int64_t GetInt64(const Aws::String& key) const;
+
+ /**
+ * Returns the value of this node as 64-bit integer.
+ */
+ int64_t AsInt64() const;
+
+ /**
+ * Gets a double precision floating-point value from this node by its key.
+ */
+ double GetDouble(const Aws::String& key) const;
+
+ /**
+ * Returns the value of this node as a double precision floating-point.
+ */
+ double AsDouble() const;
+
+ /**
+ * Gets an array of JsonView objects from this node by its key.
+ */
+ Array<JsonView> GetArray(const Aws::String& key) const;
+
+ /**
+ * Returns the value of this node as an array of JsonView objects.
+ */
+ Array<JsonView> AsArray() const;
+
+ /**
+ * Gets a JsonView object from this node by its key.
+ */
+ JsonView GetObject(const Aws::String& key) const;
+
+ /**
+ * Returns the value of this node as a JsonView object.
+ */
+ JsonView AsObject() const;
+
+ /**
+ * Reads all json objects at the top level of this node (does not traverse the tree any further)
+ * along with their keys.
+ */
+ Aws::Map<Aws::String, JsonView> GetAllObjects() const;
+
+ /**
+ * Tests whether a value exists at the current node level for the given key.
+ * Returns true if a value has been found and its value is not null, false otherwise.
+ */
+ bool ValueExists(const Aws::String& key) const;
+
+ /**
+ * Tests whether a key exists at the current node level.
+ */
+ bool KeyExists(const Aws::String& key) const;
+
+ /**
+ * Tests whether the current value is a JSON object.
+ */
+ bool IsObject() const;
+
+ /**
+ * Tests whether the current value is a boolean.
+ */
+ bool IsBool() const;
+
+ /**
+ * Tests whether the current value is a string.
+ */
+ bool IsString() const;
+
+ /**
+ * Tests whether the current value is an int or int64_t.
+ * Returns false if the value is floating-point.
+ */
+ bool IsIntegerType() const;
+
+ /**
+ * Tests whether the current value is a floating-point.
+ */
+ bool IsFloatingPointType() const;
+
+ /**
+ * Tests whether the current value is a JSON array.
+ */
+ bool IsListType() const;
+
+ /**
+ * Tests whether the current value is NULL.
+ */
+ bool IsNull() const;
+
+ /**
+ * Writes the current JSON view without whitespace characters starting at the current level to a string.
+ * @param treatAsObject if the current value is empty, writes out '{}' rather than an empty string.
+ */
+ Aws::String WriteCompact(bool treatAsObject = true) const;
+
+ /**
+ * Writes the current JSON view to a string in a human friendly format.
+ * @param treatAsObject if the current value is empty, writes out '{}' rather than an empty string.
+ */
+ Aws::String WriteReadable(bool treatAsObject = true) const;
+
+ /**
+ * Creates a deep copy of the JSON value rooted in the current JSON view.
+ */
+ JsonValue Materialize() const;
+
+ private:
+ JsonView(cJSON* val);
+ JsonView& operator=(cJSON* val);
+ cJSON* m_value;
+ };
+
+ } // namespace Json
+ } // namespace Utils
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/AWSLogging.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/AWSLogging.h
index a238a2633a..be572ad23b 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/AWSLogging.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/AWSLogging.h
@@ -2,49 +2,49 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <memory>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Logging
- {
- class LogSystemInterface;
-
- // Standard interface
-
- /**
- * Call this at the beginning of your program, prior to any AWS calls.
- */
- AWS_CORE_API void InitializeAWSLogging(const std::shared_ptr<LogSystemInterface>& logSystem);
-
- /**
- * Call this at the exit point of your program, after all calls have finished.
- */
- AWS_CORE_API void ShutdownAWSLogging(void);
-
- /**
- * Get currently configured log system instance.
- */
- AWS_CORE_API LogSystemInterface* GetLogSystem();
-
- // Testing interface
-
- /**
- * Replaces the current logger with a new one, while pushing the old one onto a 1-deep stack; primarily for testing
- */
- AWS_CORE_API void PushLogger(const std::shared_ptr<LogSystemInterface> &logSystem);
-
- /**
- * Pops the logger off the logger stack and replaces the current logger with it. Disables logging if the top logger is actually a nullptr
- */
- AWS_CORE_API void PopLogger();
-
- } // namespace Logging
- } // namespace Utils
-} // namespace Aws
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <memory>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Logging
+ {
+ class LogSystemInterface;
+
+ // Standard interface
+
+ /**
+ * Call this at the beginning of your program, prior to any AWS calls.
+ */
+ AWS_CORE_API void InitializeAWSLogging(const std::shared_ptr<LogSystemInterface>& logSystem);
+
+ /**
+ * Call this at the exit point of your program, after all calls have finished.
+ */
+ AWS_CORE_API void ShutdownAWSLogging(void);
+
+ /**
+ * Get currently configured log system instance.
+ */
+ AWS_CORE_API LogSystemInterface* GetLogSystem();
+
+ // Testing interface
+
+ /**
+ * Replaces the current logger with a new one, while pushing the old one onto a 1-deep stack; primarily for testing
+ */
+ AWS_CORE_API void PushLogger(const std::shared_ptr<LogSystemInterface> &logSystem);
+
+ /**
+ * Pops the logger off the logger stack and replaces the current logger with it. Disables logging if the top logger is actually a nullptr
+ */
+ AWS_CORE_API void PopLogger();
+
+ } // namespace Logging
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/ConsoleLogSystem.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/ConsoleLogSystem.h
index d6e3183743..b7fb714ed6 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/ConsoleLogSystem.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/ConsoleLogSystem.h
@@ -2,44 +2,44 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/logging/FormattedLogSystem.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Logging
- {
- /**
- * Log system interface that logs to std::cout
- */
- class AWS_CORE_API ConsoleLogSystem : public FormattedLogSystem
- {
- public:
-
- using Base = FormattedLogSystem;
-
- ConsoleLogSystem(LogLevel logLevel) :
- Base(logLevel)
- {}
-
- virtual ~ConsoleLogSystem() {}
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/logging/FormattedLogSystem.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Logging
+ {
+ /**
+ * Log system interface that logs to std::cout
+ */
+ class AWS_CORE_API ConsoleLogSystem : public FormattedLogSystem
+ {
+ public:
+
+ using Base = FormattedLogSystem;
+
+ ConsoleLogSystem(LogLevel logLevel) :
+ Base(logLevel)
+ {}
+
+ virtual ~ConsoleLogSystem() {}
+
/**
* Flushes buffered messages to stdout.
*/
void Flush() override;
- protected:
-
- virtual void ProcessFormattedStatement(Aws::String&& statement) override;
- };
-
- } // namespace Logging
- } // namespace Utils
-} // namespace Aws
+ protected:
+
+ virtual void ProcessFormattedStatement(Aws::String&& statement) override;
+ };
+
+ } // namespace Logging
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/DefaultLogSystem.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/DefaultLogSystem.h
index 2b18fd59a5..dbeed83cb1 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/DefaultLogSystem.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/DefaultLogSystem.h
@@ -2,89 +2,89 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/logging/FormattedLogSystem.h>
-#include <aws/core/utils/logging/LogLevel.h>
-#include <aws/core/utils/memory/stl/AWSVector.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-
-#include <thread>
-#include <memory>
-#include <mutex>
-#include <atomic>
-#include <condition_variable>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Logging
- {
- /**
- * Default behavior logger. It has a background thread that reads a log queue and prints the messages
- * out to file as quickly as possible. This implementation also rolls the file every hour.
- */
- class AWS_CORE_API DefaultLogSystem : public FormattedLogSystem
- {
- public:
- using Base = FormattedLogSystem;
-
- /**
- * Initialize the logging system to write to the supplied logfile output. Creates logging thread on construction.
- */
- DefaultLogSystem(LogLevel logLevel, const std::shared_ptr<Aws::OStream>& logFile);
- /**
- * Initialize the logging system to write to a computed file path filenamePrefix + "timestamp.log". Creates logging thread
- * on construction.
- */
- DefaultLogSystem(LogLevel logLevel, const Aws::String& filenamePrefix);
-
- virtual ~DefaultLogSystem();
-
- /**
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/logging/FormattedLogSystem.h>
+#include <aws/core/utils/logging/LogLevel.h>
+#include <aws/core/utils/memory/stl/AWSVector.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+
+#include <thread>
+#include <memory>
+#include <mutex>
+#include <atomic>
+#include <condition_variable>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Logging
+ {
+ /**
+ * Default behavior logger. It has a background thread that reads a log queue and prints the messages
+ * out to file as quickly as possible. This implementation also rolls the file every hour.
+ */
+ class AWS_CORE_API DefaultLogSystem : public FormattedLogSystem
+ {
+ public:
+ using Base = FormattedLogSystem;
+
+ /**
+ * Initialize the logging system to write to the supplied logfile output. Creates logging thread on construction.
+ */
+ DefaultLogSystem(LogLevel logLevel, const std::shared_ptr<Aws::OStream>& logFile);
+ /**
+ * Initialize the logging system to write to a computed file path filenamePrefix + "timestamp.log". Creates logging thread
+ * on construction.
+ */
+ DefaultLogSystem(LogLevel logLevel, const Aws::String& filenamePrefix);
+
+ virtual ~DefaultLogSystem();
+
+ /**
* Flushes buffered messages to the file system.
* This method is thread-safe.
*/
void Flush() override;
/**
- * Structure containing semaphores, queue etc...
- */
- struct LogSynchronizationData
- {
- public:
- LogSynchronizationData() : m_stopLogging(false) {}
-
- std::mutex m_logQueueMutex;
- std::condition_variable m_queueSignal;
- Aws::Vector<Aws::String> m_queuedLogMessages;
+ * Structure containing semaphores, queue etc...
+ */
+ struct LogSynchronizationData
+ {
+ public:
+ LogSynchronizationData() : m_stopLogging(false) {}
+
+ std::mutex m_logQueueMutex;
+ std::condition_variable m_queueSignal;
+ Aws::Vector<Aws::String> m_queuedLogMessages;
bool m_stopLogging;
-
- private:
- LogSynchronizationData(const LogSynchronizationData& rhs) = delete;
- LogSynchronizationData& operator =(const LogSynchronizationData& rhs) = delete;
- };
-
- protected:
- /**
- * Pushes log onto the queue and notifies the background thread.
- */
- virtual void ProcessFormattedStatement(Aws::String&& statement) override;
-
- private:
- DefaultLogSystem(const DefaultLogSystem& rhs) = delete;
- DefaultLogSystem& operator =(const DefaultLogSystem& rhs) = delete;
-
- LogSynchronizationData m_syncData;
-
- std::thread m_loggingThread;
- };
-
- } // namespace Logging
- } // namespace Utils
-} // namespace Aws
+
+ private:
+ LogSynchronizationData(const LogSynchronizationData& rhs) = delete;
+ LogSynchronizationData& operator =(const LogSynchronizationData& rhs) = delete;
+ };
+
+ protected:
+ /**
+ * Pushes log onto the queue and notifies the background thread.
+ */
+ virtual void ProcessFormattedStatement(Aws::String&& statement) override;
+
+ private:
+ DefaultLogSystem(const DefaultLogSystem& rhs) = delete;
+ DefaultLogSystem& operator =(const DefaultLogSystem& rhs) = delete;
+
+ LogSynchronizationData m_syncData;
+
+ std::thread m_loggingThread;
+ };
+
+ } // namespace Logging
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/FormattedLogSystem.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/FormattedLogSystem.h
index 80b068ead5..6157c45528 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/FormattedLogSystem.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/FormattedLogSystem.h
@@ -2,65 +2,65 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/logging/LogSystemInterface.h>
-#include <aws/core/utils/logging/LogLevel.h>
-
-#include <atomic>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Logging
- {
- /**
- * Logger that formats log messages into [LEVEL] timestamp [threadid] message
- */
- class AWS_CORE_API FormattedLogSystem : public LogSystemInterface
- {
- public:
- using Base = LogSystemInterface;
-
- /**
- * Initializes log system with logLevel
- */
- FormattedLogSystem(LogLevel logLevel);
- virtual ~FormattedLogSystem() = default;
-
- /**
- * Gets the currently configured log level.
- */
- virtual LogLevel GetLogLevel(void) const override { return m_logLevel; }
- /**
- * Set a new log level. This has the immediate effect of changing the log output to the new level.
- */
- void SetLogLevel(LogLevel logLevel) { m_logLevel.store(logLevel); }
-
- /**
- * Does a printf style output to ProcessFormattedStatement. Don't use this, it's unsafe. See LogStream
- */
- virtual void Log(LogLevel logLevel, const char* tag, const char* formatStr, ...) override;
-
- /**
- * Writes the stream to ProcessFormattedStatement.
- */
- virtual void LogStream(LogLevel logLevel, const char* tag, const Aws::OStringStream &messageStream) override;
-
- protected:
- /**
- * This is the method that most logger implementations will want to override.
- * At this point the message is formatted and is ready to go to the output stream
- */
- virtual void ProcessFormattedStatement(Aws::String&& statement) = 0;
-
- private:
- std::atomic<LogLevel> m_logLevel;
- };
-
- } // namespace Logging
- } // namespace Utils
-} // namespace Aws
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/logging/LogSystemInterface.h>
+#include <aws/core/utils/logging/LogLevel.h>
+
+#include <atomic>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Logging
+ {
+ /**
+ * Logger that formats log messages into [LEVEL] timestamp [threadid] message
+ */
+ class AWS_CORE_API FormattedLogSystem : public LogSystemInterface
+ {
+ public:
+ using Base = LogSystemInterface;
+
+ /**
+ * Initializes log system with logLevel
+ */
+ FormattedLogSystem(LogLevel logLevel);
+ virtual ~FormattedLogSystem() = default;
+
+ /**
+ * Gets the currently configured log level.
+ */
+ virtual LogLevel GetLogLevel(void) const override { return m_logLevel; }
+ /**
+ * Set a new log level. This has the immediate effect of changing the log output to the new level.
+ */
+ void SetLogLevel(LogLevel logLevel) { m_logLevel.store(logLevel); }
+
+ /**
+ * Does a printf style output to ProcessFormattedStatement. Don't use this, it's unsafe. See LogStream
+ */
+ virtual void Log(LogLevel logLevel, const char* tag, const char* formatStr, ...) override;
+
+ /**
+ * Writes the stream to ProcessFormattedStatement.
+ */
+ virtual void LogStream(LogLevel logLevel, const char* tag, const Aws::OStringStream &messageStream) override;
+
+ protected:
+ /**
+ * This is the method that most logger implementations will want to override.
+ * At this point the message is formatted and is ready to go to the output stream
+ */
+ virtual void ProcessFormattedStatement(Aws::String&& statement) = 0;
+
+ private:
+ std::atomic<LogLevel> m_logLevel;
+ };
+
+ } // namespace Logging
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogLevel.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogLevel.h
index 127eb19c69..ff1dd36c0e 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogLevel.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogLevel.h
@@ -2,36 +2,36 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Logging
- {
-
- /**
- * LogLevel used to control verbosity of logging system.
- */
- enum class LogLevel : int
- {
- Off = 0,
- Fatal = 1,
- Error = 2,
- Warn = 3,
- Info = 4,
- Debug = 5,
- Trace = 6
- };
-
- AWS_CORE_API Aws::String GetLogLevelName(LogLevel logLevel);
-
- } // namespace Logging
- } // namespace Utils
-} // namespace Aws
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Logging
+ {
+
+ /**
+ * LogLevel used to control verbosity of logging system.
+ */
+ enum class LogLevel : int
+ {
+ Off = 0,
+ Fatal = 1,
+ Error = 2,
+ Warn = 3,
+ Info = 4,
+ Debug = 5,
+ Trace = 6
+ };
+
+ AWS_CORE_API Aws::String GetLogLevelName(LogLevel logLevel);
+
+ } // namespace Logging
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h
index a30bda089f..b400340de4 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h
@@ -2,44 +2,44 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/logging/LogLevel.h>
-#include <aws/core/utils/logging/AWSLogging.h>
-#include <aws/core/utils/logging/LogSystemInterface.h>
-#include <aws/core/utils/memory/stl/AWSStringStream.h>
-
-// While macros are usually grotty, using them here lets us have a simple function call interface for logging that
-//
-// (1) Can be compiled out completely, so you don't even have to pay the cost to check the log level (which will be a virtual function call and a std::atomic<> read) if you don't want any AWS logging
-// (2) If you use logging and the log statement doesn't pass the conditional log filter level, not only do you not pay the cost of building the log string, you don't pay the cost for allocating or
-// getting any of the values used in building the log string, as they're in a scope (if-statement) that never gets entered.
-
-#ifdef DISABLE_AWS_LOGGING
-
- #define AWS_LOG(level, tag, ...)
- #define AWS_LOG_FATAL(tag, ...)
- #define AWS_LOG_ERROR(tag, ...)
- #define AWS_LOG_WARN(tag, ...)
- #define AWS_LOG_INFO(tag, ...)
- #define AWS_LOG_DEBUG(tag, ...)
- #define AWS_LOG_TRACE(tag, ...)
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/logging/LogLevel.h>
+#include <aws/core/utils/logging/AWSLogging.h>
+#include <aws/core/utils/logging/LogSystemInterface.h>
+#include <aws/core/utils/memory/stl/AWSStringStream.h>
+
+// While macros are usually grotty, using them here lets us have a simple function call interface for logging that
+//
+// (1) Can be compiled out completely, so you don't even have to pay the cost to check the log level (which will be a virtual function call and a std::atomic<> read) if you don't want any AWS logging
+// (2) If you use logging and the log statement doesn't pass the conditional log filter level, not only do you not pay the cost of building the log string, you don't pay the cost for allocating or
+// getting any of the values used in building the log string, as they're in a scope (if-statement) that never gets entered.
+
+#ifdef DISABLE_AWS_LOGGING
+
+ #define AWS_LOG(level, tag, ...)
+ #define AWS_LOG_FATAL(tag, ...)
+ #define AWS_LOG_ERROR(tag, ...)
+ #define AWS_LOG_WARN(tag, ...)
+ #define AWS_LOG_INFO(tag, ...)
+ #define AWS_LOG_DEBUG(tag, ...)
+ #define AWS_LOG_TRACE(tag, ...)
#define AWS_LOG_FLUSH()
-
- #define AWS_LOGSTREAM(level, tag, streamExpression)
- #define AWS_LOGSTREAM_FATAL(tag, streamExpression)
- #define AWS_LOGSTREAM_ERROR(tag, streamExpression)
- #define AWS_LOGSTREAM_WARN(tag, streamExpression)
- #define AWS_LOGSTREAM_INFO(tag, streamExpression)
- #define AWS_LOGSTREAM_DEBUG(tag, streamExpression)
- #define AWS_LOGSTREAM_TRACE(tag, streamExpression)
+
+ #define AWS_LOGSTREAM(level, tag, streamExpression)
+ #define AWS_LOGSTREAM_FATAL(tag, streamExpression)
+ #define AWS_LOGSTREAM_ERROR(tag, streamExpression)
+ #define AWS_LOGSTREAM_WARN(tag, streamExpression)
+ #define AWS_LOGSTREAM_INFO(tag, streamExpression)
+ #define AWS_LOGSTREAM_DEBUG(tag, streamExpression)
+ #define AWS_LOGSTREAM_TRACE(tag, streamExpression)
#define AWS_LOGSTREAM_FLUSH()
-
-#else
-
+
+#else
+
#define AWS_LOG_FLUSH() \
{ \
Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
@@ -49,146 +49,146 @@
} \
}
- #define AWS_LOG(level, tag, ...) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= level ) \
- { \
- logSystem->Log(level, tag, __VA_ARGS__); \
- } \
- }
-
- #define AWS_LOG_FATAL(tag, ...) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Fatal ) \
- { \
- logSystem->Log(Aws::Utils::Logging::LogLevel::Fatal, tag, __VA_ARGS__); \
- } \
- }
-
- #define AWS_LOG_ERROR(tag, ...) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Error ) \
- { \
- logSystem->Log(Aws::Utils::Logging::LogLevel::Error, tag, __VA_ARGS__); \
- } \
- }
-
- #define AWS_LOG_WARN(tag, ...) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Warn ) \
- { \
- logSystem->Log(Aws::Utils::Logging::LogLevel::Warn, tag, __VA_ARGS__); \
- } \
- }
-
- #define AWS_LOG_INFO(tag, ...) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Info ) \
- { \
- logSystem->Log(Aws::Utils::Logging::LogLevel::Info, tag, __VA_ARGS__); \
- } \
- }
-
- #define AWS_LOG_DEBUG(tag, ...) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Debug ) \
- { \
- logSystem->Log(Aws::Utils::Logging::LogLevel::Debug, tag, __VA_ARGS__); \
- } \
- }
-
- #define AWS_LOG_TRACE(tag, ...) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Trace ) \
- { \
- logSystem->Log(Aws::Utils::Logging::LogLevel::Trace, tag, __VA_ARGS__); \
- } \
- }
-
- #define AWS_LOGSTREAM(level, tag, streamExpression) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= level ) \
- { \
- Aws::OStringStream logStream; \
- logStream << streamExpression; \
- logSystem->LogStream( logLevel, tag, logStream ); \
- } \
- }
-
- #define AWS_LOGSTREAM_FATAL(tag, streamExpression) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Fatal ) \
- { \
- Aws::OStringStream logStream; \
- logStream << streamExpression; \
- logSystem->LogStream( Aws::Utils::Logging::LogLevel::Fatal, tag, logStream ); \
- } \
- }
-
- #define AWS_LOGSTREAM_ERROR(tag, streamExpression) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Error ) \
- { \
- Aws::OStringStream logStream; \
- logStream << streamExpression; \
- logSystem->LogStream( Aws::Utils::Logging::LogLevel::Error, tag, logStream ); \
- } \
- }
-
- #define AWS_LOGSTREAM_WARN(tag, streamExpression) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Warn ) \
- { \
- Aws::OStringStream logStream; \
- logStream << streamExpression; \
- logSystem->LogStream( Aws::Utils::Logging::LogLevel::Warn, tag, logStream ); \
- } \
- }
-
- #define AWS_LOGSTREAM_INFO(tag, streamExpression) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Info ) \
- { \
- Aws::OStringStream logStream; \
- logStream << streamExpression; \
- logSystem->LogStream( Aws::Utils::Logging::LogLevel::Info, tag, logStream ); \
- } \
- }
-
- #define AWS_LOGSTREAM_DEBUG(tag, streamExpression) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Debug ) \
- { \
- Aws::OStringStream logStream; \
- logStream << streamExpression; \
- logSystem->LogStream( Aws::Utils::Logging::LogLevel::Debug, tag, logStream ); \
- } \
- }
-
- #define AWS_LOGSTREAM_TRACE(tag, streamExpression) \
- { \
- Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
- if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Trace ) \
- { \
- Aws::OStringStream logStream; \
- logStream << streamExpression; \
- logSystem->LogStream( Aws::Utils::Logging::LogLevel::Trace, tag, logStream ); \
- } \
- }
-
+ #define AWS_LOG(level, tag, ...) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= level ) \
+ { \
+ logSystem->Log(level, tag, __VA_ARGS__); \
+ } \
+ }
+
+ #define AWS_LOG_FATAL(tag, ...) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Fatal ) \
+ { \
+ logSystem->Log(Aws::Utils::Logging::LogLevel::Fatal, tag, __VA_ARGS__); \
+ } \
+ }
+
+ #define AWS_LOG_ERROR(tag, ...) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Error ) \
+ { \
+ logSystem->Log(Aws::Utils::Logging::LogLevel::Error, tag, __VA_ARGS__); \
+ } \
+ }
+
+ #define AWS_LOG_WARN(tag, ...) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Warn ) \
+ { \
+ logSystem->Log(Aws::Utils::Logging::LogLevel::Warn, tag, __VA_ARGS__); \
+ } \
+ }
+
+ #define AWS_LOG_INFO(tag, ...) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Info ) \
+ { \
+ logSystem->Log(Aws::Utils::Logging::LogLevel::Info, tag, __VA_ARGS__); \
+ } \
+ }
+
+ #define AWS_LOG_DEBUG(tag, ...) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Debug ) \
+ { \
+ logSystem->Log(Aws::Utils::Logging::LogLevel::Debug, tag, __VA_ARGS__); \
+ } \
+ }
+
+ #define AWS_LOG_TRACE(tag, ...) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Trace ) \
+ { \
+ logSystem->Log(Aws::Utils::Logging::LogLevel::Trace, tag, __VA_ARGS__); \
+ } \
+ }
+
+ #define AWS_LOGSTREAM(level, tag, streamExpression) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= level ) \
+ { \
+ Aws::OStringStream logStream; \
+ logStream << streamExpression; \
+ logSystem->LogStream( logLevel, tag, logStream ); \
+ } \
+ }
+
+ #define AWS_LOGSTREAM_FATAL(tag, streamExpression) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Fatal ) \
+ { \
+ Aws::OStringStream logStream; \
+ logStream << streamExpression; \
+ logSystem->LogStream( Aws::Utils::Logging::LogLevel::Fatal, tag, logStream ); \
+ } \
+ }
+
+ #define AWS_LOGSTREAM_ERROR(tag, streamExpression) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Error ) \
+ { \
+ Aws::OStringStream logStream; \
+ logStream << streamExpression; \
+ logSystem->LogStream( Aws::Utils::Logging::LogLevel::Error, tag, logStream ); \
+ } \
+ }
+
+ #define AWS_LOGSTREAM_WARN(tag, streamExpression) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Warn ) \
+ { \
+ Aws::OStringStream logStream; \
+ logStream << streamExpression; \
+ logSystem->LogStream( Aws::Utils::Logging::LogLevel::Warn, tag, logStream ); \
+ } \
+ }
+
+ #define AWS_LOGSTREAM_INFO(tag, streamExpression) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Info ) \
+ { \
+ Aws::OStringStream logStream; \
+ logStream << streamExpression; \
+ logSystem->LogStream( Aws::Utils::Logging::LogLevel::Info, tag, logStream ); \
+ } \
+ }
+
+ #define AWS_LOGSTREAM_DEBUG(tag, streamExpression) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Debug ) \
+ { \
+ Aws::OStringStream logStream; \
+ logStream << streamExpression; \
+ logSystem->LogStream( Aws::Utils::Logging::LogLevel::Debug, tag, logStream ); \
+ } \
+ }
+
+ #define AWS_LOGSTREAM_TRACE(tag, streamExpression) \
+ { \
+ Aws::Utils::Logging::LogSystemInterface* logSystem = Aws::Utils::Logging::GetLogSystem(); \
+ if ( logSystem && logSystem->GetLogLevel() >= Aws::Utils::Logging::LogLevel::Trace ) \
+ { \
+ Aws::OStringStream logStream; \
+ logStream << streamExpression; \
+ logSystem->LogStream( Aws::Utils::Logging::LogLevel::Trace, tag, logStream ); \
+ } \
+ }
+
#define AWS_LOGSTREAM_FLUSH() AWS_LOG_FLUSH()
-#endif // DISABLE_AWS_LOGGING
+#endif // DISABLE_AWS_LOGGING
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogSystemInterface.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogSystemInterface.h
index 3e83de729d..642d1c3022 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogSystemInterface.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/logging/LogSystemInterface.h
@@ -2,50 +2,50 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/memory/stl/AWSStringStream.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Logging
- {
- enum class LogLevel : int;
-
- /**
- * Interface for logging implementations. If you want to write your own logger, you can start here, though you may have more
- * luck going down one more level to FormattedLogSystem. It does a bit more of the work for you and still gives you the ability
- * to override the IO portion.
- */
- class AWS_CORE_API LogSystemInterface
- {
- public:
- virtual ~LogSystemInterface() = default;
-
- /**
- * Gets the currently configured log level for this logger.
- */
- virtual LogLevel GetLogLevel(void) const = 0;
- /**
- * Does a printf style output to the output stream. Don't use this, it's unsafe. See LogStream
- */
- virtual void Log(LogLevel logLevel, const char* tag, const char* formatStr, ...) = 0;
- /**
- * Writes the stream to the output stream.
- */
- virtual void LogStream(LogLevel logLevel, const char* tag, const Aws::OStringStream &messageStream) = 0;
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSStringStream.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Logging
+ {
+ enum class LogLevel : int;
+
+ /**
+ * Interface for logging implementations. If you want to write your own logger, you can start here, though you may have more
+ * luck going down one more level to FormattedLogSystem. It does a bit more of the work for you and still gives you the ability
+ * to override the IO portion.
+ */
+ class AWS_CORE_API LogSystemInterface
+ {
+ public:
+ virtual ~LogSystemInterface() = default;
+
+ /**
+ * Gets the currently configured log level for this logger.
+ */
+ virtual LogLevel GetLogLevel(void) const = 0;
+ /**
+ * Does a printf style output to the output stream. Don't use this, it's unsafe. See LogStream
+ */
+ virtual void Log(LogLevel logLevel, const char* tag, const char* formatStr, ...) = 0;
+ /**
+ * Writes the stream to the output stream.
+ */
+ virtual void LogStream(LogLevel logLevel, const char* tag, const Aws::OStringStream &messageStream) = 0;
/**
* Writes any buffered messages to the underlying device if the logger supports buffering.
*/
virtual void Flush() = 0;
- };
-
- } // namespace Logging
- } // namespace Utils
-} // namespace Aws
+ };
+
+ } // namespace Logging
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h
index 468a91766a..5b1221917a 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h
@@ -1,291 +1,291 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/UnreferencedParam.h>
-#include <aws/core/utils/memory/MemorySystemInterface.h>
-
-#include <memory>
-#include <cstdlib>
-#include <algorithm>
-#include <type_traits>
-
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/UnreferencedParam.h>
+#include <aws/core/utils/memory/MemorySystemInterface.h>
+
+#include <memory>
+#include <cstdlib>
+#include <algorithm>
+#include <type_traits>
+
struct aws_allocator;
-namespace Aws
-{
- namespace Utils
- {
- namespace Memory
- {
- /**
- *InitializeAWSMemory should be called at the very start of your program
- */
- AWS_CORE_API void InitializeAWSMemorySystem(MemorySystemInterface& memorySystem);
-
- /**
- * ShutdownAWSMemory should be called the very end of your program
- */
- AWS_CORE_API void ShutdownAWSMemorySystem(void);
-
- /**
- * Get the globally install memory system, if it has been installed.
- */
- AWS_CORE_API MemorySystemInterface* GetMemorySystem();
-
- } // namespace Memory
- } // namespace Utils
-
- /**
- * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
- * use these functions instead or Aws::MakeShared
- */
- AWS_CORE_API void* Malloc(const char* allocationTag, size_t allocationSize);
-
- /**
- * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
- * use these functions instead or Aws::MakeShared
- */
- AWS_CORE_API void Free(void* memoryPtr);
-
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Memory
+ {
+ /**
+ *InitializeAWSMemory should be called at the very start of your program
+ */
+ AWS_CORE_API void InitializeAWSMemorySystem(MemorySystemInterface& memorySystem);
+
+ /**
+ * ShutdownAWSMemory should be called the very end of your program
+ */
+ AWS_CORE_API void ShutdownAWSMemorySystem(void);
+
+ /**
+ * Get the globally install memory system, if it has been installed.
+ */
+ AWS_CORE_API MemorySystemInterface* GetMemorySystem();
+
+ } // namespace Memory
+ } // namespace Utils
+
+ /**
+ * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
+ * use these functions instead or Aws::MakeShared
+ */
+ AWS_CORE_API void* Malloc(const char* allocationTag, size_t allocationSize);
+
+ /**
+ * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
+ * use these functions instead or Aws::MakeShared
+ */
+ AWS_CORE_API void Free(void* memoryPtr);
+
AWS_CORE_API aws_allocator* get_aws_allocator();
- /**
- * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
- * use these functions instead or Aws::MakeShared
- */
- template<typename T, typename ...ArgTypes>
- T* New(const char* allocationTag, ArgTypes&&... args)
- {
- void *rawMemory = Malloc(allocationTag, sizeof(T));
- // http://stackoverflow.com/questions/6783993/placement-new-and-delete
- T *constructedMemory = new (rawMemory) T(std::forward<ArgTypes>(args)...);
- return constructedMemory;
- }
-/*
- * dynamic_cast of all sorts do not work on MSVC if RTTI is turned off.
- * This means that deleting an object via a pointer to one of its polymorphic base types that do not point to the
- * address of their concrete class will result in undefined behavior.
- * Example:
- * struct Foo : InterfaceA, InterfaceB {};
- * Aws::Delete(pointerToInterfaceB);
- */
-#if defined(_MSC_VER) && !defined(_CPPRTTI)
- template<typename T>
- void Delete(T* pointerToT)
- {
- if (pointerToT == nullptr)
- {
- return;
- }
- pointerToT->~T();
- Free(pointerToT);
- }
-#else
- /**
- * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
- * use these functions instead or Aws::MakeShared
- */
- template<typename T>
- typename std::enable_if<!std::is_polymorphic<T>::value>::type Delete(T* pointerToT)
- {
- if (pointerToT == nullptr)
- {
- return;
- }
- //http://stackoverflow.com/questions/6783993/placement-new-and-delete
- pointerToT->~T();
- Free(pointerToT);
- }
-
- template<typename T>
- typename std::enable_if<std::is_polymorphic<T>::value>::type Delete(T* pointerToT)
- {
- if (pointerToT == nullptr)
- {
- return;
- }
- // deal with deleting objects that implement multiple interfaces
- // see casting to pointer to void in http://en.cppreference.com/w/cpp/language/dynamic_cast
- // https://stackoverflow.com/questions/8123776/are-there-practical-uses-for-dynamic-casting-to-void-pointer
- // NOTE: on some compilers, calling the destructor before doing the dynamic_cast affects how calculation of
- // the address of the most derived class.
- void* mostDerivedT = dynamic_cast<void*>(pointerToT);
- pointerToT->~T();
- Free(mostDerivedT);
- }
-#endif // _CPPRTTI
-
- template<typename T>
- bool ShouldConstructArrayMembers()
- {
- return std::is_class<T>::value;
- }
-
- template<typename T>
- bool ShouldDestroyArrayMembers()
- {
- return !std::is_trivially_destructible<T>::value;
- }
-
- /**
- * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
- * use these functions instead or Aws::MakeShared
- */
- template<typename T>
- T* NewArray(std::size_t amount, const char* allocationTag)
- {
- if (amount > 0)
- {
- bool constructMembers = ShouldConstructArrayMembers<T>();
- bool trackMemberCount = ShouldDestroyArrayMembers<T>();
-
- // if we need to remember the # of items in the array (because we need to call their destructors) then allocate extra memory and keep the # of items in the extra slot
- std::size_t allocationSize = amount * sizeof(T);
-#if defined(_MSC_VER) && _MSC_VER < 1900
- std::size_t headerSize = (std::max)(sizeof(std::size_t), __alignof(T));
-#else
- std::size_t headerSize = (std::max)(sizeof(std::size_t), alignof(T));
-#endif
-
- if (trackMemberCount)
- {
- allocationSize += headerSize;
- }
-
- void* rawMemory = Malloc(allocationTag, allocationSize);
- T* pointerToT = nullptr;
-
- if (trackMemberCount)
- {
- std::size_t* pointerToAmount = reinterpret_cast<std::size_t*>(rawMemory);
- *pointerToAmount = amount;
- pointerToT = reinterpret_cast<T*>(reinterpret_cast<char*>(pointerToAmount) + headerSize);
-
- }
- else
- {
- pointerToT = reinterpret_cast<T*>(rawMemory);
- }
-
- if (constructMembers)
- {
- for (std::size_t i = 0; i < amount; ++i)
- {
- new (pointerToT + i) T;
- }
- }
-
- return pointerToT;
- }
-
- return nullptr;
- }
-
- /**
- * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
- * use these functions instead or Aws::MakeShared
- */
- template<typename T>
- void DeleteArray(T* pointerToTArray)
- {
- if (pointerToTArray == nullptr)
- {
- return;
- }
-
- bool destroyMembers = ShouldDestroyArrayMembers<T>();
- void* rawMemory = nullptr;
-
- if (destroyMembers)
- {
-#if defined(_MSC_VER) && _MSC_VER < 1900
- std::size_t headerSize = (std::max)(sizeof(std::size_t), __alignof(T));
-#else
- std::size_t headerSize = (std::max)(sizeof(std::size_t), alignof(T));
-#endif
-
- std::size_t *pointerToAmount = reinterpret_cast<std::size_t*>(reinterpret_cast<char*>(pointerToTArray) - headerSize);
- std::size_t amount = *pointerToAmount;
-
- for (std::size_t i = amount; i > 0; --i)
- {
- (pointerToTArray + i - 1)->~T();
- }
- rawMemory = reinterpret_cast<void *>(pointerToAmount);
- }
- else
- {
- rawMemory = reinterpret_cast<void *>(pointerToTArray);
- }
-
- Free(rawMemory);
- }
-
- /**
- * modeled from std::default_delete
- */
- template<typename T>
- struct Deleter
- {
- Deleter() {}
-
- template<class U, class = typename std::enable_if<std::is_convertible<U *, T *>::value, void>::type>
- Deleter(const Deleter<U>&)
- {
- }
-
- void operator()(T *pointerToT) const
- {
- static_assert(0 < sizeof(T), "can't delete an incomplete type");
- Aws::Delete(pointerToT);
- }
- };
-
- template< typename T > using UniquePtr = std::unique_ptr< T, Deleter< T > >;
-
- /**
- * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
- * use these functions instead or Aws::MakeShared
- */
- template<typename T, typename ...ArgTypes>
- UniquePtr<T> MakeUnique(const char* allocationTag, ArgTypes&&... args)
- {
- return UniquePtr<T>(Aws::New<T>(allocationTag, std::forward<ArgTypes>(args)...));
- }
-
- template<typename T>
- struct ArrayDeleter
- {
- ArrayDeleter() {}
-
- template<class U, class = typename std::enable_if<std::is_convertible<U *, T *>::value, void>::type>
- ArrayDeleter(const ArrayDeleter<U>&)
- {
- }
-
- void operator()(T *pointerToTArray) const
- {
- static_assert(0 < sizeof(T), "can't delete an incomplete type");
- Aws::DeleteArray(pointerToTArray);
- }
- };
-
- template< typename T > using UniqueArrayPtr = std::unique_ptr< T, ArrayDeleter< T > >;
-
- /**
- * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
- * use these functions instead or Aws::MakeShared
- */
- template<typename T, typename ...ArgTypes>
- UniqueArrayPtr<T> MakeUniqueArray(std::size_t amount, const char* allocationTag, ArgTypes&&... args)
- {
- return UniqueArrayPtr<T>(Aws::NewArray<T>(amount, allocationTag, std::forward<ArgTypes>(args)...));
- }
-
-} // namespace Aws
-
+ /**
+ * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
+ * use these functions instead or Aws::MakeShared
+ */
+ template<typename T, typename ...ArgTypes>
+ T* New(const char* allocationTag, ArgTypes&&... args)
+ {
+ void *rawMemory = Malloc(allocationTag, sizeof(T));
+ // http://stackoverflow.com/questions/6783993/placement-new-and-delete
+ T *constructedMemory = new (rawMemory) T(std::forward<ArgTypes>(args)...);
+ return constructedMemory;
+ }
+/*
+ * dynamic_cast of all sorts do not work on MSVC if RTTI is turned off.
+ * This means that deleting an object via a pointer to one of its polymorphic base types that do not point to the
+ * address of their concrete class will result in undefined behavior.
+ * Example:
+ * struct Foo : InterfaceA, InterfaceB {};
+ * Aws::Delete(pointerToInterfaceB);
+ */
+#if defined(_MSC_VER) && !defined(_CPPRTTI)
+ template<typename T>
+ void Delete(T* pointerToT)
+ {
+ if (pointerToT == nullptr)
+ {
+ return;
+ }
+ pointerToT->~T();
+ Free(pointerToT);
+ }
+#else
+ /**
+ * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
+ * use these functions instead or Aws::MakeShared
+ */
+ template<typename T>
+ typename std::enable_if<!std::is_polymorphic<T>::value>::type Delete(T* pointerToT)
+ {
+ if (pointerToT == nullptr)
+ {
+ return;
+ }
+ //http://stackoverflow.com/questions/6783993/placement-new-and-delete
+ pointerToT->~T();
+ Free(pointerToT);
+ }
+
+ template<typename T>
+ typename std::enable_if<std::is_polymorphic<T>::value>::type Delete(T* pointerToT)
+ {
+ if (pointerToT == nullptr)
+ {
+ return;
+ }
+ // deal with deleting objects that implement multiple interfaces
+ // see casting to pointer to void in http://en.cppreference.com/w/cpp/language/dynamic_cast
+ // https://stackoverflow.com/questions/8123776/are-there-practical-uses-for-dynamic-casting-to-void-pointer
+ // NOTE: on some compilers, calling the destructor before doing the dynamic_cast affects how calculation of
+ // the address of the most derived class.
+ void* mostDerivedT = dynamic_cast<void*>(pointerToT);
+ pointerToT->~T();
+ Free(mostDerivedT);
+ }
+#endif // _CPPRTTI
+
+ template<typename T>
+ bool ShouldConstructArrayMembers()
+ {
+ return std::is_class<T>::value;
+ }
+
+ template<typename T>
+ bool ShouldDestroyArrayMembers()
+ {
+ return !std::is_trivially_destructible<T>::value;
+ }
+
+ /**
+ * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
+ * use these functions instead or Aws::MakeShared
+ */
+ template<typename T>
+ T* NewArray(std::size_t amount, const char* allocationTag)
+ {
+ if (amount > 0)
+ {
+ bool constructMembers = ShouldConstructArrayMembers<T>();
+ bool trackMemberCount = ShouldDestroyArrayMembers<T>();
+
+ // if we need to remember the # of items in the array (because we need to call their destructors) then allocate extra memory and keep the # of items in the extra slot
+ std::size_t allocationSize = amount * sizeof(T);
+#if defined(_MSC_VER) && _MSC_VER < 1900
+ std::size_t headerSize = (std::max)(sizeof(std::size_t), __alignof(T));
+#else
+ std::size_t headerSize = (std::max)(sizeof(std::size_t), alignof(T));
+#endif
+
+ if (trackMemberCount)
+ {
+ allocationSize += headerSize;
+ }
+
+ void* rawMemory = Malloc(allocationTag, allocationSize);
+ T* pointerToT = nullptr;
+
+ if (trackMemberCount)
+ {
+ std::size_t* pointerToAmount = reinterpret_cast<std::size_t*>(rawMemory);
+ *pointerToAmount = amount;
+ pointerToT = reinterpret_cast<T*>(reinterpret_cast<char*>(pointerToAmount) + headerSize);
+
+ }
+ else
+ {
+ pointerToT = reinterpret_cast<T*>(rawMemory);
+ }
+
+ if (constructMembers)
+ {
+ for (std::size_t i = 0; i < amount; ++i)
+ {
+ new (pointerToT + i) T;
+ }
+ }
+
+ return pointerToT;
+ }
+
+ return nullptr;
+ }
+
+ /**
+ * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
+ * use these functions instead or Aws::MakeShared
+ */
+ template<typename T>
+ void DeleteArray(T* pointerToTArray)
+ {
+ if (pointerToTArray == nullptr)
+ {
+ return;
+ }
+
+ bool destroyMembers = ShouldDestroyArrayMembers<T>();
+ void* rawMemory = nullptr;
+
+ if (destroyMembers)
+ {
+#if defined(_MSC_VER) && _MSC_VER < 1900
+ std::size_t headerSize = (std::max)(sizeof(std::size_t), __alignof(T));
+#else
+ std::size_t headerSize = (std::max)(sizeof(std::size_t), alignof(T));
+#endif
+
+ std::size_t *pointerToAmount = reinterpret_cast<std::size_t*>(reinterpret_cast<char*>(pointerToTArray) - headerSize);
+ std::size_t amount = *pointerToAmount;
+
+ for (std::size_t i = amount; i > 0; --i)
+ {
+ (pointerToTArray + i - 1)->~T();
+ }
+ rawMemory = reinterpret_cast<void *>(pointerToAmount);
+ }
+ else
+ {
+ rawMemory = reinterpret_cast<void *>(pointerToTArray);
+ }
+
+ Free(rawMemory);
+ }
+
+ /**
+ * modeled from std::default_delete
+ */
+ template<typename T>
+ struct Deleter
+ {
+ Deleter() {}
+
+ template<class U, class = typename std::enable_if<std::is_convertible<U *, T *>::value, void>::type>
+ Deleter(const Deleter<U>&)
+ {
+ }
+
+ void operator()(T *pointerToT) const
+ {
+ static_assert(0 < sizeof(T), "can't delete an incomplete type");
+ Aws::Delete(pointerToT);
+ }
+ };
+
+ template< typename T > using UniquePtr = std::unique_ptr< T, Deleter< T > >;
+
+ /**
+ * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
+ * use these functions instead or Aws::MakeShared
+ */
+ template<typename T, typename ...ArgTypes>
+ UniquePtr<T> MakeUnique(const char* allocationTag, ArgTypes&&... args)
+ {
+ return UniquePtr<T>(Aws::New<T>(allocationTag, std::forward<ArgTypes>(args)...));
+ }
+
+ template<typename T>
+ struct ArrayDeleter
+ {
+ ArrayDeleter() {}
+
+ template<class U, class = typename std::enable_if<std::is_convertible<U *, T *>::value, void>::type>
+ ArrayDeleter(const ArrayDeleter<U>&)
+ {
+ }
+
+ void operator()(T *pointerToTArray) const
+ {
+ static_assert(0 < sizeof(T), "can't delete an incomplete type");
+ Aws::DeleteArray(pointerToTArray);
+ }
+ };
+
+ template< typename T > using UniqueArrayPtr = std::unique_ptr< T, ArrayDeleter< T > >;
+
+ /**
+ * ::new, ::delete, ::malloc, ::free, std::make_shared, and std::make_unique should not be used in SDK code
+ * use these functions instead or Aws::MakeShared
+ */
+ template<typename T, typename ...ArgTypes>
+ UniqueArrayPtr<T> MakeUniqueArray(std::size_t amount, const char* allocationTag, ArgTypes&&... args)
+ {
+ return UniqueArrayPtr<T>(Aws::NewArray<T>(amount, allocationTag, std::forward<ArgTypes>(args)...));
+ }
+
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/MemorySystemInterface.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/MemorySystemInterface.h
index f5e089cd61..0a8341ff86 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/MemorySystemInterface.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/MemorySystemInterface.h
@@ -1,50 +1,50 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <cstdlib>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Memory
- {
- /**
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <cstdlib>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Memory
+ {
+ /**
* Central interface for memory management customizations. To create a custom memory manager, implement this interface and then
- * call InitializeAWSMemorySystem().
- */
- class AWS_CORE_API MemorySystemInterface
- {
- public:
- virtual ~MemorySystemInterface() = default;
-
- /**
- * This is for initializing your memory manager in a static context. This can be empty if you don't need to do that.
- */
- virtual void Begin() = 0;
- /**
- * This is for cleaning up your memory manager in a static context. This can be empty if you don't need to do that.
- */
- virtual void End() = 0;
-
- /**
+ * call InitializeAWSMemorySystem().
+ */
+ class AWS_CORE_API MemorySystemInterface
+ {
+ public:
+ virtual ~MemorySystemInterface() = default;
+
+ /**
+ * This is for initializing your memory manager in a static context. This can be empty if you don't need to do that.
+ */
+ virtual void Begin() = 0;
+ /**
+ * This is for cleaning up your memory manager in a static context. This can be empty if you don't need to do that.
+ */
+ virtual void End() = 0;
+
+ /**
* Allocate your memory inside this method. blocksize and alignment are exactly the same as the std::allocator interfaces.
- * The allocationTag parameter is for memory tracking; you don't have to handle it.
- */
- virtual void* AllocateMemory(std::size_t blockSize, std::size_t alignment, const char *allocationTag = nullptr) = 0;
-
- /**
- * Free the memory pointed to by memoryPtr.
- */
- virtual void FreeMemory(void* memoryPtr) = 0;
- };
-
- } // namespace Memory
- } // namespace Utils
-} // namespace Aws
+ * The allocationTag parameter is for memory tracking; you don't have to handle it.
+ */
+ virtual void* AllocateMemory(std::size_t blockSize, std::size_t alignment, const char *allocationTag = nullptr) = 0;
+
+ /**
+ * Free the memory pointed to by memoryPtr.
+ */
+ virtual void FreeMemory(void* memoryPtr) = 0;
+ };
+
+ } // namespace Memory
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h
index c54ee873d5..932408b761 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h
@@ -1,100 +1,100 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/SDKConfig.h>
-#include <aws/core/utils/memory/AWSMemory.h>
-#include <aws/core/utils/memory/MemorySystemInterface.h>
-
-#include <memory>
-#include <cstdlib>
-
-namespace Aws
-{
-#ifdef USE_AWS_MEMORY_MANAGEMENT
- /**
- * Std allocator interface that is used for all STL types in the event that Custom Memory Management is being used.
- */
- template <typename T>
- class Allocator : public std::allocator<T>
- {
- public:
-
- typedef std::allocator<T> Base;
-
- Allocator() throw() :
- Base()
- {}
-
- Allocator(const Allocator<T>& a) throw() :
- Base(a)
- {}
-
- template <class U>
- Allocator(const Allocator<U>& a) throw() :
- Base(a)
- {}
-
- ~Allocator() throw() {}
-
- typedef std::size_t size_type;
-
- template<typename U>
- struct rebind
- {
- typedef Allocator<U> other;
- };
-
- typename Base::pointer allocate(size_type n, const void *hint = nullptr)
- {
- AWS_UNREFERENCED_PARAM(hint);
-
- return reinterpret_cast<typename Base::pointer>(Malloc("AWSSTL", n * sizeof(T)));
- }
-
- void deallocate(typename Base::pointer p, size_type n)
- {
- AWS_UNREFERENCED_PARAM(n);
-
- Free(p);
- }
-
- };
-
-#ifdef __ANDROID__
-#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
- template< typename T >
- bool operator ==(const Allocator< T >& lhs, const Allocator< T >& rhs)
- {
- AWS_UNREFERENCED_PARAM(lhs);
- AWS_UNREFERENCED_PARAM(rhs);
-
- return false;
- }
-#endif // _GLIBCXX_FULLY_DYNAMIC_STRING == 0
-#endif // __ANDROID__
-
-#else
-
- template< typename T > using Allocator = std::allocator<T>;
-
-#endif // USE_AWS_MEMORY_MANAGEMENT
- /**
- * Creates a shared_ptr using AWS Allocator hooks.
- * allocationTag is for memory tracking purposes.
- */
- template<typename T, typename ...ArgTypes>
- std::shared_ptr<T> MakeShared(const char* allocationTag, ArgTypes&&... args)
- {
- AWS_UNREFERENCED_PARAM(allocationTag);
-
- return std::allocate_shared<T, Aws::Allocator<T>>(Aws::Allocator<T>(), std::forward<ArgTypes>(args)...);
- }
-
-
-} // namespace Aws
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/SDKConfig.h>
+#include <aws/core/utils/memory/AWSMemory.h>
+#include <aws/core/utils/memory/MemorySystemInterface.h>
+
+#include <memory>
+#include <cstdlib>
+
+namespace Aws
+{
+#ifdef USE_AWS_MEMORY_MANAGEMENT
+ /**
+ * Std allocator interface that is used for all STL types in the event that Custom Memory Management is being used.
+ */
+ template <typename T>
+ class Allocator : public std::allocator<T>
+ {
+ public:
+
+ typedef std::allocator<T> Base;
+
+ Allocator() throw() :
+ Base()
+ {}
+
+ Allocator(const Allocator<T>& a) throw() :
+ Base(a)
+ {}
+
+ template <class U>
+ Allocator(const Allocator<U>& a) throw() :
+ Base(a)
+ {}
+
+ ~Allocator() throw() {}
+
+ typedef std::size_t size_type;
+
+ template<typename U>
+ struct rebind
+ {
+ typedef Allocator<U> other;
+ };
+
+ typename Base::pointer allocate(size_type n, const void *hint = nullptr)
+ {
+ AWS_UNREFERENCED_PARAM(hint);
+
+ return reinterpret_cast<typename Base::pointer>(Malloc("AWSSTL", n * sizeof(T)));
+ }
+
+ void deallocate(typename Base::pointer p, size_type n)
+ {
+ AWS_UNREFERENCED_PARAM(n);
+
+ Free(p);
+ }
+
+ };
+
+#ifdef __ANDROID__
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+ template< typename T >
+ bool operator ==(const Allocator< T >& lhs, const Allocator< T >& rhs)
+ {
+ AWS_UNREFERENCED_PARAM(lhs);
+ AWS_UNREFERENCED_PARAM(rhs);
+
+ return false;
+ }
+#endif // _GLIBCXX_FULLY_DYNAMIC_STRING == 0
+#endif // __ANDROID__
+
+#else
+
+ template< typename T > using Allocator = std::allocator<T>;
+
+#endif // USE_AWS_MEMORY_MANAGEMENT
+ /**
+ * Creates a shared_ptr using AWS Allocator hooks.
+ * allocationTag is for memory tracking purposes.
+ */
+ template<typename T, typename ...ArgTypes>
+ std::shared_ptr<T> MakeShared(const char* allocationTag, ArgTypes&&... args)
+ {
+ AWS_UNREFERENCED_PARAM(allocationTag);
+
+ return std::allocate_shared<T, Aws::Allocator<T>>(Aws::Allocator<T>(), std::forward<ArgTypes>(args)...);
+ }
+
+
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSDeque.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSDeque.h
index acb69ae68c..ed63b8e939 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSDeque.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSDeque.h
@@ -1,19 +1,19 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSAllocator.h>
-
-#include <deque>
-
-namespace Aws
-{
-
-template< typename T > using Deque = std::deque< T, Aws::Allocator< T > >;
-
-} // namespace Aws
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
+
+#include <deque>
+
+namespace Aws
+{
+
+template< typename T > using Deque = std::deque< T, Aws::Allocator< T > >;
+
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSList.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSList.h
index e2163c26b0..49341325a8 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSList.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSList.h
@@ -1,19 +1,19 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSAllocator.h>
-
-#include <list>
-
-namespace Aws
-{
-
-template< typename T > using List = std::list< T, Aws::Allocator< T > >;
-
-} // namespace Aws
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
+
+#include <list>
+
+namespace Aws
+{
+
+template< typename T > using List = std::list< T, Aws::Allocator< T > >;
+
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSMap.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSMap.h
index 566496ad40..66dc98bb8f 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSMap.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSMap.h
@@ -1,33 +1,33 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSAllocator.h>
-
-#include <map>
-#include <unordered_map>
-#include <cstring>
-
-namespace Aws
-{
-
-template< typename K, typename V > using Map = std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > >;
-template< typename K, typename V > using UnorderedMap = std::unordered_map< K, V, std::hash< K >, std::equal_to< K >, Aws::Allocator< std::pair< const K, V > > >;
-template< typename K, typename V > using MultiMap = std::multimap< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > >;
-
-struct CompareStrings
-{
- bool operator()(const char* a, const char* b) const
- {
- return std::strcmp(a, b) < 0;
- }
-};
-
-template<typename V> using CStringMap = std::map<const char*, V, CompareStrings, Aws::Allocator<std::pair<const char*, V> > >;
-
-} // namespace Aws
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
+
+#include <map>
+#include <unordered_map>
+#include <cstring>
+
+namespace Aws
+{
+
+template< typename K, typename V > using Map = std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > >;
+template< typename K, typename V > using UnorderedMap = std::unordered_map< K, V, std::hash< K >, std::equal_to< K >, Aws::Allocator< std::pair< const K, V > > >;
+template< typename K, typename V > using MultiMap = std::multimap< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > >;
+
+struct CompareStrings
+{
+ bool operator()(const char* a, const char* b) const
+ {
+ return std::strcmp(a, b) < 0;
+ }
+};
+
+template<typename V> using CStringMap = std::map<const char*, V, CompareStrings, Aws::Allocator<std::pair<const char*, V> > >;
+
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSQueue.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSQueue.h
index 5277947433..d45b245ad0 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSQueue.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSQueue.h
@@ -1,21 +1,21 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSAllocator.h>
-#include <aws/core/utils/memory/stl/AWSDeque.h>
-
-#include <deque>
-#include <queue>
-
-namespace Aws
-{
-
-template< typename T > using Queue = std::queue< T, Deque< T > >;
-
-} // namespace Aws
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
+#include <aws/core/utils/memory/stl/AWSDeque.h>
+
+#include <deque>
+#include <queue>
+
+namespace Aws
+{
+
+template< typename T > using Queue = std::queue< T, Deque< T > >;
+
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSSet.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSSet.h
index 64d99ae089..6aee204f39 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSSet.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSSet.h
@@ -1,19 +1,19 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSAllocator.h>
-
-#include <set>
-
-namespace Aws
-{
-
-template< typename T > using Set = std::set< T, std::less< T >, Aws::Allocator< T > >;
-
-} // namespace Aws
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
+
+#include <set>
+
+namespace Aws
+{
+
+template< typename T > using Set = std::set< T, std::less< T >, Aws::Allocator< T > >;
+
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStack.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStack.h
index 6fdb350117..7a3f561244 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStack.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStack.h
@@ -1,21 +1,21 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSAllocator.h>
-#include <aws/core/utils/memory/stl/AWSDeque.h>
-
-#include <deque>
-#include <stack>
-
-namespace Aws
-{
-
-template< typename T > using Stack = std::stack< T, Deque< T > >;
-
-} // namespace Aws
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
+#include <aws/core/utils/memory/stl/AWSDeque.h>
+
+#include <deque>
+#include <stack>
+
+namespace Aws
+{
+
+template< typename T > using Stack = std::stack< T, Deque< T > >;
+
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStreamFwd.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStreamFwd.h
index cc0d0be7c3..335346a31b 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStreamFwd.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStreamFwd.h
@@ -1,28 +1,28 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <iostream>
-#include <functional>
-
-namespace Aws
-{
-
-// Serves no purpose other than to help my conversion process
-typedef std::basic_ifstream< char, std::char_traits< char > > IFStream;
-typedef std::basic_ofstream< char, std::char_traits< char > > OFStream;
-typedef std::basic_fstream< char, std::char_traits< char > > FStream;
-typedef std::basic_istream< char, std::char_traits< char > > IStream;
-typedef std::basic_ostream< char, std::char_traits< char > > OStream;
-typedef std::basic_iostream< char, std::char_traits< char > > IOStream;
-typedef std::istreambuf_iterator< char, std::char_traits< char > > IStreamBufIterator;
-
-using IOStreamFactory = std::function< Aws::IOStream*(void) >;
-
-
-} // namespace Aws
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <iostream>
+#include <functional>
+
+namespace Aws
+{
+
+// Serves no purpose other than to help my conversion process
+typedef std::basic_ifstream< char, std::char_traits< char > > IFStream;
+typedef std::basic_ofstream< char, std::char_traits< char > > OFStream;
+typedef std::basic_fstream< char, std::char_traits< char > > FStream;
+typedef std::basic_istream< char, std::char_traits< char > > IStream;
+typedef std::basic_ostream< char, std::char_traits< char > > OStream;
+typedef std::basic_iostream< char, std::char_traits< char > > IOStream;
+typedef std::istreambuf_iterator< char, std::char_traits< char > > IStreamBufIterator;
+
+using IOStreamFactory = std::function< Aws::IOStream*(void) >;
+
+
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSString.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSString.h
index fd1fe725bf..3cd013e3f8 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSString.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSString.h
@@ -1,108 +1,108 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSAllocator.h>
-
-#include <functional>
-#include <string>
-
-namespace Aws
-{
-
-#if defined(_GLIBCXX_FULLY_DYNAMIC_STRING) && _GLIBCXX_FULLY_DYNAMIC_STRING == 0 && defined(__ANDROID__)
-
-/*
-using std::string with shared libraries is broken on android when using gnustl
-due to the platform-level decision to set _GLIBCXX_FULLY_DYNAMIC_STRING to 0
-
-The problem:
-
-(1) _GLIBCXX_FULLY_DYNAMIC_STRING is set to 0 in Android's c++config.h for gnustl
-(2) The optimization that this enables is completely broken if using shared libraries and there is no way to opt out of using it.
- An optimization that uses a comparison to a static memory address is death for shared libraries.
-
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
+
+#include <functional>
+#include <string>
+
+namespace Aws
+{
+
+#if defined(_GLIBCXX_FULLY_DYNAMIC_STRING) && _GLIBCXX_FULLY_DYNAMIC_STRING == 0 && defined(__ANDROID__)
+
+/*
+using std::string with shared libraries is broken on android when using gnustl
+due to the platform-level decision to set _GLIBCXX_FULLY_DYNAMIC_STRING to 0
+
+The problem:
+
+(1) _GLIBCXX_FULLY_DYNAMIC_STRING is set to 0 in Android's c++config.h for gnustl
+(2) The optimization that this enables is completely broken if using shared libraries and there is no way to opt out of using it.
+ An optimization that uses a comparison to a static memory address is death for shared libraries.
+
Supposing you have a shared library B that depends on another shared library A. There are a variety of innocuous scenarios where you end up crashing
in the std::basic_string destructor because it's attempting to free a static memory address (&std::string::_Rep_Base::_S_empty_rep_storage -- you'll need to temporarily
flip the struct to "public:" in order to take this address from your code).
-If you take the address of this location, you will get two
-different answers depending on whether you query it in library A or library B (oddly enough, if you look the symbol itself up, it only shows up as public weak in
-libgnustl_shared.so). When the string destructor is run from the context of library B, the _Rep::_M_dispose function will end up attempting to free
-an address that is static memory (from library A).
-
-
-Lessons (with the empty string optimization forced on you):
- (1) You can't move std::strings across shared libraries (as a part of another class, Outcome in our case)
+If you take the address of this location, you will get two
+different answers depending on whether you query it in library A or library B (oddly enough, if you look the symbol itself up, it only shows up as public weak in
+libgnustl_shared.so). When the string destructor is run from the context of library B, the _Rep::_M_dispose function will end up attempting to free
+an address that is static memory (from library A).
+
+
+Lessons (with the empty string optimization forced on you):
+ (1) You can't move std::strings across shared libraries (as a part of another class, Outcome in our case)
(2) If you default initialize a std::string member variable, you can't have a mismatched constructor/destructor pair such that one is in a cpp file and the other
- is missing/implicit or defined in the header file
-
-Solutions:
-
-Use libc++ rather than gnustl
-
-For those who must use gnustl, we have provided a working solution by cobbling together a set of hacks:
-
-We prevent the empty string optimization from ever being run on our strings by:
+ is missing/implicit or defined in the header file
+
+Solutions:
+
+Use libc++ rather than gnustl
+
+For those who must use gnustl, we have provided a working solution by cobbling together a set of hacks:
+
+We prevent the empty string optimization from ever being run on our strings by:
(1) Make Aws::Allocator always fail equality checks with itself; this check is part of the empty string optimization in several std::basic_string constructors
- (2) All other cases are prevented by turning Aws::String into a subclass whose default constructor and move operations go to baseclass versions which will not
- perform the empty string optimization
-
-Those changes prevent crashes, but lead to very poor performance when using a string stream; every character added will result in multiple copies of the entire
-string (ie, quadratic).
-
-To fix the performance problems, we have put together a set of replacement classes, SimpleStreamBuf and SimpleStringStream, that
-replace std::stringstream and std::stringbuf in SDK code. These replacements use raw buffers rather than strings in order to
-avoid the performance issues.
-
-This solution is only enabled if using gnustl on Android. In all other situations, normal STL types are used.
-*/
-
-using AndroidBasicString = std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > >;
-
-class String : public AndroidBasicString
-{
- public:
- using Base = AndroidBasicString;
-
- String() : Base("") {} // allocator comparison failure will cause empty string optimisation to be skipped
- String(const String& rhs ) : Base(rhs) {}
- String(String&& rhs) : Base(rhs) {} // DO NOT CALL std::move, let this go to the const ref constructor
- String(const AndroidBasicString& rhs) : Base(rhs) {}
- String(AndroidBasicString&& rhs) : Base(rhs) {} // DO NOT CALL std::move, let this go to the const ref constructor
- String(const char* str) : Base(str) {}
- String(const char* str_begin, const char* str_end) : Base(str_begin, str_end) {}
+ (2) All other cases are prevented by turning Aws::String into a subclass whose default constructor and move operations go to baseclass versions which will not
+ perform the empty string optimization
+
+Those changes prevent crashes, but lead to very poor performance when using a string stream; every character added will result in multiple copies of the entire
+string (ie, quadratic).
+
+To fix the performance problems, we have put together a set of replacement classes, SimpleStreamBuf and SimpleStringStream, that
+replace std::stringstream and std::stringbuf in SDK code. These replacements use raw buffers rather than strings in order to
+avoid the performance issues.
+
+This solution is only enabled if using gnustl on Android. In all other situations, normal STL types are used.
+*/
+
+using AndroidBasicString = std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > >;
+
+class String : public AndroidBasicString
+{
+ public:
+ using Base = AndroidBasicString;
+
+ String() : Base("") {} // allocator comparison failure will cause empty string optimisation to be skipped
+ String(const String& rhs ) : Base(rhs) {}
+ String(String&& rhs) : Base(rhs) {} // DO NOT CALL std::move, let this go to the const ref constructor
+ String(const AndroidBasicString& rhs) : Base(rhs) {}
+ String(AndroidBasicString&& rhs) : Base(rhs) {} // DO NOT CALL std::move, let this go to the const ref constructor
+ String(const char* str) : Base(str) {}
+ String(const char* str_begin, const char* str_end) : Base(str_begin, str_end) {}
String(const AndroidBasicString& str, size_type pos, size_type count) : Base(str, pos, count) {}
- String(const String& str, size_type pos, size_type count) : Base(str, pos, count) {}
- String(const char* str, size_type count) : Base(str, count) {}
- String(size_type count, char c) : Base(count, c) {}
- String(std::initializer_list<char> __l) : Base(__l) {}
-
- template<class _InputIterator>
- String(_InputIterator __beg, _InputIterator __end) : Base(__beg, __end) {}
-
- String& operator=(const String& rhs) { Base::operator=(rhs); return *this; }
- String& operator=(String&& rhs) { Base::operator=(rhs); return *this; } // might be ok to use std::move (base class uses swap) but let's be safe
- String& operator=(const AndroidBasicString& rhs) { Base::operator=(rhs); return *this; }
- String& operator=(AndroidBasicString&& rhs) { Base::operator=(rhs); return *this; } // might be ok to use std::move (base class uses swap) but let's be safe
- String& operator=(const char* str) { Base::operator=(str); return *this; }
-};
-
-#else
-
-using String = std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > >;
-
-#ifdef _WIN32
-using WString = std::basic_string< wchar_t, std::char_traits< wchar_t >, Aws::Allocator< wchar_t > >;
-#endif
-
-#endif // __ANDROID
-
-} // namespace Aws
-
-
-
+ String(const String& str, size_type pos, size_type count) : Base(str, pos, count) {}
+ String(const char* str, size_type count) : Base(str, count) {}
+ String(size_type count, char c) : Base(count, c) {}
+ String(std::initializer_list<char> __l) : Base(__l) {}
+
+ template<class _InputIterator>
+ String(_InputIterator __beg, _InputIterator __end) : Base(__beg, __end) {}
+
+ String& operator=(const String& rhs) { Base::operator=(rhs); return *this; }
+ String& operator=(String&& rhs) { Base::operator=(rhs); return *this; } // might be ok to use std::move (base class uses swap) but let's be safe
+ String& operator=(const AndroidBasicString& rhs) { Base::operator=(rhs); return *this; }
+ String& operator=(AndroidBasicString&& rhs) { Base::operator=(rhs); return *this; } // might be ok to use std::move (base class uses swap) but let's be safe
+ String& operator=(const char* str) { Base::operator=(str); return *this; }
+};
+
+#else
+
+using String = std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > >;
+
+#ifdef _WIN32
+using WString = std::basic_string< wchar_t, std::char_traits< wchar_t >, Aws::Allocator< wchar_t > >;
+#endif
+
+#endif // __ANDROID
+
+} // namespace Aws
+
+
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStringStream.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStringStream.h
index 2ec3ee68d4..a5e6f4ae48 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStringStream.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStringStream.h
@@ -1,42 +1,42 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#if defined(_GLIBCXX_FULLY_DYNAMIC_STRING) && _GLIBCXX_FULLY_DYNAMIC_STRING == 0 && defined(__ANDROID__)
-
-#include <aws/core/utils/memory/stl/SimpleStringStream.h>
-
-#else
-
-#include <aws/core/utils/memory/stl/AWSAllocator.h>
-
-#include <sstream>
-
-#endif
-
-namespace Aws
-{
-
-#if defined(_GLIBCXX_FULLY_DYNAMIC_STRING) && _GLIBCXX_FULLY_DYNAMIC_STRING == 0 && defined(__ANDROID__)
-
-// see the large comment block in AWSString.h for an explanation
-typedef Aws::SimpleStringStream StringStream;
-typedef Aws::SimpleIStringStream IStringStream;
-typedef Aws::SimpleOStringStream OStringStream;
-typedef Aws::Utils::Stream::SimpleStreamBuf StringBuf;
-
-#else
-
-typedef std::basic_stringstream< char, std::char_traits< char >, Aws::Allocator< char > > StringStream;
-typedef std::basic_istringstream< char, std::char_traits< char >, Aws::Allocator< char > > IStringStream;
-typedef std::basic_ostringstream< char, std::char_traits< char >, Aws::Allocator< char > > OStringStream;
-typedef std::basic_stringbuf< char, std::char_traits< char >, Aws::Allocator< char > > StringBuf;
-
-#endif
-
-} // namespace Aws
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#if defined(_GLIBCXX_FULLY_DYNAMIC_STRING) && _GLIBCXX_FULLY_DYNAMIC_STRING == 0 && defined(__ANDROID__)
+
+#include <aws/core/utils/memory/stl/SimpleStringStream.h>
+
+#else
+
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
+
+#include <sstream>
+
+#endif
+
+namespace Aws
+{
+
+#if defined(_GLIBCXX_FULLY_DYNAMIC_STRING) && _GLIBCXX_FULLY_DYNAMIC_STRING == 0 && defined(__ANDROID__)
+
+// see the large comment block in AWSString.h for an explanation
+typedef Aws::SimpleStringStream StringStream;
+typedef Aws::SimpleIStringStream IStringStream;
+typedef Aws::SimpleOStringStream OStringStream;
+typedef Aws::Utils::Stream::SimpleStreamBuf StringBuf;
+
+#else
+
+typedef std::basic_stringstream< char, std::char_traits< char >, Aws::Allocator< char > > StringStream;
+typedef std::basic_istringstream< char, std::char_traits< char >, Aws::Allocator< char > > IStringStream;
+typedef std::basic_ostringstream< char, std::char_traits< char >, Aws::Allocator< char > > OStringStream;
+typedef std::basic_stringbuf< char, std::char_traits< char >, Aws::Allocator< char > > StringBuf;
+
+#endif
+
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSVector.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSVector.h
index 4f3c62ba71..d9f67825c7 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSVector.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSVector.h
@@ -1,19 +1,19 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/memory/stl/AWSAllocator.h>
-
-#include <vector>
-
-namespace Aws
-{
-
-template< typename T > using Vector = std::vector< T, Aws::Allocator< T > >;
-
-} // namespace Aws
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
+
+#include <vector>
+
+namespace Aws
+{
+
+template< typename T > using Vector = std::vector< T, Aws::Allocator< T > >;
+
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/SimpleStringStream.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/SimpleStringStream.h
index 0be4fdc106..45c4d0a448 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/SimpleStringStream.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/SimpleStringStream.h
@@ -1,126 +1,126 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/stream/SimpleStreamBuf.h>
-
-#include <iostream>
-
-namespace Aws
-{
-
-class AWS_CORE_API SimpleStringStream : public std::iostream
-{
- public:
-
- using char_type = char;
- using traits_type = std::char_traits<char>;
- using allocator_type = Aws::Allocator<char>;
- using int_type = int;
- using pos_type = std::streampos;
- using off_type = std::streamoff;
-
- using base = std::iostream;
-
- SimpleStringStream();
- SimpleStringStream(const Aws::String& value);
-
- virtual ~SimpleStringStream() {}
-
- // disabling copies of course
- SimpleStringStream(const SimpleStringStream& rhs) = delete;
- SimpleStringStream& operator=(const SimpleStringStream& rhs) = delete;
-
- // also disabling moves until there's a valid need
- SimpleStringStream(SimpleStringStream&& rhs) = delete;
- SimpleStringStream& operator=(SimpleStringStream&& rhs) = delete;
-
- Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); }
-
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/stream/SimpleStreamBuf.h>
+
+#include <iostream>
+
+namespace Aws
+{
+
+class AWS_CORE_API SimpleStringStream : public std::iostream
+{
+ public:
+
+ using char_type = char;
+ using traits_type = std::char_traits<char>;
+ using allocator_type = Aws::Allocator<char>;
+ using int_type = int;
+ using pos_type = std::streampos;
+ using off_type = std::streamoff;
+
+ using base = std::iostream;
+
+ SimpleStringStream();
+ SimpleStringStream(const Aws::String& value);
+
+ virtual ~SimpleStringStream() {}
+
+ // disabling copies of course
+ SimpleStringStream(const SimpleStringStream& rhs) = delete;
+ SimpleStringStream& operator=(const SimpleStringStream& rhs) = delete;
+
+ // also disabling moves until there's a valid need
+ SimpleStringStream(SimpleStringStream&& rhs) = delete;
+ SimpleStringStream& operator=(SimpleStringStream&& rhs) = delete;
+
+ Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); }
+
Aws::String str() const { return m_streamBuffer.str(); }
void str(const Aws::String& value);
-
- private:
-
- Aws::Utils::Stream::SimpleStreamBuf m_streamBuffer;
-};
-
-class AWS_CORE_API SimpleIStringStream : public std::istream
-{
- public:
-
- using char_type = char;
- using traits_type = std::char_traits<char>;
- using allocator_type = Aws::Allocator<char>;
- using int_type = int;
- using pos_type = std::streampos;
- using off_type = std::streamoff;
-
- using base = std::istream;
-
- SimpleIStringStream();
- SimpleIStringStream(const Aws::String& value);
-
- virtual ~SimpleIStringStream() {}
-
- // disabling copies of course
- SimpleIStringStream(const SimpleIStringStream& rhs) = delete;
- SimpleIStringStream& operator=(const SimpleIStringStream& rhs) = delete;
-
- // also disabling moves until there's a valid need
- SimpleIStringStream(SimpleIStringStream&& rhs) = delete;
- SimpleIStringStream& operator=(SimpleIStringStream&& rhs) = delete;
-
- Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); }
-
+
+ private:
+
+ Aws::Utils::Stream::SimpleStreamBuf m_streamBuffer;
+};
+
+class AWS_CORE_API SimpleIStringStream : public std::istream
+{
+ public:
+
+ using char_type = char;
+ using traits_type = std::char_traits<char>;
+ using allocator_type = Aws::Allocator<char>;
+ using int_type = int;
+ using pos_type = std::streampos;
+ using off_type = std::streamoff;
+
+ using base = std::istream;
+
+ SimpleIStringStream();
+ SimpleIStringStream(const Aws::String& value);
+
+ virtual ~SimpleIStringStream() {}
+
+ // disabling copies of course
+ SimpleIStringStream(const SimpleIStringStream& rhs) = delete;
+ SimpleIStringStream& operator=(const SimpleIStringStream& rhs) = delete;
+
+ // also disabling moves until there's a valid need
+ SimpleIStringStream(SimpleIStringStream&& rhs) = delete;
+ SimpleIStringStream& operator=(SimpleIStringStream&& rhs) = delete;
+
+ Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); }
+
Aws::String str() const { return m_streamBuffer.str(); }
void str(const Aws::String& value);
-
- private:
-
- Aws::Utils::Stream::SimpleStreamBuf m_streamBuffer;
-};
-
-class AWS_CORE_API SimpleOStringStream : public std::ostream
-{
- public:
-
- using char_type = char;
- using traits_type = std::char_traits<char>;
- using allocator_type = Aws::Allocator<char>;
- using int_type = int;
- using pos_type = std::streampos;
- using off_type = std::streamoff;
-
- using base = std::ostream;
-
- SimpleOStringStream();
- SimpleOStringStream(const Aws::String& value);
-
- virtual ~SimpleOStringStream() {}
-
- // disabling copies of course
- SimpleOStringStream(const SimpleOStringStream& rhs) = delete;
- SimpleOStringStream& operator=(const SimpleOStringStream& rhs) = delete;
-
- // also disabling moves until there's a valid need
- SimpleOStringStream(SimpleOStringStream&& rhs) = delete;
- SimpleOStringStream& operator=(SimpleOStringStream&& rhs) = delete;
-
- Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); }
-
+
+ private:
+
+ Aws::Utils::Stream::SimpleStreamBuf m_streamBuffer;
+};
+
+class AWS_CORE_API SimpleOStringStream : public std::ostream
+{
+ public:
+
+ using char_type = char;
+ using traits_type = std::char_traits<char>;
+ using allocator_type = Aws::Allocator<char>;
+ using int_type = int;
+ using pos_type = std::streampos;
+ using off_type = std::streamoff;
+
+ using base = std::ostream;
+
+ SimpleOStringStream();
+ SimpleOStringStream(const Aws::String& value);
+
+ virtual ~SimpleOStringStream() {}
+
+ // disabling copies of course
+ SimpleOStringStream(const SimpleOStringStream& rhs) = delete;
+ SimpleOStringStream& operator=(const SimpleOStringStream& rhs) = delete;
+
+ // also disabling moves until there's a valid need
+ SimpleOStringStream(SimpleOStringStream&& rhs) = delete;
+ SimpleOStringStream& operator=(SimpleOStringStream&& rhs) = delete;
+
+ Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); }
+
Aws::String str() const { return m_streamBuffer.str(); }
void str(const Aws::String& value);
-
- private:
-
- Aws::Utils::Stream::SimpleStreamBuf m_streamBuffer;
-};
-
-} // namespace Aws
-
+
+ private:
+
+ Aws::Utils::Stream::SimpleStreamBuf m_streamBuffer;
+};
+
+} // namespace Aws
+
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/RateLimiterInterface.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/RateLimiterInterface.h
index 44d71ee399..578c9ed844 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/RateLimiterInterface.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/ratelimiter/RateLimiterInterface.h
@@ -2,44 +2,44 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <stdint.h>
-#include <chrono>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace RateLimits
- {
- /**
- * Interface for bandwidth limiters. You likely don't want to implement your own as DefaultRateLimiter is probably what you need.
- * If you need to implement one, then this is the interface to implement.
- */
- class RateLimiterInterface
- {
- public:
- using DelayType = std::chrono::milliseconds;
-
- virtual ~RateLimiterInterface() {}
- /**
- * Calculates time in milliseconds that should be delayed before letting anymore data through.
- */
- virtual DelayType ApplyCost(int64_t cost) = 0;
- /**
- * Same as ApplyCost() but then goes ahead and sleeps the current thread.
- */
- virtual void ApplyAndPayForCost(int64_t cost) = 0;
- /**
- * Update the bandwidth rate to allow.
- */
- virtual void SetRate(int64_t rate, bool resetAccumulator = false) = 0;
- };
-
- } // namespace RateLimits
- } // namespace Utils
-} // namespace Aws \ No newline at end of file
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <stdint.h>
+#include <chrono>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace RateLimits
+ {
+ /**
+ * Interface for bandwidth limiters. You likely don't want to implement your own as DefaultRateLimiter is probably what you need.
+ * If you need to implement one, then this is the interface to implement.
+ */
+ class RateLimiterInterface
+ {
+ public:
+ using DelayType = std::chrono::milliseconds;
+
+ virtual ~RateLimiterInterface() {}
+ /**
+ * Calculates time in milliseconds that should be delayed before letting anymore data through.
+ */
+ virtual DelayType ApplyCost(int64_t cost) = 0;
+ /**
+ * Same as ApplyCost() but then goes ahead and sleeps the current thread.
+ */
+ virtual void ApplyAndPayForCost(int64_t cost) = 0;
+ /**
+ * Update the bandwidth rate to allow.
+ */
+ virtual void SetRate(int64_t rate, bool resetAccumulator = false) = 0;
+ };
+
+ } // namespace RateLimits
+ } // namespace Utils
+} // namespace Aws \ No newline at end of file
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/PreallocatedStreamBuf.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/PreallocatedStreamBuf.h
index 3e36402fb5..ad9dc2a929 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/PreallocatedStreamBuf.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/PreallocatedStreamBuf.h
@@ -1,56 +1,56 @@
-
+
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/Array.h>
-#include <streambuf>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Stream
- {
- /**
- * this is a stream buf to use with std::iostream that uses a preallocated buffer under the hood.
- */
- class AWS_CORE_API PreallocatedStreamBuf : public std::streambuf
- {
- public:
- /**
- * Initialize the stream buffer with a pointer to your buffer. This class never takes ownership
- * of the buffer. It is your responsibility to delete it once the stream is no longer in use.
- * @param buffer buffer to initialize from.
- * @param lengthToRead length in bytes to actually use in the buffer (e.g. you have a 1kb buffer, but only want the stream
- * to see 500 b of it.
- */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/Array.h>
+#include <streambuf>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Stream
+ {
+ /**
+ * this is a stream buf to use with std::iostream that uses a preallocated buffer under the hood.
+ */
+ class AWS_CORE_API PreallocatedStreamBuf : public std::streambuf
+ {
+ public:
+ /**
+ * Initialize the stream buffer with a pointer to your buffer. This class never takes ownership
+ * of the buffer. It is your responsibility to delete it once the stream is no longer in use.
+ * @param buffer buffer to initialize from.
+ * @param lengthToRead length in bytes to actually use in the buffer (e.g. you have a 1kb buffer, but only want the stream
+ * to see 500 b of it.
+ */
PreallocatedStreamBuf(unsigned char* buffer, uint64_t lengthToRead);
-
- PreallocatedStreamBuf(const PreallocatedStreamBuf&) = delete;
- PreallocatedStreamBuf& operator=(const PreallocatedStreamBuf&) = delete;
-
- PreallocatedStreamBuf(PreallocatedStreamBuf&& toMove) = delete;
- PreallocatedStreamBuf& operator=(PreallocatedStreamBuf&&) = delete;
-
- /**
- * Get the buffer that is being used by the stream buffer.
- * @return Pointer to the underlying buffer (probably for a Aws::Delete() call).
- */
+
+ PreallocatedStreamBuf(const PreallocatedStreamBuf&) = delete;
+ PreallocatedStreamBuf& operator=(const PreallocatedStreamBuf&) = delete;
+
+ PreallocatedStreamBuf(PreallocatedStreamBuf&& toMove) = delete;
+ PreallocatedStreamBuf& operator=(PreallocatedStreamBuf&&) = delete;
+
+ /**
+ * Get the buffer that is being used by the stream buffer.
+ * @return Pointer to the underlying buffer (probably for a Aws::Delete() call).
+ */
unsigned char* GetBuffer() { return m_underlyingBuffer; }
-
- protected:
- pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override;
- pos_type seekpos(pos_type pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override;
-
- private:
+
+ protected:
+ pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override;
+ pos_type seekpos(pos_type pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override;
+
+ private:
unsigned char* m_underlyingBuffer;
const uint64_t m_lengthToRead;
- };
- }
- }
-}
+ };
+ }
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ResponseStream.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ResponseStream.h
index 071541f2ab..e82e6448cd 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ResponseStream.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/ResponseStream.h
@@ -2,73 +2,73 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/AWSMemory.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Stream
- {
- /**
- * Encapsulates and manages ownership of custom response streams. This is a move only type.
- */
- class AWS_CORE_API ResponseStream
- {
- public:
- /**
- * sets underlying stream to nullptr
- */
- ResponseStream();
- /**
- * moves the underlying stream
- */
- ResponseStream(ResponseStream&&);
- /**
- * Uses factory to allocate underlying stream
- */
- ResponseStream(const Aws::IOStreamFactory& factory);
- /**
- * Takes ownership of an underlying stream.
- */
- ResponseStream(IOStream* underlyingStreamToManage);
- ResponseStream(const ResponseStream&) = delete;
- ~ResponseStream();
-
- /**
- * moves the underlying stream
- */
- ResponseStream& operator=(ResponseStream&&);
- ResponseStream& operator=(const ResponseStream&) = delete;
-
- /**
- * Gives access to underlying stream, but keep in mind that this changes state of the stream
- */
- inline Aws::IOStream& GetUnderlyingStream() const { return *m_underlyingStream; }
-
- private:
- void ReleaseStream();
-
- Aws::IOStream* m_underlyingStream;
- };
-
- class AWS_CORE_API DefaultUnderlyingStream : public Aws::IOStream
- {
- public:
- using Base = Aws::IOStream;
-
- DefaultUnderlyingStream();
- DefaultUnderlyingStream(Aws::UniquePtr<std::streambuf> buf);
- virtual ~DefaultUnderlyingStream();
- };
-
- AWS_CORE_API Aws::IOStream* DefaultResponseStreamFactoryMethod();
-
- } //namespace Stream
- } //namespace Utils
-} //namespace Aws
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/AWSMemory.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Stream
+ {
+ /**
+ * Encapsulates and manages ownership of custom response streams. This is a move only type.
+ */
+ class AWS_CORE_API ResponseStream
+ {
+ public:
+ /**
+ * sets underlying stream to nullptr
+ */
+ ResponseStream();
+ /**
+ * moves the underlying stream
+ */
+ ResponseStream(ResponseStream&&);
+ /**
+ * Uses factory to allocate underlying stream
+ */
+ ResponseStream(const Aws::IOStreamFactory& factory);
+ /**
+ * Takes ownership of an underlying stream.
+ */
+ ResponseStream(IOStream* underlyingStreamToManage);
+ ResponseStream(const ResponseStream&) = delete;
+ ~ResponseStream();
+
+ /**
+ * moves the underlying stream
+ */
+ ResponseStream& operator=(ResponseStream&&);
+ ResponseStream& operator=(const ResponseStream&) = delete;
+
+ /**
+ * Gives access to underlying stream, but keep in mind that this changes state of the stream
+ */
+ inline Aws::IOStream& GetUnderlyingStream() const { return *m_underlyingStream; }
+
+ private:
+ void ReleaseStream();
+
+ Aws::IOStream* m_underlyingStream;
+ };
+
+ class AWS_CORE_API DefaultUnderlyingStream : public Aws::IOStream
+ {
+ public:
+ using Base = Aws::IOStream;
+
+ DefaultUnderlyingStream();
+ DefaultUnderlyingStream(Aws::UniquePtr<std::streambuf> buf);
+ virtual ~DefaultUnderlyingStream();
+ };
+
+ AWS_CORE_API Aws::IOStream* DefaultResponseStreamFactoryMethod();
+
+ } //namespace Stream
+ } //namespace Utils
+} //namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/SimpleStreamBuf.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/SimpleStreamBuf.h
index 35256ab633..ef12c60ba3 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/SimpleStreamBuf.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/stream/SimpleStreamBuf.h
@@ -1,64 +1,64 @@
-
+
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-#include <aws/core/utils/memory/stl/AWSVector.h>
-#include <streambuf>
-
-namespace Aws
-{
-namespace Utils
-{
-namespace Stream
-{
- /**
- * A replacement for std::stringbuf when using Android and gnustl together
- */
- class AWS_CORE_API SimpleStreamBuf : public std::streambuf
- {
- public:
-
- using base = std::streambuf;
-
- SimpleStreamBuf();
- explicit SimpleStreamBuf(const Aws::String& value);
-
- SimpleStreamBuf(const SimpleStreamBuf&) = delete;
- SimpleStreamBuf& operator=(const SimpleStreamBuf&) = delete;
-
- SimpleStreamBuf(SimpleStreamBuf&& toMove) = delete;
- SimpleStreamBuf& operator=(SimpleStreamBuf&&) = delete;
-
- virtual ~SimpleStreamBuf();
-
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSVector.h>
+#include <streambuf>
+
+namespace Aws
+{
+namespace Utils
+{
+namespace Stream
+{
+ /**
+ * A replacement for std::stringbuf when using Android and gnustl together
+ */
+ class AWS_CORE_API SimpleStreamBuf : public std::streambuf
+ {
+ public:
+
+ using base = std::streambuf;
+
+ SimpleStreamBuf();
+ explicit SimpleStreamBuf(const Aws::String& value);
+
+ SimpleStreamBuf(const SimpleStreamBuf&) = delete;
+ SimpleStreamBuf& operator=(const SimpleStreamBuf&) = delete;
+
+ SimpleStreamBuf(SimpleStreamBuf&& toMove) = delete;
+ SimpleStreamBuf& operator=(SimpleStreamBuf&&) = delete;
+
+ virtual ~SimpleStreamBuf();
+
Aws::String str() const;
- void str(const Aws::String& value);
-
- void swap(SimpleStreamBuf& rhs);
-
- protected:
- virtual std::streampos seekoff(std::streamoff off, std::ios_base::seekdir dir, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override;
- virtual std::streampos seekpos(std::streampos pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override;
-
- virtual int overflow (int c = EOF) override;
- virtual int underflow() override;
-
- virtual std::streamsize xsputn(const char* s, std::streamsize n) override;
-
- private:
-
- bool GrowBuffer();
-
- char* m_buffer;
- size_t m_bufferSize;
- };
-
-}
-}
-}
+ void str(const Aws::String& value);
+
+ void swap(SimpleStreamBuf& rhs);
+
+ protected:
+ virtual std::streampos seekoff(std::streamoff off, std::ios_base::seekdir dir, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override;
+ virtual std::streampos seekpos(std::streampos pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override;
+
+ virtual int overflow (int c = EOF) override;
+ virtual int underflow() override;
+
+ virtual std::streamsize xsputn(const char* s, std::streamsize n) override;
+
+ private:
+
+ bool GrowBuffer();
+
+ char* m_buffer;
+ size_t m_bufferSize;
+ };
+
+}
+}
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Executor.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Executor.h
index b3917ac43b..36975af513 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Executor.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Executor.h
@@ -2,118 +2,118 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/memory/stl/AWSQueue.h>
-#include <aws/core/utils/memory/stl/AWSVector.h>
-#include <aws/core/utils/memory/stl/AWSMap.h>
-#include <aws/core/utils/threading/Semaphore.h>
-#include <functional>
-#include <future>
-#include <mutex>
-#include <atomic>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Threading
- {
- class ThreadTask;
-
- /**
- * Interface for implementing an Executor, to implement a custom thread execution strategy, inherit from this class
- * and override SubmitToThread().
- */
- class AWS_CORE_API Executor
- {
- public:
- virtual ~Executor() = default;
-
- /**
- * Send function and its arguments to the SubmitToThread function.
- */
- template<class Fn, class ... Args>
- bool Submit(Fn&& fn, Args&& ... args)
- {
- std::function<void()> callable{ std::bind(std::forward<Fn>(fn), std::forward<Args>(args)...) };
- return SubmitToThread(std::move(callable));
- }
-
- protected:
- /**
- * To implement your own executor implementation, then simply subclass Executor and implement this method.
- */
- virtual bool SubmitToThread(std::function<void()>&&) = 0;
- };
-
-
- /**
- * Default Executor implementation. Simply spawns a thread and detaches it.
- */
- class AWS_CORE_API DefaultExecutor : public Executor
- {
- public:
- DefaultExecutor() : m_state(State::Free) {}
- ~DefaultExecutor();
- protected:
- enum class State
- {
- Free, Locked, Shutdown
- };
- bool SubmitToThread(std::function<void()>&&) override;
- void Detach(std::thread::id id);
- std::atomic<State> m_state;
- Aws::UnorderedMap<std::thread::id, std::thread> m_threads;
- };
-
- enum class OverflowPolicy
- {
- QUEUE_TASKS_EVENLY_ACCROSS_THREADS,
- REJECT_IMMEDIATELY
- };
-
- /**
- * Thread Pool Executor implementation.
- */
- class AWS_CORE_API PooledThreadExecutor : public Executor
- {
- public:
- PooledThreadExecutor(size_t poolSize, OverflowPolicy overflowPolicy = OverflowPolicy::QUEUE_TASKS_EVENLY_ACCROSS_THREADS);
- ~PooledThreadExecutor();
-
- /**
- * Rule of 5 stuff.
- * Don't copy or move
- */
- PooledThreadExecutor(const PooledThreadExecutor&) = delete;
- PooledThreadExecutor& operator =(const PooledThreadExecutor&) = delete;
- PooledThreadExecutor(PooledThreadExecutor&&) = delete;
- PooledThreadExecutor& operator =(PooledThreadExecutor&&) = delete;
-
- protected:
- bool SubmitToThread(std::function<void()>&&) override;
-
- private:
- Aws::Queue<std::function<void()>*> m_tasks;
- std::mutex m_queueLock;
- Aws::Utils::Threading::Semaphore m_sync;
- Aws::Vector<ThreadTask*> m_threadTaskHandles;
- size_t m_poolSize;
- OverflowPolicy m_overflowPolicy;
-
- /**
- * Once you call this, you are responsible for freeing the memory pointed to by task.
- */
- std::function<void()>* PopTask();
- bool HasTasks();
-
- friend class ThreadTask;
- };
-
-
- } // namespace Threading
- } // namespace Utils
-} // namespace Aws
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/memory/stl/AWSQueue.h>
+#include <aws/core/utils/memory/stl/AWSVector.h>
+#include <aws/core/utils/memory/stl/AWSMap.h>
+#include <aws/core/utils/threading/Semaphore.h>
+#include <functional>
+#include <future>
+#include <mutex>
+#include <atomic>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Threading
+ {
+ class ThreadTask;
+
+ /**
+ * Interface for implementing an Executor, to implement a custom thread execution strategy, inherit from this class
+ * and override SubmitToThread().
+ */
+ class AWS_CORE_API Executor
+ {
+ public:
+ virtual ~Executor() = default;
+
+ /**
+ * Send function and its arguments to the SubmitToThread function.
+ */
+ template<class Fn, class ... Args>
+ bool Submit(Fn&& fn, Args&& ... args)
+ {
+ std::function<void()> callable{ std::bind(std::forward<Fn>(fn), std::forward<Args>(args)...) };
+ return SubmitToThread(std::move(callable));
+ }
+
+ protected:
+ /**
+ * To implement your own executor implementation, then simply subclass Executor and implement this method.
+ */
+ virtual bool SubmitToThread(std::function<void()>&&) = 0;
+ };
+
+
+ /**
+ * Default Executor implementation. Simply spawns a thread and detaches it.
+ */
+ class AWS_CORE_API DefaultExecutor : public Executor
+ {
+ public:
+ DefaultExecutor() : m_state(State::Free) {}
+ ~DefaultExecutor();
+ protected:
+ enum class State
+ {
+ Free, Locked, Shutdown
+ };
+ bool SubmitToThread(std::function<void()>&&) override;
+ void Detach(std::thread::id id);
+ std::atomic<State> m_state;
+ Aws::UnorderedMap<std::thread::id, std::thread> m_threads;
+ };
+
+ enum class OverflowPolicy
+ {
+ QUEUE_TASKS_EVENLY_ACCROSS_THREADS,
+ REJECT_IMMEDIATELY
+ };
+
+ /**
+ * Thread Pool Executor implementation.
+ */
+ class AWS_CORE_API PooledThreadExecutor : public Executor
+ {
+ public:
+ PooledThreadExecutor(size_t poolSize, OverflowPolicy overflowPolicy = OverflowPolicy::QUEUE_TASKS_EVENLY_ACCROSS_THREADS);
+ ~PooledThreadExecutor();
+
+ /**
+ * Rule of 5 stuff.
+ * Don't copy or move
+ */
+ PooledThreadExecutor(const PooledThreadExecutor&) = delete;
+ PooledThreadExecutor& operator =(const PooledThreadExecutor&) = delete;
+ PooledThreadExecutor(PooledThreadExecutor&&) = delete;
+ PooledThreadExecutor& operator =(PooledThreadExecutor&&) = delete;
+
+ protected:
+ bool SubmitToThread(std::function<void()>&&) override;
+
+ private:
+ Aws::Queue<std::function<void()>*> m_tasks;
+ std::mutex m_queueLock;
+ Aws::Utils::Threading::Semaphore m_sync;
+ Aws::Vector<ThreadTask*> m_threadTaskHandles;
+ size_t m_poolSize;
+ OverflowPolicy m_overflowPolicy;
+
+ /**
+ * Once you call this, you are responsible for freeing the memory pointed to by task.
+ */
+ std::function<void()>* PopTask();
+ bool HasTasks();
+
+ friend class ThreadTask;
+ };
+
+
+ } // namespace Threading
+ } // namespace Utils
+} // namespace Aws
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ReaderWriterLock.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ReaderWriterLock.h
index f736918960..5d757dcecb 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ReaderWriterLock.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ReaderWriterLock.h
@@ -2,115 +2,115 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <aws/core/utils/threading/Semaphore.h>
-#include <mutex>
-#include <atomic>
-#include <condition_variable>
-#include <cstdint>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Threading
- {
- /**
- * This lock is optimized for frequent reads and infrequent writes.
- * However, writers get priority to the lock.
- */
- class AWS_CORE_API ReaderWriterLock
- {
- public:
- ReaderWriterLock();
- /**
- * Enters the lock in Reader-mode.
- * This call blocks until no writers are acquiring the lock.
- */
- void LockReader();
-
- /**
- * Decrements the readers count by one and if the count is zero, signals any waiting writers to acquire
- * the lock.
- * NOTE: Calling this function without a matching LockReader results in undefined behavior.
- */
- void UnlockReader();
-
- /**
- * Enters the lock in Writer-mode.
- * This call blocks until no readers nor writers are acquiring the lock.
- */
- void LockWriter();
-
- /**
- * Decrements the number of writers by one and signals any waiting readers or writers to acquire the
- * lock.
- * NOTE: Calling this function without a matching LockWriter results in undefined behavior.
- */
- void UnlockWriter();
- private:
- std::atomic<int64_t> m_readers;
- std::atomic<int64_t> m_holdouts;
- Semaphore m_readerSem;
- Semaphore m_writerSem;
- std::mutex m_writerLock;
- };
-
- class AWS_CORE_API ReaderLockGuard
- {
- public:
- explicit ReaderLockGuard(ReaderWriterLock& rwl) : m_rwlock(rwl), m_upgraded(false)
- {
- m_rwlock.LockReader();
- }
-
- void UpgradeToWriterLock()
- {
- m_rwlock.UnlockReader();
- m_rwlock.LockWriter();
- m_upgraded = true;
- }
-
- ~ReaderLockGuard()
- {
- if(m_upgraded)
- {
- m_rwlock.UnlockWriter();
- }
- else
- {
- m_rwlock.UnlockReader();
- }
- }
- // for VS2013
- ReaderLockGuard(const ReaderLockGuard&) = delete;
- ReaderLockGuard& operator=(const ReaderLockGuard&) = delete;
- private:
- ReaderWriterLock& m_rwlock;
- bool m_upgraded;
- };
-
- class AWS_CORE_API WriterLockGuard
- {
- public:
- explicit WriterLockGuard(ReaderWriterLock& rwl) : m_rwlock(rwl)
- {
- m_rwlock.LockWriter();
- }
-
- ~WriterLockGuard()
- {
- m_rwlock.UnlockWriter();
- }
- // for VS2013
- WriterLockGuard(const WriterLockGuard&) = delete;
- WriterLockGuard& operator=(const WriterLockGuard&) = delete;
- private:
- ReaderWriterLock& m_rwlock;
- };
- }
- }
-}
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <aws/core/utils/threading/Semaphore.h>
+#include <mutex>
+#include <atomic>
+#include <condition_variable>
+#include <cstdint>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Threading
+ {
+ /**
+ * This lock is optimized for frequent reads and infrequent writes.
+ * However, writers get priority to the lock.
+ */
+ class AWS_CORE_API ReaderWriterLock
+ {
+ public:
+ ReaderWriterLock();
+ /**
+ * Enters the lock in Reader-mode.
+ * This call blocks until no writers are acquiring the lock.
+ */
+ void LockReader();
+
+ /**
+ * Decrements the readers count by one and if the count is zero, signals any waiting writers to acquire
+ * the lock.
+ * NOTE: Calling this function without a matching LockReader results in undefined behavior.
+ */
+ void UnlockReader();
+
+ /**
+ * Enters the lock in Writer-mode.
+ * This call blocks until no readers nor writers are acquiring the lock.
+ */
+ void LockWriter();
+
+ /**
+ * Decrements the number of writers by one and signals any waiting readers or writers to acquire the
+ * lock.
+ * NOTE: Calling this function without a matching LockWriter results in undefined behavior.
+ */
+ void UnlockWriter();
+ private:
+ std::atomic<int64_t> m_readers;
+ std::atomic<int64_t> m_holdouts;
+ Semaphore m_readerSem;
+ Semaphore m_writerSem;
+ std::mutex m_writerLock;
+ };
+
+ class AWS_CORE_API ReaderLockGuard
+ {
+ public:
+ explicit ReaderLockGuard(ReaderWriterLock& rwl) : m_rwlock(rwl), m_upgraded(false)
+ {
+ m_rwlock.LockReader();
+ }
+
+ void UpgradeToWriterLock()
+ {
+ m_rwlock.UnlockReader();
+ m_rwlock.LockWriter();
+ m_upgraded = true;
+ }
+
+ ~ReaderLockGuard()
+ {
+ if(m_upgraded)
+ {
+ m_rwlock.UnlockWriter();
+ }
+ else
+ {
+ m_rwlock.UnlockReader();
+ }
+ }
+ // for VS2013
+ ReaderLockGuard(const ReaderLockGuard&) = delete;
+ ReaderLockGuard& operator=(const ReaderLockGuard&) = delete;
+ private:
+ ReaderWriterLock& m_rwlock;
+ bool m_upgraded;
+ };
+
+ class AWS_CORE_API WriterLockGuard
+ {
+ public:
+ explicit WriterLockGuard(ReaderWriterLock& rwl) : m_rwlock(rwl)
+ {
+ m_rwlock.LockWriter();
+ }
+
+ ~WriterLockGuard()
+ {
+ m_rwlock.UnlockWriter();
+ }
+ // for VS2013
+ WriterLockGuard(const WriterLockGuard&) = delete;
+ WriterLockGuard& operator=(const WriterLockGuard&) = delete;
+ private:
+ ReaderWriterLock& m_rwlock;
+ };
+ }
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Semaphore.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Semaphore.h
index 4f83a2f6ea..bad50532dd 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Semaphore.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/Semaphore.h
@@ -1,45 +1,45 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
- */
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <mutex>
-#include <condition_variable>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Threading
- {
- class AWS_CORE_API Semaphore {
- public:
- /**
- * Initializes a new instance of Semaphore class specifying the initial number of entries and
- * the maximum number of concurrent entries.
- */
- Semaphore(size_t initialCount, size_t maxCount);
- /**
- * Blocks the current thread until it receives a signal.
- */
- void WaitOne();
- /**
- * Exits the semaphore once.
- */
- void Release();
- /**
- * Exit the semaphore up to the maximum number of entries available.
- */
- void ReleaseAll();
- private:
- size_t m_count;
- const size_t m_maxCount;
- std::mutex m_mutex;
- std::condition_variable m_syncPoint;
- };
- }
- }
-}
+ */
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <mutex>
+#include <condition_variable>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Threading
+ {
+ class AWS_CORE_API Semaphore {
+ public:
+ /**
+ * Initializes a new instance of Semaphore class specifying the initial number of entries and
+ * the maximum number of concurrent entries.
+ */
+ Semaphore(size_t initialCount, size_t maxCount);
+ /**
+ * Blocks the current thread until it receives a signal.
+ */
+ void WaitOne();
+ /**
+ * Exits the semaphore once.
+ */
+ void Release();
+ /**
+ * Exit the semaphore up to the maximum number of entries available.
+ */
+ void ReleaseAll();
+ private:
+ size_t m_count;
+ const size_t m_maxCount;
+ std::mutex m_mutex;
+ std::condition_variable m_syncPoint;
+ };
+ }
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ThreadTask.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ThreadTask.h
index a8060ad852..79326b3a15 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ThreadTask.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/threading/ThreadTask.h
@@ -2,47 +2,47 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-#include <functional>
-#include <thread>
-#include <atomic>
-
-namespace Aws
-{
- namespace Utils
- {
- namespace Threading
- {
- class PooledThreadExecutor;
-
- class AWS_CORE_API ThreadTask
- {
- public:
- ThreadTask(PooledThreadExecutor& executor);
- ~ThreadTask();
-
- /**
- * Rule of 5 stuff.
- * Don't copy or move
- */
- ThreadTask(const ThreadTask&) = delete;
- ThreadTask& operator =(const ThreadTask&) = delete;
- ThreadTask(ThreadTask&&) = delete;
- ThreadTask& operator =(ThreadTask&&) = delete;
-
- void StopProcessingWork();
-
- protected:
- void MainTaskRunner();
-
- private:
- std::atomic<bool> m_continue;
- PooledThreadExecutor& m_executor;
- std::thread m_thread;
- };
- }
- }
-}
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+#include <functional>
+#include <thread>
+#include <atomic>
+
+namespace Aws
+{
+ namespace Utils
+ {
+ namespace Threading
+ {
+ class PooledThreadExecutor;
+
+ class AWS_CORE_API ThreadTask
+ {
+ public:
+ ThreadTask(PooledThreadExecutor& executor);
+ ~ThreadTask();
+
+ /**
+ * Rule of 5 stuff.
+ * Don't copy or move
+ */
+ ThreadTask(const ThreadTask&) = delete;
+ ThreadTask& operator =(const ThreadTask&) = delete;
+ ThreadTask(ThreadTask&&) = delete;
+ ThreadTask& operator =(ThreadTask&&) = delete;
+
+ void StopProcessingWork();
+
+ protected:
+ void MainTaskRunner();
+
+ private:
+ std::atomic<bool> m_continue;
+ PooledThreadExecutor& m_executor;
+ std::thread m_thread;
+ };
+ }
+ }
+}
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/xml/XmlSerializer.h b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/xml/XmlSerializer.h
index 0e910c90ab..d1ca79ffab 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/xml/XmlSerializer.h
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/utils/xml/XmlSerializer.h
@@ -2,217 +2,217 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
-
-#pragma once
-
-#include <aws/core/Core_EXPORTS.h>
-
-#include <aws/core/utils/Outcome.h>
-#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
-#include <aws/core/utils/memory/stl/AWSString.h>
-
-namespace Aws
-{
- namespace External
- {
- namespace tinyxml2
- {
- class XMLNode;
-
- class XMLDocument;
- } // namespace tinyxml2
- } // namespace External
-} // namespace Aws
-
-namespace Aws
-{
- template<typename PAYLOAD_TYPE>
- class AmazonWebServiceResult;
- namespace Client
- {
- enum class CoreErrors;
- template<typename ERROR_TYPE>
- class AWSError;
- class AWSXMLClient;
- } // namespace Client
- namespace Utils
- {
- namespace Xml
- {
- /**
- * Converts escaped xml text back to the original characters (e.g. < ! > = etc...)
- */
- AWS_CORE_API Aws::String DecodeEscapedXmlText(const Aws::String& textToDecode);
-
- class XmlDocument;
-
- /**
- * Node in an Xml Document
- */
- class AWS_CORE_API XmlNode
- {
- public:
- /**
- * copies node and document over.
- */
- XmlNode(const XmlNode& other);
- /**
- * copies node and document over.
- */
- XmlNode& operator=(const XmlNode& other);
- /**
- * Get the name of the node.
- */
- const Aws::String GetName() const;
- /**
- * Set the name of the node.
- */
- void SetName(const Aws::String& name);
- /**
- * Get Value of an attribute specified by name.
- */
- const Aws::String GetAttributeValue(const Aws::String& name) const;
- /**
- * Set an attribute at name to value
- */
- void SetAttributeValue(const Aws::String& name, const Aws::String& value);
- /**
- * Get the inner text of the node (potentially includes other nodes)
- */
- Aws::String GetText() const;
- /**
- * Set the inner text of the node
- */
- void SetText(const Aws::String& textValue);
- /**
- * returns true if this node has another sibling.
- */
- bool HasNextNode() const;
- /**
- * returns the next sibling.
- */
- XmlNode NextNode() const;
- /**
- * returns the next sibling that matches node name.
- */
- XmlNode NextNode(const char* name) const;
- /**
- * returns the next sibling that matches node name.
- */
- XmlNode NextNode(const Aws::String& name) const;
- /**
- * return the first child node of this node.
- */
- XmlNode FirstChild() const;
- /**
- * returns the first child node of this node that has name.
- */
- XmlNode FirstChild(const char* name) const;
- /**
- * returns the first child node of this node that has name.
- */
- XmlNode FirstChild(const Aws::String& name) const;
- /**
- * returns true if this node has child nodes.
- */
- bool HasChildren() const;
- /**
- * returns the parent of this node.
- */
- XmlNode Parent() const;
- /**
- * Creates a new child element to this with name
- */
- XmlNode CreateChildElement(const Aws::String& name);
- /**
- * Creates a new child element to this with name
- */
- XmlNode CreateSiblingElement(const Aws::String& name);
- /**
- * If current node is valid.
- */
- bool IsNull();
-
- private:
- XmlNode(Aws::External::tinyxml2::XMLNode* node, const XmlDocument& document) :
- m_node(node), m_doc(&document)
- {
- }
-
- //we do not own these.... I just had to change it from ref because the compiler was
- //confused about which assignment operator to call. Do not... I repeat... do not delete
- //these pointers in your destructor.
- Aws::External::tinyxml2::XMLNode* m_node;
- const XmlDocument* m_doc;
-
- friend class XmlDocument;
- };
-
- /**
- * Container for Xml Document as a whole. All nodes have a reference to their parent document. Any changes
+
+#pragma once
+
+#include <aws/core/Core_EXPORTS.h>
+
+#include <aws/core/utils/Outcome.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+
+namespace Aws
+{
+ namespace External
+ {
+ namespace tinyxml2
+ {
+ class XMLNode;
+
+ class XMLDocument;
+ } // namespace tinyxml2
+ } // namespace External
+} // namespace Aws
+
+namespace Aws
+{
+ template<typename PAYLOAD_TYPE>
+ class AmazonWebServiceResult;
+ namespace Client
+ {
+ enum class CoreErrors;
+ template<typename ERROR_TYPE>
+ class AWSError;
+ class AWSXMLClient;
+ } // namespace Client
+ namespace Utils
+ {
+ namespace Xml
+ {
+ /**
+ * Converts escaped xml text back to the original characters (e.g. < ! > = etc...)
+ */
+ AWS_CORE_API Aws::String DecodeEscapedXmlText(const Aws::String& textToDecode);
+
+ class XmlDocument;
+
+ /**
+ * Node in an Xml Document
+ */
+ class AWS_CORE_API XmlNode
+ {
+ public:
+ /**
+ * copies node and document over.
+ */
+ XmlNode(const XmlNode& other);
+ /**
+ * copies node and document over.
+ */
+ XmlNode& operator=(const XmlNode& other);
+ /**
+ * Get the name of the node.
+ */
+ const Aws::String GetName() const;
+ /**
+ * Set the name of the node.
+ */
+ void SetName(const Aws::String& name);
+ /**
+ * Get Value of an attribute specified by name.
+ */
+ const Aws::String GetAttributeValue(const Aws::String& name) const;
+ /**
+ * Set an attribute at name to value
+ */
+ void SetAttributeValue(const Aws::String& name, const Aws::String& value);
+ /**
+ * Get the inner text of the node (potentially includes other nodes)
+ */
+ Aws::String GetText() const;
+ /**
+ * Set the inner text of the node
+ */
+ void SetText(const Aws::String& textValue);
+ /**
+ * returns true if this node has another sibling.
+ */
+ bool HasNextNode() const;
+ /**
+ * returns the next sibling.
+ */
+ XmlNode NextNode() const;
+ /**
+ * returns the next sibling that matches node name.
+ */
+ XmlNode NextNode(const char* name) const;
+ /**
+ * returns the next sibling that matches node name.
+ */
+ XmlNode NextNode(const Aws::String& name) const;
+ /**
+ * return the first child node of this node.
+ */
+ XmlNode FirstChild() const;
+ /**
+ * returns the first child node of this node that has name.
+ */
+ XmlNode FirstChild(const char* name) const;
+ /**
+ * returns the first child node of this node that has name.
+ */
+ XmlNode FirstChild(const Aws::String& name) const;
+ /**
+ * returns true if this node has child nodes.
+ */
+ bool HasChildren() const;
+ /**
+ * returns the parent of this node.
+ */
+ XmlNode Parent() const;
+ /**
+ * Creates a new child element to this with name
+ */
+ XmlNode CreateChildElement(const Aws::String& name);
+ /**
+ * Creates a new child element to this with name
+ */
+ XmlNode CreateSiblingElement(const Aws::String& name);
+ /**
+ * If current node is valid.
+ */
+ bool IsNull();
+
+ private:
+ XmlNode(Aws::External::tinyxml2::XMLNode* node, const XmlDocument& document) :
+ m_node(node), m_doc(&document)
+ {
+ }
+
+ //we do not own these.... I just had to change it from ref because the compiler was
+ //confused about which assignment operator to call. Do not... I repeat... do not delete
+ //these pointers in your destructor.
+ Aws::External::tinyxml2::XMLNode* m_node;
+ const XmlDocument* m_doc;
+
+ friend class XmlDocument;
+ };
+
+ /**
+ * Container for Xml Document as a whole. All nodes have a reference to their parent document. Any changes
* you make to the nodes will be reflected here.
- */
- class AWS_CORE_API XmlDocument
- {
- public:
- /**
- * move document memory
- */
+ */
+ class AWS_CORE_API XmlDocument
+ {
+ public:
+ /**
+ * move document memory
+ */
XmlDocument(const XmlDocument& other);
XmlDocument(XmlDocument&& doc);
-
+
XmlDocument& operator=(const XmlDocument& other);
XmlDocument& operator=(XmlDocument&& other);
- ~XmlDocument();
-
- /**
- * Get root element of the document
- */
- XmlNode GetRootElement() const;
- /**
- * Convert entire document to string. Use this if you for example, want to save the document to a file.
- */
- Aws::String ConvertToString() const;
- /**
- * Returns true if the call to CreateFromXml* was successful, otherwise false.
- * if this returns false, you can call GetErrorMessage() to see details.
- */
- bool WasParseSuccessful() const;
- /**
+ ~XmlDocument();
+
+ /**
+ * Get root element of the document
+ */
+ XmlNode GetRootElement() const;
+ /**
+ * Convert entire document to string. Use this if you for example, want to save the document to a file.
+ */
+ Aws::String ConvertToString() const;
+ /**
+ * Returns true if the call to CreateFromXml* was successful, otherwise false.
+ * if this returns false, you can call GetErrorMessage() to see details.
+ */
+ bool WasParseSuccessful() const;
+ /**
* Returns the error message if the call to CreateFromXml* failed.
- */
- Aws::String GetErrorMessage() const;
- /**
- * Parses the stream into an XMLDocument
- */
- static XmlDocument CreateFromXmlStream(Aws::IOStream&);
- /**
- * Parses the string into an XMLDocument
- */
- static XmlDocument CreateFromXmlString(const Aws::String&);
- /**
- * Creates an empty document with root node name
- */
- static XmlDocument CreateWithRootNode(const Aws::String&);
-
- private:
- XmlDocument();
+ */
+ Aws::String GetErrorMessage() const;
+ /**
+ * Parses the stream into an XMLDocument
+ */
+ static XmlDocument CreateFromXmlStream(Aws::IOStream&);
+ /**
+ * Parses the string into an XMLDocument
+ */
+ static XmlDocument CreateFromXmlString(const Aws::String&);
+ /**
+ * Creates an empty document with root node name
+ */
+ static XmlDocument CreateWithRootNode(const Aws::String&);
+
+ private:
+ XmlDocument();
void InitDoc();
-
- Aws::External::tinyxml2::XMLDocument* m_doc;
-
- friend class XmlNode;
-
- //allow outcome call the default constructor to handle it's error case.
- friend class Aws::Utils::Outcome<Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>, Aws::Client::AWSError<Aws::Client::CoreErrors>>;
- friend class Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>;
+
+ Aws::External::tinyxml2::XMLDocument* m_doc;
+
+ friend class XmlNode;
+
+ //allow outcome call the default constructor to handle it's error case.
+ friend class Aws::Utils::Outcome<Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>, Aws::Client::AWSError<Aws::Client::CoreErrors>>;
+ friend class Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>;
template<typename T>
friend class Client::AWSError;
- friend class Client::AWSXMLClient;
- };
-
- } // namespace Xml
- } // namespace Utils
-} // namespace Aws
-
+ friend class Client::AWSXMLClient;
+ };
+
+ } // namespace Xml
+ } // namespace Utils
+} // namespace Aws
+