mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 03:09:35 +01:00
Move /src to /subprojects
This will facilitate breaking up Nix into multiple packages for each component with Meson.
This commit is contained in:
parent
4db9487823
commit
84e2963f8e
737 changed files with 504 additions and 505 deletions
48
subprojects/libstore/path-with-outputs.hh
Normal file
48
subprojects/libstore/path-with-outputs.hh
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "path.hh"
|
||||
#include "derived-path.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
struct StoreDirConfig;
|
||||
|
||||
/**
|
||||
* This is a deprecated old type just for use by the old CLI, and older
|
||||
* versions of the RPC protocols. In new code don't use it; you want
|
||||
* `DerivedPath` instead.
|
||||
*
|
||||
* `DerivedPath` is better because it handles more cases, and does so more
|
||||
* explicitly without devious punning tricks.
|
||||
*/
|
||||
struct StorePathWithOutputs
|
||||
{
|
||||
StorePath path;
|
||||
std::set<std::string> outputs;
|
||||
|
||||
std::string to_string(const StoreDirConfig & store) const;
|
||||
|
||||
DerivedPath toDerivedPath() const;
|
||||
|
||||
typedef std::variant<StorePathWithOutputs, StorePath, std::monostate> ParseResult;
|
||||
|
||||
static StorePathWithOutputs::ParseResult tryFromDerivedPath(const DerivedPath &);
|
||||
};
|
||||
|
||||
std::vector<DerivedPath> toDerivedPaths(const std::vector<StorePathWithOutputs>);
|
||||
|
||||
std::pair<std::string_view, StringSet> parsePathWithOutputs(std::string_view s);
|
||||
|
||||
/**
|
||||
* Split a string specifying a derivation and a set of outputs
|
||||
* (/nix/store/hash-foo!out1,out2,...) into the derivation path
|
||||
* and the outputs.
|
||||
*/
|
||||
StorePathWithOutputs parsePathWithOutputs(const StoreDirConfig & store, std::string_view pathWithOutputs);
|
||||
|
||||
class Store;
|
||||
|
||||
StorePathWithOutputs followLinksToStorePathWithOutputs(const Store & store, std::string_view pathWithOutputs);
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue