Sha256: be81e74fa2cf1182c3befd688f24388375f18b0b617d5770903bca6ec5e4c8e1

Contents?: true

Size: 901 Bytes

Versions: 7

Compression:

Stored size: 901 Bytes

Contents

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

#ifndef TAO_JSON_INTERNAL_STRING_T_HPP
#define TAO_JSON_INTERNAL_STRING_T_HPP

#include <string>
#include <string_view>

#include <tao/pegtl/internal/pegtl_string.hpp>

namespace tao::json::internal
{
   template< char... Cs >
   struct string_t
      : pegtl::string< Cs... >
   {
      static constexpr const char value[] = { Cs..., 0 };

      [[nodiscard]] static constexpr std::string_view as_string_view() noexcept
      {
         return std::string_view( value, sizeof...( Cs ) );
      }

      [[nodiscard]] static std::string as_string()
      {
         return std::string( value, sizeof...( Cs ) );
      }
   };

}  // namespace tao::json::internal

#define TAO_JSON_STRING_T( x ) TAO_PEGTL_INTERNAL_STRING( tao::json::internal::string_t, x )

#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/internal/string_t.hpp
couchbase-3.4.4 ext/couchbase/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.4.3 ext/couchbase/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.4.2 ext/couchbase/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.4.1 ext/couchbase/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.4.0 ext/couchbase/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.3.0 ext/couchbase/third_party/json/include/tao/json/internal/string_t.hpp