lix/src/libexpr
Eelco Dolstra bbe97dff8b Make the Store API more type-safe
Most functions now take a StorePath argument rather than a Path (which
is just an alias for std::string). The StorePath constructor ensures
that the path is syntactically correct (i.e. it looks like
<store-dir>/<base32-hash>-<name>). Similarly, functions like
buildPaths() now take a StorePathWithOutputs, rather than abusing Path
by adding a '!<outputs>' suffix.

Note that the StorePath type is implemented in Rust. This involves
some hackery to allow Rust values to be used directly in C++, via a
helper type whose destructor calls the Rust type's drop()
function. The main issue is the dynamic nature of C++ move semantics:
after we have moved a Rust value, we should not call the drop function
on the original value. So when we move a value, we set the original
value to bitwise zero, and the destructor only calls drop() if the
value is not bitwise zero. This should be sufficient for most types.

Also lots of minor cleanups to the C++ API to make it more modern
(e.g. using std::optional and std::string_view in some places).
2019-12-10 22:06:05 +01:00
..
primops Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
attr-path.cc findDerivationFilename: add FIXME 2019-10-28 21:40:02 +01:00
attr-path.hh libexpr: findDerivationFilename return Pos instead of tuple 2019-10-28 21:29:54 +01:00
attr-set.cc Remove duplicate definition of allocBytes() 2018-06-12 17:49:51 +02:00
attr-set.hh Bindings: Add convenience method for requiring an attribute 2019-12-05 20:29:15 +01:00
common-eval-args.cc Refactor downloadCached() interface 2019-06-24 22:12:26 +02:00
common-eval-args.hh Fix build 2017-11-01 21:32:30 +01:00
eval-inline.hh GC_malloc -> GC_MALLOC 2018-06-12 17:49:55 +02:00
eval.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
eval.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
function-trace.hh Move #include 2019-12-05 20:30:29 +01:00
get-drvs.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
get-drvs.hh experimental/optional -> optional 2019-03-14 14:10:52 +01:00
json-to-value.cc Don't catch exceptions by value 2019-09-22 21:56:56 +02:00
json-to-value.hh Fix extra ; warnings involving MakeError 2019-11-10 11:24:47 -05:00
lexer.l simplify handling of extra '}' 2018-10-27 00:14:51 +02:00
local.mk Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
names.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
names.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
nix-expr.pc.in pkg-config files: Use c++17 2019-03-14 14:11:12 +01:00
nixexpr.cc Fix compatibility with latest boost::format 2018-03-14 19:25:09 +01:00
nixexpr.hh Fix extra ; warnings involving MakeError 2019-11-10 11:24:47 -05:00
parser.y Add feature to disable URL literals 2019-11-26 19:48:34 +01:00
primops.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
primops.hh Make prim_exec and prim_importNative available to plugins 2018-04-09 10:26:50 -04:00
symbol-table.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
value-to-json.cc builtins.toJSON: fix __toString usage 2019-10-27 10:15:51 +01:00
value-to-json.hh nix path-info: Add --json flag 2016-08-29 17:29:24 +02:00
value-to-xml.cc OCD performance fix: {find,count}+insert => insert 2019-10-09 16:06:29 +02:00
value-to-xml.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
value.hh Remove builtins.valueSize 2019-11-28 13:52:42 +01:00