File tree Expand file tree Collapse file tree 3 files changed +47
-38
lines changed Expand file tree Collapse file tree 3 files changed +47
-38
lines changed Original file line number Diff line number Diff line change 11#include " nix/store/store-registration.hh"
22#include " nix/util/callback.hh"
3+ #include " nix/store/dummy-store.hh"
34
45namespace nix {
56
6- struct DummyStoreConfig : public std ::enable_shared_from_this<DummyStoreConfig>, virtual StoreConfig
7+ std::string DummyStoreConfig::doc ()
78{
8- using StoreConfig::StoreConfig;
9-
10- DummyStoreConfig (std::string_view scheme, std::string_view authority, const Params & params)
11- : StoreConfig(params)
12- {
13- if (!authority.empty ())
14- throw UsageError (" `%s` store URIs must not contain an authority part %s" , scheme, authority);
15- }
16-
17- static const std::string name ()
18- {
19- return " Dummy Store" ;
20- }
21-
22- static std::string doc ()
23- {
24- return
9+ return
2510#include " dummy-store.md"
26- ;
27- }
28-
29- static StringSet uriSchemes ()
30- {
31- return {" dummy" };
32- }
33-
34- ref<Store> openStore () const override ;
35-
36- StoreReference getReference () const override
37- {
38- return {
39- .variant =
40- StoreReference::Specified{
41- .scheme = *uriSchemes ().begin (),
42- },
43- };
44- }
45- };
11+ ;
12+ }
4613
4714struct DummyStore : virtual Store
4815{
Original file line number Diff line number Diff line change 1+ #include " nix/store/store-api.hh"
2+
3+ namespace nix {
4+
5+ struct DummyStoreConfig : public std ::enable_shared_from_this<DummyStoreConfig>, virtual StoreConfig
6+ {
7+ using StoreConfig::StoreConfig;
8+
9+ DummyStoreConfig (std::string_view scheme, std::string_view authority, const Params & params)
10+ : StoreConfig(params)
11+ {
12+ if (!authority.empty ())
13+ throw UsageError (" `%s` store URIs must not contain an authority part %s" , scheme, authority);
14+ }
15+
16+ static const std::string name ()
17+ {
18+ return " Dummy Store" ;
19+ }
20+
21+ static std::string doc ();
22+
23+ static StringSet uriSchemes ()
24+ {
25+ return {" dummy" };
26+ }
27+
28+ ref<Store> openStore () const override ;
29+
30+ StoreReference getReference () const override
31+ {
32+ return {
33+ .variant =
34+ StoreReference::Specified{
35+ .scheme = *uriSchemes ().begin (),
36+ },
37+ };
38+ }
39+ };
40+
41+ } // namespace nix
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ headers = [ config_pub_h ] + files(
3434 ' derived-path-map.hh' ,
3535 ' derived-path.hh' ,
3636 ' downstream-placeholder.hh' ,
37+ ' dummy-store.hh' ,
3738 ' export-import.hh' ,
3839 ' filetransfer.hh' ,
3940 ' gc-store.hh' ,
You can’t perform that action at this time.
0 commit comments