Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
store-cast.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/store/store-api.hh
"
5
6
namespace
nix {
7
15
template
<
typename
T>
16
T &
require
(
Store
& store)
17
{
18
auto
* castedStore =
dynamic_cast<
T *
>
(&store);
19
if
(!castedStore)
20
throw
UsageError
(
"%s not supported by store '%s'"
, T::operationName, store.config.getHumanReadableURI());
21
return
*castedStore;
22
}
23
24
}
// namespace nix
nix::Store
Definition
store-api.hh:397
nix::UsageError
Definition
error.hh:311
store-api.hh
nix::require
T & require(Store &store)
Definition
store-cast.hh:16
libstore
include
nix
store
store-cast.hh
Generated by
1.18.0