Nix/src/libutil
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
..
affinity.cc printMsg(lvlError, ...) -> printError(...) etc. 2016-09-21 16:54:53 +02:00
affinity.hh Run the daemon worker on the same CPU as the client 2013-08-07 14:02:04 +02:00
archive.cc Add O(1)-memory copyPath() function 2019-10-27 18:18:58 +01:00
archive.hh Add O(1)-memory copyPath() function 2019-10-27 18:18:58 +01:00
args.cc Initialize Command::_name 2019-12-05 20:21:22 +01:00
args.hh Initialize Command::_name 2019-12-05 20:21:22 +01:00
compression.cc Fix build failure if parallel xz is not available 2018-09-17 16:36:11 +02:00
compression.hh Fix Brotli decompression in 'nix log' 2018-08-06 15:40:29 +02:00
config.cc Modularize config settings 2018-05-30 13:28:01 +02:00
config.hh Modularize config settings 2018-05-30 13:28:01 +02:00
finally.hh Add missing #include 2016-11-07 14:35:47 +01:00
hash.cc Allow content-addressable paths to have references 2019-10-21 17:47:24 +02:00
hash.hh Allow content-addressable paths to have references 2019-10-21 17:47:24 +02:00
istringstream_nocopy.hh Move istringstream_nocopy to a separate file 2017-03-21 14:43:03 +01:00
json.cc Make std::uncaught_exception warning less noisy 2019-10-09 23:04:11 +02:00
json.hh Make std::uncaught_exception warning less noisy 2019-10-09 23:04:11 +02:00
lazy.hh Figure out the user's home directory if $HOME is not set 2017-05-05 17:08:23 +02:00
local.mk Move code around 2019-11-26 22:07:28 +01:00
logging.cc Add "warning" verbosity level 2019-06-25 12:44:17 +02:00
logging.hh Revert "Make fmt() non-recursive" 2019-12-05 19:58:49 +01:00
lru-cache.hh experimental/optional -> optional 2019-03-14 14:10:52 +01:00
monitor-fd.hh monitor-fds: Fix on macOS. 2018-02-14 18:26:37 -05:00
pool.hh RemoteStore: Close connection if an exception occurs 2018-10-16 23:36:15 +02:00
ref.hh Allow setting the state directory as a store parameter 2016-06-02 16:02:48 +02:00
rust-ffi.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
rust-ffi.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
serialise.cc experimental/optional -> optional 2019-03-14 14:10:52 +01:00
serialise.hh Drop remaining uses of external "tar" 2019-11-26 22:07:28 +01:00
sync.hh sync.hh: return cv_status instead of dropping it, in case useful. 2018-06-18 17:31:00 -05:00
tarfile.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
tarfile.hh Drop remaining uses of external "tar" 2019-11-26 22:07:28 +01:00
thread-pool.cc Fix a hang in ThreadPool 2017-10-09 15:41:09 +02:00
thread-pool.hh Fix extra ; warnings involving MakeError 2019-11-10 11:24:47 -05:00
types.hh Eliminate more pass-by-value in variadic calls 2019-12-05 19:58:52 +01:00
util.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
util.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
xml-writer.cc Cleanup 2019-11-06 16:53:02 +01:00
xml-writer.hh Fix some random -Wconversion warnings 2018-05-02 13:56:34 +02:00