diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-21T04·43+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-21T04·43+0100 |
commit | a162f4e8258ce1d401bc1cdb018e1212db80772d (patch) | |
tree | cf78df573c740ec054aea483101be29e5fa06e8c /third_party/nix/src/libexpr/json-to-value.cc | |
parent | b97307056da53f094ab46e12f87d6a3f0a2be79f (diff) |
refactor(3p/nix/libexpr): Use std::string as qualified type r/797
Replaces most uses of `string` with `std::string`. This came up because I removed the "types.hh" import from "symbol-table.hh", which percolated through a bunch of files where `string` was suddenly no longer defined ... *sigh*
Diffstat (limited to 'third_party/nix/src/libexpr/json-to-value.cc')
-rw-r--r-- | third_party/nix/src/libexpr/json-to-value.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/third_party/nix/src/libexpr/json-to-value.cc b/third_party/nix/src/libexpr/json-to-value.cc index ea7d575aa9e2..17603c59ea2a 100644 --- a/third_party/nix/src/libexpr/json-to-value.cc +++ b/third_party/nix/src/libexpr/json-to-value.cc @@ -10,8 +10,8 @@ static void skipWhitespace(const char*& s) { } } -static string parseJSONString(const char*& s) { - string res; +static std::string parseJSONString(const char*& s) { + std::string res; if (*s++ != '"') { throw JSONParseError("expected JSON string"); } @@ -97,7 +97,7 @@ static void parseJSON(EvalState& state, const char*& s, Value& v) { if (attrs.empty() && *s == '}') { break; } - string name = parseJSONString(s); + std::string name = parseJSONString(s); skipWhitespace(s); if (*s != ':') { throw JSONParseError("expected ':' in JSON object"); @@ -128,7 +128,7 @@ static void parseJSON(EvalState& state, const char*& s, Value& v) { } else if ((isdigit(*s) != 0) || *s == '-' || *s == '.') { - // Buffer into a string first, then use built-in C++ conversions + // Buffer into a std::string first, then use built-in C++ conversions std::string tmp_number; ValueType number_type = tInt; @@ -173,7 +173,7 @@ static void parseJSON(EvalState& state, const char*& s, Value& v) { } } -void parseJSON(EvalState& state, const string& s_, Value& v) { +void parseJSON(EvalState& state, const std::string& s_, Value& v) { const char* s = s_.c_str(); parseJSON(state, s, v); skipWhitespace(s); |