Explorar o código

AK: Expose Buffered's buffer size and underlying stream

kleines Filmröllchen %!s(int64=3) %!d(string=hai) anos
pai
achega
cbb2b4fe71
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      AK/Buffered.h

+ 4 - 0
AK/Buffered.h

@@ -108,6 +108,10 @@ public:
         return true;
     }
 
+    size_t buffered() const { return m_buffered; }
+    // Reading from the stream returned here will most definitely brick the buffering behavior of Buffered.
+    StreamType& underlying_stream() { return m_stream; }
+
 private:
     Bytes buffer() const { return { m_buffer, Size }; }