MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / read_scalar

Function read_scalar

src/framework/audio/wav_reader.cpp:12–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace engine::audio {
11namespace {
12
13class ReadOnlyMemoryStreamBuffer final : public std::streambuf {
14public:
15 explicit ReadOnlyMemoryStreamBuffer(std::string_view data) {
16 // std::streambuf::setg takes char*, but this input stream only reads from the buffer.
17 auto * begin = const_cast<char *>(data.data());
18 setg(begin, begin, begin + data.size());
19 }
20
21protected:
22 pos_type seekoff(off_type offset, std::ios_base::seekdir dir, std::ios_base::openmode which) override {

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected