Sha256: f4738f14aa516bd0a92cba650ab5dc0ee263de2156f829a5facae0249b58f625

Contents?: true

Size: 840 Bytes

Versions: 7

Compression:

Stored size: 840 Bytes

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_INTERNAL_HEXDUMP_HPP
#define TAO_JSON_INTERNAL_HEXDUMP_HPP

#include <sstream>
#include <string>
#include <utility>

namespace tao::json::internal
{
   template< typename T >
   void hexdump( std::ostream& os, const T& v )
   {
      static const char h[] = "0123456789ABCDEF";
      for( const auto b : v ) {
         os.put( h[ static_cast< unsigned char >( b ) >> 4 ] );
         os.put( h[ static_cast< unsigned char >( b ) & 0xF ] );
      }
   }

   template< typename T >
   [[nodiscard]] std::string hexdump( const T& v )
   {
      std::ostringstream oss;
      internal::hexdump( oss, v );
      return std::move( oss ).str();
   }

}  // namespace tao::json::internal

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