Sha256: 5bca2581cac9b3cd80c1799f3859e48069e642c30b28a53d942bc926d3f3149b

Contents?: true

Size: 1.78 KB

Versions: 10

Compression:

Stored size: 1.78 KB

Contents

// Copyright (c) 2020 Dr. Colin Hirsch and Daniel Frey
// Please see LICENSE for license or visit https://github.com/taocpp/json/

#ifndef TAO_JSON_CBOR_EVENTS_FROM_BINARY_HPP
#define TAO_JSON_CBOR_EVENTS_FROM_BINARY_HPP

#include "../../binary.hpp"
#include "../../binary_view.hpp"
#include "../../external/pegtl/memory_input.hpp"

#include "from_input.hpp"

namespace tao::json::cbor::events
{
   template< typename Consumer >
   void from_binary( Consumer& consumer, const void* data, const std::size_t size, const char* source = nullptr, const std::size_t byte = 0, const std::size_t line = 1, const std::size_t column = 1 )
   {
      const char* cast = static_cast< const char* >( data );
      pegtl::memory_input< pegtl::tracking_mode::lazy, pegtl::eol::lf_crlf, const char* > in( cast, cast + size, source ? source : "tao::json::cbor::events::from_binary", byte, line, column );
      cbor::events::from_input( consumer, std::move( in ) );
   }

   template< typename Consumer >
   void from_binary( Consumer& consumer, const void* data, const std::size_t size, const std::string& source, const std::size_t byte = 0, const std::size_t line = 1, const std::size_t column = 1 )
   {
      cbor::events::from_binary( consumer, data, size, source.c_str(), byte, line, column );
   }

   template< typename Consumer, typename... Ts >
   void from_binary( Consumer& consumer, const tao::binary& data, Ts&&... ts )
   {
      cbor::events::from_binary( consumer, data.data(), data.size(), std::forward< Ts >( ts )... );
   }

   template< typename Consumer, typename... Ts >
   void from_binary( Consumer& consumer, const tao::binary_view data, Ts&&... ts )
   {
      cbor::events::from_binary( consumer, data.data(), data.size(), std::forward< Ts >( ts )... );
   }

}  // namespace tao::json::cbor::events

#endif

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
couchbase-3.2.0-universal-darwin-20 ext/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.2.0 ext/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.1.1 ext/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.1.1-universal-darwin-20 ext/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.1.0 ext/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.0.3 ext/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.0.3-universal-darwin-20 ext/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.0.2 ext/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.0.1-universal-darwin-19 ext/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.0.1 ext/third_party/json/include/tao/json/cbor/events/from_binary.hpp