Sha256: 3f6c05787fb2f25742d2aff17cc2205a6bd630dfe0be0ba4825def9f1275b076

Contents?: true

Size: 1.52 KB

Versions: 7

Compression:

Stored size: 1.52 KB

Contents

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

#ifndef TAO_JSON_JAXN_EVENTS_FROM_STRING_HPP
#define TAO_JSON_JAXN_EVENTS_FROM_STRING_HPP

#include <string>
#include <string_view>

#include <tao/pegtl/memory_input.hpp>

#include "from_input.hpp"

namespace tao::json::jaxn::events
{
   // Events producer to parse a JAXN 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::jaxn::events::from_string", byte, line, column );
      jaxn::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 )
   {
      jaxn::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 )
   {
      jaxn::events::from_string( consumer, data.data(), data.size(), std::forward< Ts >( ts )... );
   }

}  // namespace tao::json::jaxn::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/jaxn/events/from_string.hpp
couchbase-3.4.4 ext/couchbase/third_party/json/include/tao/json/jaxn/events/from_string.hpp
couchbase-3.4.3 ext/couchbase/third_party/json/include/tao/json/jaxn/events/from_string.hpp
couchbase-3.4.2 ext/couchbase/third_party/json/include/tao/json/jaxn/events/from_string.hpp
couchbase-3.4.1 ext/couchbase/third_party/json/include/tao/json/jaxn/events/from_string.hpp
couchbase-3.4.0 ext/couchbase/third_party/json/include/tao/json/jaxn/events/from_string.hpp
couchbase-3.3.0 ext/couchbase/third_party/json/include/tao/json/jaxn/events/from_string.hpp