Commit e4b3987c authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

stdbuf: Track buffer size

parent 0770f9e0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -8,12 +8,17 @@ class BufferOutput : public T {
	private:
		BufferOutput(const BufferOutput &copy);
		char *buffer;
		uint16_t length;

	public:
		BufferOutput(char *target) { buffer = target; }
		BufferOutput(char *target) : buffer(target), length(0) {}
		virtual void put(char c) {
			*buffer = c;
			buffer++;
			length++;
		}
		inline uint16_t size() {
			return length;
		}
};

+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
class XDRStream {
 private:
	XDRStream(const XDRStream& copy);
	uint32_t next_array_len;
	uint16_t next_array_len;
	bool is_fixed_length;

 public: