modernize std::string("foo") into "foo"s

* spot/ltsmin/ltsmin.cc, spot/misc/tmpfile.cc,
spot/parseaut/parseaut.yy, spot/taalgos/dot.cc, spot/tl/hierarchy.cc,
spot/tl/unabbrev.cc, spot/twa/acc.cc, spot/twa/twagraph.cc,
spot/twaalgos/dot.cc, spot/twaalgos/hoa.cc, spot/twaalgos/lbtt.cc,
spot/twaalgos/neverclaim.cc, spot/twaalgos/strength.cc,
spot/twaalgos/word.cc: Replace std::string("foo") by "foo"s, and
include namespace std::string_literals.
This commit is contained in:
Alexandre Duret-Lutz 2018-07-19 11:02:47 +02:00
parent 832ee81f75
commit d08193508e
14 changed files with 66 additions and 51 deletions

View file

@ -39,6 +39,7 @@
#include <ctype.h>
#include <utility>
using namespace std::string_literals;
namespace spot
{
@ -176,7 +177,7 @@ namespace spot
// Prevent infinite recursions...
if (orig == def.c_str())
throw std::runtime_error
(std::string("SPOT_DOTDEFAULT should not contain '.'"));
("SPOT_DOTDEFAULT should not contain '.'");
if (!def.empty())
parse_opts(def.c_str());
break;
@ -312,7 +313,7 @@ namespace spot
break;
default:
throw std::runtime_error
(std::string("unknown option for print_dot(): ") + c);
("unknown option for print_dot(): "s + c);
}
if (opt_color_sets_ && !opt_latex_)
opt_html_labels_ = true;

View file

@ -32,6 +32,8 @@
#include <spot/tl/formula.hh>
#include <spot/kripke/fairkripke.hh>
using namespace std::string_literals;
namespace spot
{
namespace
@ -318,8 +320,7 @@ namespace spot
verbose = true;
break;
default:
throw std::runtime_error
(std::string("unknown option for print_hoa(): ") + c);
throw std::runtime_error("unknown option for print_hoa(): "s + c);
}
}

View file

@ -31,6 +31,8 @@
#include "spot/priv/accmap.hh"
#include <spot/tl/print.hh>
using namespace std::string_literals;
namespace spot
{
namespace
@ -142,8 +144,7 @@ namespace spot
sba = false;
break;
default:
throw std::runtime_error
(std::string("unknown option for print_lbtt(): ") + c);
throw std::runtime_error("unknown option for print_lbtt(): "s + c);
}
lbtt_bfs b(g, os, sba);

View file

@ -29,6 +29,8 @@
#include <spot/tl/print.hh>
#include <spot/twa/formula2bdd.hh>
using namespace std::string_literals;
namespace spot
{
namespace
@ -61,8 +63,7 @@ namespace spot
break;
default:
throw std::runtime_error
(std::string("unknown option for print_never_claim(): ")
+ c);
("unknown option for print_never_claim(): "s + c);
}
}

View file

@ -23,6 +23,8 @@
#include <spot/twaalgos/isweakscc.hh>
#include <spot/twaalgos/mask.hh>
using namespace std::string_literals;
namespace spot
{
namespace
@ -206,7 +208,7 @@ namespace spot
{
if (keep_opt == nullptr || *keep_opt == 0)
throw std::runtime_error
(std::string("option for decompose_scc() should not be empty"));
("option for decompose_scc() should not be empty");
enum strength {
Ignore = 0,
@ -247,7 +249,7 @@ namespace spot
if ((long unsigned) scc >= n)
{
throw std::runtime_error
(std::string("decompose_scc(): there is no SCC ")
("decompose_scc(): there is no SCC "s
+ std::to_string(scc) + " in this automaton");
}
keep_opt = endptr;
@ -272,7 +274,7 @@ namespace spot
if (j != scc + 1)
{
throw std::runtime_error
(std::string("decompose_scc(): there is no SCC 'a")
("decompose_scc(): there is no SCC 'a"s
+ std::to_string(scc) + "' in this automaton");
}
keep_opt = endptr;
@ -289,7 +291,7 @@ namespace spot
break;
default:
throw std::runtime_error
(std::string("unknown option for decompose_scc(): ") + c);
("unknown option for decompose_scc(): "s + c);
}
auto p = aut->acc().unsat_mark();

View file

@ -25,6 +25,8 @@
#include <spot/tl/simplify.hh>
#include <spot/tl/apcollect.hh>
using namespace std::string_literals;
namespace spot
{
twa_word::twa_word(const twa_run_ptr& run)
@ -185,7 +187,7 @@ namespace spot
};
// Parse the prefix part. Can be empty.
while (word.substr(i, 6) != std::string("cycle{"))
while (word.substr(i, 6) != "cycle{"s)
{
ind = skip_next_formula(word, i);
if (ind == std::string::npos)