Since the base formatter was extended with a dump_format_ns class,
implementing this here. For now, this is exactly same as dump_format, as
the concept of ns in json is not used.
Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@ril.com>
write_data(format, buf);
}
+void RGWFormatter_Plain::dump_format_ns(const char *name, const char *fmt, const char *ns, ...)
+{
+ // ignore the namespace for now
+ char buf[LARGE_SIZE];
+ va_list ap;
+ const char *format;
+
+ struct plain_stack_entry& entry = stack.back();
+
+ if (!min_stack_level)
+ min_stack_level = stack.size();
+
+ bool should_print = (stack.size() == min_stack_level && !entry.size);
+
+ entry.size++;
+
+ if (!should_print)
+ return;
+
+ va_start(ap, fmt);
+ vsnprintf(buf, LARGE_SIZE, fmt, ap);
+ va_end(ap);
+ if (len)
+ format = "\n%s";
+ else
+ format = "%s";
+
+ write_data(format, buf);
+}
+
int RGWFormatter_Plain::get_len() const
{
// don't include null termination in length
virtual void dump_format_unquoted(const char *name, const char *fmt, ...) {
assert(0 == "not implemented");
}
+ virtual void dump_format_ns(const char *name, const char *ns, const char *fmt, ...);
virtual int get_len() const;
virtual void write_raw_data(const char *data);