Sha256: 197384baa5651c390d9c3e3f92de71f105b00529908c47889aa7fab7c1ac2192

Contents?: true

Size: 1.77 KB

Versions: 7

Compression:

Stored size: 1.77 KB

Contents

// Copyright (c) 2020-2022 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 <tao/pegtl/memory_input.hpp>

#include "../../binary.hpp"
#include "../../binary_view.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

7 entries across 7 versions & 1 rubygems

Version Path
couchbase-3.4.5 ext/couchbase/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.4.4 ext/couchbase/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.4.3 ext/couchbase/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.4.2 ext/couchbase/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.4.1 ext/couchbase/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.4.0 ext/couchbase/third_party/json/include/tao/json/cbor/events/from_binary.hpp
couchbase-3.3.0 ext/couchbase/third_party/json/include/tao/json/cbor/events/from_binary.hpp