Sha256: 4e99367cffa310d3a4e7e297e1c99e825465588fbd847dce9fc445e1da0cd8e4

Contents?: true

Size: 922 Bytes

Versions: 34

Compression:

Stored size: 922 Bytes

Contents

// Copyright (c) 2018-2020 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 "../external/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( VaLue ) TAO_JSON_PEGTL_INTERNAL_STRING( tao::json::internal::string_t, VaLue )

#endif

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
couchbase-3.2.0-universal-darwin-20 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.2.0 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.1.1 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.1.1-universal-darwin-20 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.1.0 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.3 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.3-universal-darwin-20 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.2 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.1-universal-darwin-19 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.1 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.0-universal-darwin-19 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.0 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.0.beta.1-universal-darwin-19 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.0.beta.1 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.0.alpha.5-x86_64-linux ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.0.alpha.5-universal-darwin-19 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.0.alpha.5-x86_64-darwin-19 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.0.alpha.5 ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.0.alpha.4-x86_64-linux ext/third_party/json/include/tao/json/internal/string_t.hpp
couchbase-3.0.0.alpha.4-x86_64-darwin-19 ext/third_party/json/include/tao/json/internal/string_t.hpp