about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/value.hh
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-21T04·43+0100
committerVincent Ambo <tazjin@google.com>2020-05-21T04·43+0100
commita162f4e8258ce1d401bc1cdb018e1212db80772d (patch)
treecf78df573c740ec054aea483101be29e5fa06e8c /third_party/nix/src/libexpr/value.hh
parentb97307056da53f094ab46e12f87d6a3f0a2be79f (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/value.hh')
-rw-r--r--third_party/nix/src/libexpr/value.hh11
1 files changed, 6 insertions, 5 deletions
diff --git a/third_party/nix/src/libexpr/value.hh b/third_party/nix/src/libexpr/value.hh
index 1f41cf04bb30..892c11220e42 100644
--- a/third_party/nix/src/libexpr/value.hh
+++ b/third_party/nix/src/libexpr/value.hh
@@ -1,6 +1,7 @@
 #pragma once
 
 #include "symbol-table.hh"
+#include "types.hh"
 
 #if HAVE_BOEHMGC
 #include <gc/gc_allocator.h>
@@ -56,10 +57,10 @@ class ExternalValueBase {
 
  public:
   /* Return a simple string describing the type */
-  virtual string showType() const = 0;
+  virtual std::string showType() const = 0;
 
   /* Return a string to be used in builtins.typeOf */
-  virtual string typeOf() const = 0;
+  virtual std::string typeOf() const = 0;
 
   /* How much space does this value take up */
   virtual size_t valueSize(std::set<const void*>& seen) const = 0;
@@ -67,8 +68,8 @@ class ExternalValueBase {
   /* Coerce the value to a string. Defaults to uncoercable, i.e. throws an
    * error
    */
-  virtual string coerceToString(const Pos& pos, PathSet& context, bool copyMore,
-                                bool copyToStore) const;
+  virtual std::string coerceToString(const Pos& pos, PathSet& context,
+                                     bool copyMore, bool copyToStore) const;
 
   /* Compare to another value of the same type. Defaults to uncomparable,
    * i.e. always false.
@@ -225,7 +226,7 @@ static inline void mkStringNoCopy(Value& v, const char* s) {
 }
 
 static inline void mkString(Value& v, const Symbol& s) {
-  mkStringNoCopy(v, ((const string&)s).c_str());
+  mkStringNoCopy(v, ((const std::string&)s).c_str());
 }
 
 void mkString(Value& v, const char* s);