Owns a decoded std::string. JSI holds the shared_ptr alive for the ArrayBuffer's lifetime — no memcpy needed.
| 13 | // Owns a decoded std::string. JSI holds the shared_ptr alive for the |
| 14 | // ArrayBuffer's lifetime — no memcpy needed. |
| 15 | class DecodedBuffer final : public jsi::MutableBuffer { |
| 16 | public: |
| 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 | } |
| 22 | private: |
| 23 | std::string data_; |
| 24 | }; |
| 25 | |
| 26 | // Mirrors V8's Uint8Array.fromBase64 (TC39-aligned): |
| 27 | // - last_chunk_handling_options::loose accepts inputs without '=' padding |
nothing calls this directly
no outgoing calls
no test coverage detected