From 6c9af55baea32e569514f83ae4e9932100aa04e4 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Tue, 23 Jul 2024 06:19:55 +0200 Subject: [PATCH] Fix libcxx15 build (#5765) --- .../src/private/avro_parser.hpp | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/sdk/storage/azure-storage-blobs/src/private/avro_parser.hpp b/sdk/storage/azure-storage-blobs/src/private/avro_parser.hpp index 58bc5b2bb..275d073c8 100644 --- a/sdk/storage/azure-storage-blobs/src/private/avro_parser.hpp +++ b/sdk/storage/azure-storage-blobs/src/private/avro_parser.hpp @@ -106,30 +106,6 @@ namespace Azure { namespace Storage { namespace Blobs { namespace _detail { std::shared_ptr m_status; }; - class AvroDatum; - - class AvroRecord final { - public: - bool HasField(const std::string& key) const { return FindField(key) != m_keys->size(); } - const AvroDatum& Field(const std::string& key) const { return m_values.at(FindField(key)); } - AvroDatum& Field(const std::string& key) { return m_values.at(FindField(key)); } - const AvroDatum& FieldAt(size_t i) const { return m_values.at(i); } - AvroDatum& FieldAt(size_t i) { return m_values.at(i); } - - private: - size_t FindField(const std::string& key) const - { - auto i = find(m_keys->begin(), m_keys->end(), key); - return i - m_keys->begin(); - } - const std::vector* m_keys = nullptr; - std::vector m_values; - - friend class AvroDatum; - }; - - using AvroMap = std::map; - class AvroDatum final { public: AvroDatum() : m_schema(AvroSchema::NullSchema) {} @@ -152,6 +128,28 @@ namespace Azure { namespace Storage { namespace Blobs { namespace _detail { AvroStreamReader::ReaderPos m_data; }; + using AvroMap = std::map; + + class AvroRecord final { + public: + bool HasField(const std::string& key) const { return FindField(key) != m_keys->size(); } + const AvroDatum& Field(const std::string& key) const { return m_values.at(FindField(key)); } + AvroDatum& Field(const std::string& key) { return m_values.at(FindField(key)); } + const AvroDatum& FieldAt(size_t i) const { return m_values.at(i); } + AvroDatum& FieldAt(size_t i) { return m_values.at(i); } + + private: + size_t FindField(const std::string& key) const + { + auto i = find(m_keys->begin(), m_keys->end(), key); + return i - m_keys->begin(); + } + const std::vector* m_keys = nullptr; + std::vector m_values; + + friend class AvroDatum; + }; + class AvroObjectContainerReader final { public: explicit AvroObjectContainerReader(Core::IO::BodyStream& stream);