diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-02-25 16:00:00 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2022-02-25 16:13:02 +0100 |
commit | df552ff53e68dff8ca360adbdbea214ece1d08ee (patch) | |
tree | 9ed3cb700377d4731b4c234ebec16efb0099c71a /src/libutil/config.cc | |
parent | 14b38d0887f8a8d6b75039113eface57cfb19d06 (diff) |
Remove std::string alias (for real this time)
Also use std::string_view in a few more places.
Diffstat (limited to 'src/libutil/config.cc')
-rw-r--r-- | src/libutil/config.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libutil/config.cc b/src/libutil/config.cc index 8e05f1765..9bb412b4f 100644 --- a/src/libutil/config.cc +++ b/src/libutil/config.cc @@ -81,16 +81,16 @@ void AbstractConfig::applyConfig(const std::string & contents, const std::string unsigned int pos = 0; while (pos < contents.size()) { - string line; + std::string line; while (pos < contents.size() && contents[pos] != '\n') line += contents[pos++]; pos++; - string::size_type hash = line.find('#'); - if (hash != string::npos) - line = string(line, 0, hash); + auto hash = line.find('#'); + if (hash != std::string::npos) + line = std::string(line, 0, hash); - auto tokens = tokenizeString<std::vector<string>>(line); + auto tokens = tokenizeString<std::vector<std::string>>(line); if (tokens.empty()) continue; if (tokens.size() < 2) @@ -120,7 +120,7 @@ void AbstractConfig::applyConfig(const std::string & contents, const std::string if (tokens[1] != "=") throw UsageError("illegal configuration line '%1%' in '%2%'", line, path); - string name = tokens[0]; + std::string name = tokens[0]; auto i = tokens.begin(); advance(i, 2); @@ -132,7 +132,7 @@ void AbstractConfig::applyConfig(const std::string & contents, const std::string void AbstractConfig::applyConfigFile(const Path & path) { try { - string contents = readFile(path); + std::string contents = readFile(path); applyConfig(contents, path); } catch (SysError &) { } } |