Sha256: ef2629b28c7b4b90d1b994f7b526d52a7ce8d9acdf395f6ee2fb090a77979953

Contents?: true

Size: 1.47 KB

Versions: 10

Compression:

Stored size: 1.47 KB

Contents

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

#ifndef TAO_JSON_EVENTS_FROM_STRING_HPP
#define TAO_JSON_EVENTS_FROM_STRING_HPP

#include <string_view>

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

#include "from_input.hpp"

namespace tao::json::events
{
   // Events producer to parse a JSON string representation.

   template< typename Consumer >
   void from_string( Consumer& consumer, const char* 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 )
   {
      pegtl::memory_input< pegtl::tracking_mode::lazy, pegtl::eol::lf_crlf, const char* > in( data, data + size, source ? source : "tao::json::events::from_string", byte, line, column );
      json::events::from_input( consumer, std::move( in ) );
   }

   template< typename Consumer >
   void from_string( Consumer& consumer, const char* 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 )
   {
      events::from_string( consumer, data, size, source.c_str(), byte, line, column );
   }

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

}  // namespace tao::json::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/events/from_string.hpp
couchbase-3.2.0 ext/third_party/json/include/tao/json/events/from_string.hpp
couchbase-3.1.1 ext/third_party/json/include/tao/json/events/from_string.hpp
couchbase-3.1.1-universal-darwin-20 ext/third_party/json/include/tao/json/events/from_string.hpp
couchbase-3.1.0 ext/third_party/json/include/tao/json/events/from_string.hpp
couchbase-3.0.3 ext/third_party/json/include/tao/json/events/from_string.hpp
couchbase-3.0.3-universal-darwin-20 ext/third_party/json/include/tao/json/events/from_string.hpp
couchbase-3.0.2 ext/third_party/json/include/tao/json/events/from_string.hpp
couchbase-3.0.1-universal-darwin-19 ext/third_party/json/include/tao/json/events/from_string.hpp
couchbase-3.0.1 ext/third_party/json/include/tao/json/events/from_string.hpp