From 3f3c648358dba95b590ab2e13e614cb6d54af8a5 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Tue, 2 Mar 2021 17:13:52 -0500 Subject: [PATCH] Update option_parser for recent refactorings. --- nvbench/option_parser.cu | 17 ++++++++--------- nvbench/option_parser.cuh | 6 +++--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/nvbench/option_parser.cu b/nvbench/option_parser.cu index f007087..6e74391 100644 --- a/nvbench/option_parser.cu +++ b/nvbench/option_parser.cu @@ -312,7 +312,7 @@ void option_parser::parse_impl() // Make sure there's a default printer if needed: if (!m_have_stdout_printer) { - this->add_markdown_format("stdout"); + this->add_markdown_printer("stdout"); } } @@ -361,13 +361,13 @@ void option_parser::parse_range(option_parser::arg_iterator_t first, else if (arg == "--markdown" || arg == "--md") { check_params(1); - this->add_markdown_format(first[1]); + this->add_markdown_printer(first[1]); first += 2; } else if (arg == "--csv") { check_params(1); - this->add_csv_format(first[1]); + this->add_csv_printer(first[1]); first += 2; } else if (arg == "--benchmark" || arg == "-b") @@ -410,10 +410,10 @@ void option_parser::parse_range(option_parser::arg_iterator_t first, } } -void option_parser::add_markdown_format(const std::string &spec) +void option_parser::add_markdown_printer(const std::string &spec) try { - std::ostream &stream = this->output_format_spec_to_ostream(spec); + std::ostream &stream = this->printer_spec_to_ostream(spec); auto &printer = m_printer.emplace(stream); if (spec == "stdout") { @@ -428,10 +428,10 @@ catch (std::exception &e) e.what()); } -void option_parser::add_csv_format(const std::string &spec) +void option_parser::add_csv_printer(const std::string &spec) try { - std::ostream &stream = this->output_format_spec_to_ostream(spec); + std::ostream &stream = this->printer_spec_to_ostream(spec); m_printer.emplace(stream); } catch (std::exception &e) @@ -442,8 +442,7 @@ catch (std::exception &e) e.what()); } -std::ostream & -option_parser::output_format_spec_to_ostream(const std::string &spec) +std::ostream &option_parser::printer_spec_to_ostream(const std::string &spec) { if (spec == "stdout") { diff --git a/nvbench/option_parser.cuh b/nvbench/option_parser.cuh index a54b39c..c663cec 100644 --- a/nvbench/option_parser.cuh +++ b/nvbench/option_parser.cuh @@ -60,10 +60,10 @@ private: using arg_iterator_t = std::vector::const_iterator; void parse_range(arg_iterator_t first, arg_iterator_t last); - void add_markdown_format(const std::string &spec); - void add_csv_format(const std::string &spec); + void add_markdown_printer(const std::string &spec); + void add_csv_printer(const std::string &spec); - std::ostream &output_format_spec_to_ostream(const std::string &spec); + std::ostream &printer_spec_to_ostream(const std::string &spec); void print_list() const;