From c9b54d7569e0ffbbbe719984fdb97b0f640fdb62 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Wed, 10 Jul 2013 14:19:56 -0700 Subject: [PATCH] common: Formatter: add flush to bufferlist Signed-off-by: Joao Eduardo Luis --- src/common/Formatter.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/Formatter.h b/src/common/Formatter.h index 60bf82cd89fc2..8775c0cf9df5c 100644 --- a/src/common/Formatter.h +++ b/src/common/Formatter.h @@ -10,6 +10,8 @@ #include #include +#include "include/buffer.h" + namespace ceph { @@ -25,6 +27,11 @@ class Formatter { virtual ~Formatter(); virtual void flush(std::ostream& os) = 0; + void flush(bufferlist &bl) { + std::stringstream os; + flush(os); + bl.append(os.str()); + } virtual void reset() = 0; virtual void open_array_section(const char *name) = 0; -- 2.39.5