mirror of
https://github.com/NixOS/nix
synced 2025-06-28 22:01:15 +02:00
Remove std::string alias
This commit is contained in:
parent
1ac2664472
commit
36c7b12f33
5 changed files with 24 additions and 27 deletions
|
@ -17,8 +17,8 @@ namespace nix {
|
|||
class Symbol
|
||||
{
|
||||
private:
|
||||
const string * s; // pointer into SymbolTable
|
||||
Symbol(const string * s) : s(s) { };
|
||||
const std::string * s; // pointer into SymbolTable
|
||||
Symbol(const std::string * s) : s(s) { };
|
||||
friend class SymbolTable;
|
||||
|
||||
public:
|
||||
|
@ -72,7 +72,7 @@ class SymbolTable
|
|||
{
|
||||
private:
|
||||
std::unordered_map<std::string_view, Symbol> symbols;
|
||||
std::list<string> store;
|
||||
std::list<std::string> store;
|
||||
|
||||
public:
|
||||
Symbol create(std::string_view s)
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
auto it = symbols.find(s);
|
||||
if (it != symbols.end()) return it->second;
|
||||
|
||||
const string & rawSym = store.emplace_back(s);
|
||||
auto & rawSym = store.emplace_back(s);
|
||||
return symbols.emplace(rawSym, Symbol(&rawSym)).first->second;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,20 +77,20 @@ 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;
|
||||
|
||||
/* Coerce the value to a string. Defaults to uncoercable, i.e. throws an
|
||||
* error
|
||||
* 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.
|
||||
*/
|
||||
virtual bool operator==(const ExternalValueBase & b) const;
|
||||
virtual bool operator ==(const ExternalValueBase & b) const;
|
||||
|
||||
/* Print the value as JSON. Defaults to unconvertable, i.e. throws an error */
|
||||
virtual void printValueAsJSON(EvalState & state, bool strict,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue