Shaka Player Embedded
Public Member Functions | Static Public Member Functions | List of all members
shaka::ByteString Class Reference

#include <byte_string.h>

Inheritance diagram for shaka::ByteString:
shaka::GenericConverter shaka::memory::Traceable

Public Member Functions

 ByteString (const char *source)
 
 ByteString (const std::string &source)
 
bool TryConvert (Handle< JsValue > value) override
 
ReturnVal< JsValue > ToJsValue () const override
 
void Trace (memory::HeapTracer *tracer) const override
 
- Public Member Functions inherited from shaka::GenericConverter
virtual ~GenericConverter ()
 
- Public Member Functions inherited from shaka::memory::Traceable
virtual ~Traceable ()
 
virtual bool IsRootedAlive () const
 
virtual bool IsShortLived () const
 

Static Public Member Functions

static std::string name ()
 

Additional Inherited Members

- Static Public Attributes inherited from shaka::memory::Traceable
static constexpr const uint64_t kShortLiveDurationMs = 5000
 

Detailed Description

Represents a string where each character is interpreted as a byte, independent of the encoding.

This inherits from std::vector to expose the same methods (e.g. size(), data(), operator[]).

Definition at line 32 of file byte_string.h.

Constructor & Destructor Documentation

§ ByteString() [1/2]

shaka::ByteString::ByteString ( const char *  source)
explicit

Definition at line 25 of file byte_string.cc.

§ ByteString() [2/2]

shaka::ByteString::ByteString ( const std::string &  source)
explicit

Definition at line 28 of file byte_string.cc.

Member Function Documentation

§ name()

static std::string shaka::ByteString::name ( )
inlinestatic

Definition at line 36 of file byte_string.h.

§ ToJsValue()

ReturnVal< JsValue > shaka::ByteString::ToJsValue ( ) const
overridevirtual

Converts the current value into a JavaScript value.

Implements shaka::GenericConverter.

Definition at line 69 of file byte_string.cc.

§ Trace()

void shaka::ByteString::Trace ( memory::HeapTracer tracer) const
inlineoverridevirtual

Called during a GC run. This should call HeapTracer::Trace on all Traceable members. Be sure to call the base method when overriding.

Implements shaka::memory::Traceable.

Definition at line 49 of file byte_string.h.

§ TryConvert()

bool shaka::ByteString::TryConvert ( Handle< JsValue >  value)
overridevirtual

Tries to convert the given value into the required type, populating the members of this object as needed.

Returns
True on success, false on error.

Implements shaka::GenericConverter.

Definition at line 32 of file byte_string.cc.


The documentation for this class was generated from the following files: