MCPcopy Create free account
hub / github.com/SFML/SFML / streamRead

Function streamRead

src/SFML/Audio/SoundFileReaderFlac.cpp:43–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41namespace
42{
43FLAC__StreamDecoderReadStatus streamRead(
44 const FLAC__StreamDecoder*,
45 FLAC__byte buffer[], // NOLINT(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays)
46 std::size_t* bytes,
47 void* clientData)
48{
49 auto* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
50
51 if (const std::optional count = data->stream->read(buffer, *bytes))
52 {
53 if (*count > 0)
54 {
55 *bytes = *count;
56 return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
57 }
58
59 return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
60 }
61
62 return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
63}
64
65FLAC__StreamDecoderSeekStatus streamSeek(const FLAC__StreamDecoder*, FLAC__uint64 absoluteByteOffset, void* clientData)
66{

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected