From a162f4e8258ce1d401bc1cdb018e1212db80772d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 21 May 2020 05:43:22 +0100 Subject: refactor(3p/nix/libexpr): Use std::string as qualified type 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* --- third_party/nix/src/libexpr/json-to-value.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'third_party/nix/src/libexpr/json-to-value.cc') 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); -- cgit 1.4.1