MCPcopy Create free account
hub / github.com/craftzdog/react-native-quick-base64 / DecodedBuffer

Class DecodedBuffer

cpp/QuickBase64Impl.cpp:15–24  ·  view source on GitHub ↗

Owns a decoded std::string. JSI holds the shared_ptr alive for the ArrayBuffer's lifetime — no memcpy needed.

Source from the content-addressed store, hash-verified

13// Owns a decoded std::string. JSI holds the shared_ptr alive for the
14// ArrayBuffer's lifetime — no memcpy needed.
15class DecodedBuffer final : public jsi::MutableBuffer {
16public:
17 explicit DecodedBuffer(std::string&& s) noexcept : data_(std::move(s)) {}
18 size_t size() const override { return data_.size(); }
19 uint8_t* data() override {
20 return reinterpret_cast<uint8_t*>(data_.data());
21 }
22private:
23 std::string data_;
24};
25
26// Mirrors V8's Uint8Array.fromBase64 (TC39-aligned):
27// - last_chunk_handling_options::loose accepts inputs without '=' padding

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected