[Powertop] [PATCH v3 05/31] report-csv: title, div, logo, header

Alexandra Yates <alexandra.yates at linux.intel.com>
Newsgroups dev.linux.lists.powertop
Message-ID <1384806442-20294-6-git-send-email-alexandra.yates@linux.intel.com>
Implements csv report functionality to add title, division, header,
and logo.

Signed-off-by: Alexandra Yates <alexandra.yates(a)linux.intel.com>
---
 src/report/report-formatter-csv.cpp |   39 +++++++++++++++++++++++++++++++++++
 src/report/report-formatter-csv.h   |    8 +++++++
 2 files changed, 47 insertions(+)

diff --git a/src/report/report-formatter-csv.cpp b/src/report/report-formatter-csv.cpp
index cd70d91..bd9dfd3 100644
--- a/src/report/report-formatter-csv.cpp
+++ b/src/report/report-formatter-csv.cpp
@@ -222,3 +222,42 @@ report_formatter_csv::set_cpu_number(int nr UNUSED)
 {
 	/* Do nothing */
 }
+
+/* Report Style */
+void
+report_formatter_csv::add_header()
+{
+	add_exact("\n====================================================================\n");
+}
+
+void
+report_formatter_csv::end_hheader()
+{
+	/* Do nothing */
+}
+
+void
+report_formatter_csv::add_logo()
+{
+	add_exact("\t\t\tP o w e r T o p\n");
+}
+
+
+void
+report_formatter_csv::add_div(struct tag_attr * div_attr)
+{
+	add_exact("\n");
+}
+
+void
+report_formatter_csv::end_div()
+{
+	/*Do nothing*/
+}
+
+void
+report_formatter_csv::add_title(struct tag_attr *title_att, const char *title)
+{
+	add_exact("____________________________________________________________________\n");
+	addf_exact(" *  *  *   %s   *  *  *\n", title);
+}
diff --git a/src/report/report-formatter-csv.h b/src/report/report-formatter-csv.h
index 8dd2976..2c1c0fd 100644
--- a/src/report/report-formatter-csv.h
+++ b/src/report/report-formatter-csv.h
@@ -71,6 +71,14 @@ public:
 
 	void set_cpu_number(int nr);
 
+	/* Report Style */
+	void add_logo();
+	void add_header();
+	void end_hheader();
+	void add_div(struct tag_attr *div_attr);
+	void end_div();
+	void add_title(struct tag_attr *title_att, const char *title);
+
 private:
 	void add_doc_header();
 
-- 
1.7.9.5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.