Age | Commit message (Collapse) | Author |
|
The C++ delete operator can also handle passed null pointers on its own
without unexpected side effects.
http://www.parashift.com/c++-faq/delete-handles-null.html
It is therefore not needed to keep additional safety checks directly before
such function calls.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
|
|
Accidentally committed two patches under the same commit message. Both
patches will be added immediately after.
This reverts commit fb6f65a01eca950e2e12a87492268e7d2105aa0b.
|
|
The function "free" is documented in the way that no action shall occur for
a passed null pointer. It is therefore not needed that a function caller
repeats a corresponding check.
http://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
|
|
Removed old methods that handled adding and removing header,
section, paragraph, quotes, and remaining enums related to the previous
implementation of table, row, cell and its corresponding css formatting.
All these methods were replaced by the previously commited html and csv
design methods.
Signed-off-by: Alexandra Yates <alexandra.yates@linux.intel.com>
|
|
The old add table headder, add row, add cell and add empty cell were
removed since they are replaced by the new add_table function for html
and csv reports.
Signed-off-by: Alexandra Yates <alexandra.yates@linux.intel.com>
|
|
Reports PowerTop logo and the system information table
with the redesign css and organization.
Signed-off-by: Alexandra Yates <alexandra.yates@linux.intel.com>
|
|
Generates a modular table when using the report maker object.
It passess table_size, css_attributes, and data. The data is stored in
a single dimensional array using row major order.
Signed-off-by: Alexandra Yates <alexandra.yates@linux.intel.com>
|
|
Implements methods to generate navigation and summary from the report
object.
Signed-off-by: Alexandra Yates <alexandra.yates@linux.intel.com>
|
|
Calls to add a title and add a division from report maker using report
object to the generated report.
Signed-off-by: Alexandra Yates <alexandra.yates@linux.intel.com>
|
|
Implements add_logo in report generator
Signed-off-by: Alexandra Yates <alexandra.yates@linux.intel.com>
|
|
Enable asserts for test period and correct the comments.
It is better to know why a crash happen when it could happen
than just silently die.
|
|
Hello,
below is initial version of rework I was talking about. Igor did most part of it (introduced
report_formatter_base class), so mine are just minor tweaks. I'm glad still no one mentioned
templates, just kidding.
one thing I don't really like so far is
else if (type == REPORT_OFF)
formatter = new report_formatter();
which is just cryptic and thus look wrong.
perhaps we need something like `new report_formatter_basic()' here (which will require header
file rename).
please review and comment.
------------------------------------------------------------------------
Small rework on report formatter side:
- make report_formatter a basic class (previously was interface). hence we can
remove empty report_formatter interface implementation.
- drop report-formatter-null class
- in report maker now we create report_formatter instance for REPORT_OFF mode
- rename report_formatter_base to report_formatter_string_base, so class name tells
a bit more, later we can create report_formatter_xml_base/report_formatter_json_base/etc.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
This report generator adds the facility to generate correctly parsable
reports in HTML and CSV format. It separates document structure from
text formatting, enhances code readability and simplifies report generating.
Also it makes possible adding other formats such as TXT or XML.
This report generator implements the following document structure:
body
\---> section
|---> header
|---> paragraph
\---> table
\---> table row
\---> table cell
The report body consists of a number of sections (a.k.a. <div>s,
a.k.a. tabs).
Each section can contain headers (<h1>, <h2>, <h3>), paragraphs (<p>)
and tables (<table>).
A header is a single line of text.
Paragraphs can contain only text.
A table consists of table rows. A table row consists of table cells.
A table cell can contain only text.
Each section, table, row or cell could have its own formatting.
To distinguish elements from others of its type, each element could have
an unique identifier (see enums section_type, table_type, row_type and
cell_type below). These identifiers are used in formatter implementations
to produce special formatting.
Example of usage:
report_maker report(REPORT_OFF);
report.set_type(REPORT_HTML);
report.begin_section();
report.add_header("Big report");
report.begin_paragraph("Some text");
report.begin_table();
report.begin_row();
report.begin_cell();
report.add("Something");
report.begin_cell(CELL_SPECIAL);
report.add("Foo bar");
report.finish_report();
const char *result = report.get_result();
|