]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/Formatter: add dump_object helper
authorSage Weil <sage@redhat.com>
Mon, 9 Feb 2015 08:56:50 +0000 (00:56 -0800)
committerSage Weil <sage@redhat.com>
Wed, 19 Aug 2015 21:03:52 +0000 (17:03 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/Formatter.h

index 3ce5996ce22bab7c19ecc1df9aab2b8a62d9c27a..181a0e0a86aee18c9101db7d9a6ee4fe0c461236 100644 (file)
@@ -62,6 +62,12 @@ namespace ceph {
     {
       dump_format_unquoted(name, "%s", (b ? "true" : "false"));
     }
+    template<typename T>
+    void dump_object(const char *name, const T& foo) {
+      open_object_section(name);
+      foo.dump(this);
+      close_section();
+    }
     virtual std::ostream& dump_stream(const char *name) = 0;
     virtual void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) = 0;
     virtual void dump_format(const char *name, const char *fmt, ...);