Sha256: 2f6cc6f064831c8e1abf5e9ab16a847d0cc9d437eeb5c6587f6ac9f52b89c367
Contents?: true
Size: 1.79 KB
Versions: 7
Compression:
Stored size: 1.79 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_UBJSON_EVENTS_FROM_BINARY_HPP #define TAO_JSON_UBJSON_EVENTS_FROM_BINARY_HPP #include <tao/pegtl/memory_input.hpp> #include "../../binary.hpp" #include "../../binary_view.hpp" #include "from_input.hpp" namespace tao::json::ubjson::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::ubjson::events::from_binary", byte, line, column ); ubjson::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 ) { ubjson::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 ) { ubjson::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 ) { ubjson::events::from_binary( consumer, data.data(), data.size(), std::forward< Ts >( ts )... ); } } // namespace tao::json::ubjson::events #endif
Version data entries
7 entries across 7 versions & 1 rubygems