From a7d9f248eab1af41fd5dbb31e394c07b8e059220 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 12 Jul 2014 00:23:22 +0200 Subject: [PATCH] DecoderBuffer: add method _get_stream() --- src/DecoderBuffer.cxx | 6 ++++++ src/DecoderBuffer.hxx | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/DecoderBuffer.cxx b/src/DecoderBuffer.cxx index 0b326a6fd..78a2ccdc6 100644 --- a/src/DecoderBuffer.cxx +++ b/src/DecoderBuffer.cxx @@ -70,6 +70,12 @@ decoder_buffer_free(DecoderBuffer *buffer) g_free(buffer); } +const InputStream & +decoder_buffer_get_stream(const DecoderBuffer *buffer) +{ + return *buffer->is; +} + bool decoder_buffer_is_empty(const DecoderBuffer *buffer) { diff --git a/src/DecoderBuffer.hxx b/src/DecoderBuffer.hxx index d09416b06..0eaf0c4f3 100644 --- a/src/DecoderBuffer.hxx +++ b/src/DecoderBuffer.hxx @@ -52,6 +52,10 @@ decoder_buffer_new(Decoder *decoder, InputStream &is, void decoder_buffer_free(DecoderBuffer *buffer); +gcc_pure +const InputStream & +decoder_buffer_get_stream(const DecoderBuffer *buffer); + gcc_pure bool decoder_buffer_is_empty(const DecoderBuffer *buffer);