]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common: add Formatter class
authorSage Weil <sage@newdream.net>
Thu, 21 Jul 2011 19:54:00 +0000 (12:54 -0700)
committerSage Weil <sage@newdream.net>
Thu, 21 Jul 2011 20:33:29 +0000 (13:33 -0700)
commitd6bb5718bb72ae780099c2810eff2d3855039e41
treee3b1ec81c36a891a0050824a2288f8619d020697
parent56283eb656ab52eed9649a92e437603fa1d49803
common: add Formatter class

This is based on the RGW class, but

 - uses a stringstream
 - has an additional dump_stream() method that gives you a usable ostream
 - handles object keys properly

We should merge these implementations.

Not sure if either a stringstream or the raw buffer in the rgw class is
ideal.  Probably output should accumulate on a bufferlist so we can avoid
ever reallocating for big dumps.

Signed-off-by: Sage Weil <sage@newdream.net>
src/Makefile.am
src/common/Formatter.cc [new file with mode: 0644]
src/common/Formatter.h [new file with mode: 0644]