lix/src/nix
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
..
add-to-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
build.cc Make subcommand construction in MultiCommand lazy 2019-12-05 20:19:26 +01:00
cat.cc Make subcommand construction in MultiCommand lazy 2019-12-05 20:19:26 +01:00
command.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
command.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
copy.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
doctor.cc nix doctor: Fix typo 2019-12-05 20:40:52 +01:00
dump-path.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
edit.cc Make subcommand construction in MultiCommand lazy 2019-12-05 20:19:26 +01:00
eval.cc Make subcommand construction in MultiCommand lazy 2019-12-05 20:19:26 +01:00
hash.cc Make subcommand construction in MultiCommand lazy 2019-12-05 20:19:26 +01:00
installables.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
legacy.cc Start of new Nix command-line interface 2016-02-09 21:28:29 +01:00
legacy.hh Fix Darwin build 2016-03-15 12:11:27 +01:00
local.mk Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
log.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
ls.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
main.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
make-content-addressable.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
optimise-store.cc Make subcommand construction in MultiCommand lazy 2019-12-05 20:19:26 +01:00
path-info.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
ping-store.cc Make subcommand construction in MultiCommand lazy 2019-12-05 20:19:26 +01:00
progress-bar.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
progress-bar.hh nix: Add --print-build-logs flag 2019-05-15 17:33:56 +02:00
repl.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
run.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
search.cc Make subcommand construction in MultiCommand lazy 2019-12-05 20:19:26 +01:00
show-config.cc Make subcommand construction in MultiCommand lazy 2019-12-05 20:19:26 +01:00
show-derivation.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
sigs.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
upgrade-nix.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
verify.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
why-depends.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00