libutil: add Bytes type

not used anywhere yet, but we'll use this a lot soon for generators that
return file contents, wire protocol fragments, or indeed any byte stream

Change-Id: I01a46f9bf9d75aaf4a5d7662773b99f498862a28
This commit is contained in:
eldritch horrors
2024-06-30 17:30:34 +02:00
parent 11307e04d1
commit 2521f52465
+5
View File
@@ -11,6 +11,7 @@
#include <map>
#include <variant>
#include <vector>
#include <span>
namespace nix {
@@ -19,6 +20,10 @@ typedef std::set<std::string> StringSet;
typedef std::map<std::string, std::string> StringMap;
typedef std::map<std::string, std::string> StringPairs;
// TODO this should be a std::byte span, but too much of the
// current codebase predates std::byte and uses char instead
using Bytes = std::span<const char>;
/**
* Paths are just strings.
*/