1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-21 09:49:36 +01:00

StoreAPI -> Store

Calling a class an API is a bit redundant...
This commit is contained in:
Eelco Dolstra 2016-02-04 14:48:42 +01:00
parent c10c61449f
commit fa7cd5369b
24 changed files with 51 additions and 51 deletions

View file

@ -68,7 +68,7 @@ bool BasicDerivation::canBuildLocally() const
}
Path writeDerivation(ref<StoreAPI> store,
Path writeDerivation(ref<Store> store,
const Derivation & drv, const string & name, bool repair)
{
PathSet references;
@ -274,7 +274,7 @@ DrvHashes drvHashes;
paths have been replaced by the result of a recursive call to this
function, and that for fixed-output derivations we return a hash of
its output path. */
Hash hashDerivationModulo(StoreAPI & store, Derivation drv)
Hash hashDerivationModulo(Store & store, Derivation drv)
{
/* Return a fixed hash for fixed-output derivations. */
if (drv.isFixedOutput()) {

View file

@ -80,11 +80,11 @@ struct Derivation : BasicDerivation
};
class StoreAPI;
class Store;
/* Write a derivation to the Nix store, and return its path. */
Path writeDerivation(ref<StoreAPI> store,
Path writeDerivation(ref<Store> store,
const Derivation & drv, const string & name, bool repair = false);
/* Read a derivation from a file. */
@ -94,7 +94,7 @@ Derivation readDerivation(const Path & drvPath);
derivations. */
bool isDerivation(const string & fileName);
Hash hashDerivationModulo(StoreAPI & store, Derivation drv);
Hash hashDerivationModulo(Store & store, Derivation drv);
/* Memoisation of hashDerivationModulo(). */
typedef std::map<Path, Hash> DrvHashes;

View file

@ -188,7 +188,7 @@ DownloadResult downloadFile(string url, const DownloadOptions & options)
}
Path downloadFileCached(ref<StoreAPI> store, const string & url, bool unpack)
Path downloadFileCached(ref<Store> store, const string & url, bool unpack)
{
Path cacheDir = getEnv("XDG_CACHE_HOME", getEnv("HOME", "") + "/.cache") + "/nix/tarballs";
createDirs(cacheDir);

View file

@ -19,11 +19,11 @@ struct DownloadResult
string data, etag;
};
class StoreAPI;
class Store;
DownloadResult downloadFile(string url, const DownloadOptions & options);
Path downloadFileCached(ref<StoreAPI> store, const string & url, bool unpack);
Path downloadFileCached(ref<Store> store, const string & url, bool unpack);
MakeError(DownloadError, Error)

View file

@ -83,7 +83,7 @@ void LocalStore::addIndirectRoot(const Path & path)
}
Path addPermRoot(ref<StoreAPI> store, const Path & _storePath,
Path addPermRoot(ref<Store> store, const Path & _storePath,
const Path & _gcRoot, bool indirect, bool allowOutsideRootsDir)
{
Path storePath(canonPath(_storePath));

View file

@ -80,7 +80,7 @@ struct SQLiteStmt
};
class LocalStore : public StoreAPI
class LocalStore : public Store
{
private:
typedef std::map<Path, RunningSubstituter> RunningSubstituters;

View file

@ -7,7 +7,7 @@
namespace nix {
Derivation StoreAPI::derivationFromPath(const Path & drvPath)
Derivation Store::derivationFromPath(const Path & drvPath)
{
assertStorePath(drvPath);
ensurePath(drvPath);
@ -15,7 +15,7 @@ Derivation StoreAPI::derivationFromPath(const Path & drvPath)
}
void StoreAPI::computeFSClosure(const Path & path,
void Store::computeFSClosure(const Path & path,
PathSet & paths, bool flipDirection, bool includeOutputs, bool includeDerivers)
{
if (paths.find(path) != paths.end()) return;
@ -59,7 +59,7 @@ void StoreAPI::computeFSClosure(const Path & path,
}
void StoreAPI::queryMissing(const PathSet & targets,
void Store::queryMissing(const PathSet & targets,
PathSet & willBuild, PathSet & willSubstitute, PathSet & unknown,
unsigned long long & downloadSize, unsigned long long & narSize)
{
@ -173,7 +173,7 @@ void StoreAPI::queryMissing(const PathSet & targets,
}
Paths StoreAPI::topoSortPaths(const PathSet & paths)
Paths Store::topoSortPaths(const PathSet & paths)
{
Paths sorted;
PathSet visited, parents;

View file

@ -74,7 +74,7 @@ static void makeName(const Path & profile, unsigned int num,
}
Path createGeneration(ref<StoreAPI> store, Path profile, Path outPath)
Path createGeneration(ref<Store> store, Path profile, Path outPath)
{
/* The new generation number should be higher than old the
previous ones. */

View file

@ -31,9 +31,9 @@ typedef list<Generation> Generations;
profile, sorted by generation number. */
Generations findGenerations(Path profile, int & curGen);
class StoreAPI;
class Store;
Path createGeneration(ref<StoreAPI> store, Path profile, Path outPath);
Path createGeneration(ref<Store> store, Path profile, Path outPath);
void deleteGeneration(const Path & profile, unsigned int gen);

View file

@ -14,7 +14,7 @@ struct FdSink;
struct FdSource;
class RemoteStore : public StoreAPI
class RemoteStore : public Store
{
public:

View file

@ -220,7 +220,7 @@ Path computeStorePathForText(const string & name, const string & s,
/* Return a string accepted by decodeValidPathInfo() that
registers the specified paths as valid. Note: it's the
responsibility of the caller to provide a closure. */
string StoreAPI::makeValidityRegistration(const PathSet & paths,
string Store::makeValidityRegistration(const PathSet & paths,
bool showDerivers, bool showHash)
{
string s = "";
@ -284,7 +284,7 @@ string showPaths(const PathSet & paths)
}
void StoreAPI::exportPaths(const Paths & paths,
void Store::exportPaths(const Paths & paths,
bool sign, Sink & sink)
{
for (auto & i : paths) {
@ -306,7 +306,7 @@ void StoreAPI::exportPaths(const Paths & paths,
namespace nix {
ref<StoreAPI> openStore(bool reserveSpace)
ref<Store> openStore(bool reserveSpace)
{
enum { mDaemon, mLocal, mAuto } mode;
@ -322,8 +322,8 @@ ref<StoreAPI> openStore(bool reserveSpace)
}
return mode == mDaemon
? make_ref<StoreAPI, RemoteStore>()
: make_ref<StoreAPI, LocalStore>(reserveSpace);
? make_ref<Store, RemoteStore>()
: make_ref<Store, LocalStore>(reserveSpace);
}

View file

@ -135,11 +135,11 @@ struct BasicDerivation;
struct Derivation;
class StoreAPI
class Store
{
public:
virtual ~StoreAPI() { }
virtual ~Store() { }
/* Check whether a path is valid. */
virtual bool isValidPath(const Path & path) = 0;
@ -407,13 +407,13 @@ void removeTempRoots();
/* Register a permanent GC root. */
Path addPermRoot(ref<StoreAPI> store, const Path & storePath,
Path addPermRoot(ref<Store> store, const Path & storePath,
const Path & gcRoot, bool indirect, bool allowOutsideRootsDir = false);
/* Factory method: open the Nix database, either through the local or
remote implementation. */
ref<StoreAPI> openStore(bool reserveSpace = true);
ref<Store> openStore(bool reserveSpace = true);
/* Display a set of paths in human-readable form (i.e., between quotes