]> git.proxmox.com Git - ceph.git/blame - ceph/src/common/HTMLFormatter.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / common / HTMLFormatter.h
CommitLineData
7c673cae
FG
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3#ifndef CEPH_HTML_FORMATTER_H
4#define CEPH_HTML_FORMATTER_H
5
6#include <iosfwd>
7#include <stdarg.h>
8#include <string>
9
10#include "Formatter.h"
11
12namespace ceph {
13 class HTMLFormatter : public XMLFormatter {
14 public:
15 explicit HTMLFormatter(bool pretty = false);
16 ~HTMLFormatter() override;
17 void reset() override;
18
19 void set_status(int status, const char* status_name) override;
20 void output_header() override;
21
22 void dump_unsigned(const char *name, uint64_t u) override;
23 void dump_int(const char *name, int64_t u) override;
24 void dump_float(const char *name, double d) override;
25 void dump_string(const char *name, const std::string& s) override;
26 std::ostream& dump_stream(const char *name) override;
27 void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
28
29 /* with attrs */
30 void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs) override;
31 private:
32 template <typename T> void dump_template(const char *name, T arg);
33
34 int m_status;
35 const char* m_status_name;
36 };
37
38}
39
40#endif