15 #ifndef SHAKA_EMBEDDED_MAPPING_BYTE_BUFFER_H_ 16 #define SHAKA_EMBEDDED_MAPPING_BYTE_BUFFER_H_ 35 static std::string
name() {
50 const uint8_t*
data()
const {
77 bool TryConvert(Handle<JsValue> value)
override;
78 ReturnVal<JsValue>
ToJsValue()
const override;
94 void ClearAndAllocateBuffer(
size_t size);
100 uint8_t* ptr_ =
nullptr;
105 mutable bool own_ptr_ =
false;
113 return !(lhs == rhs);
124 uint64_t ret = 0xacbdcfd0e1f20304;
126 const uint8_t* ptr = buffer.
data();
127 for (
size_t count = buffer.
size(); count > 0; ptr++, count--) {
130 ret = (ret << 8) | (ret >> 56);
137 return static_cast<size_t>(ret);
143 #endif // SHAKA_EMBEDDED_MAPPING_BYTE_BUFFER_H_ void SetFromDynamicBuffer(const util::DynamicBuffer &other)
ReturnVal< JsValue > ToJsValue() const override
const uint8_t * data() const
bool operator==(const optional< A > &lhs, const optional< B > &rhs)
bool operator!=(const optional< A > &lhs, const optional< B > &rhs)
ByteBuffer & operator=(const ByteBuffer &other)=delete
void SetFromBuffer(const void *buffer, size_t size)
static std::string name()
void Trace(memory::HeapTracer *tracer) const override
size_t operator()(const shaka::ByteBuffer &buffer) const
bool TryConvert(Handle< JsValue > value) override