Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::LocalStoreAccessor Struct Reference
Inheritance diagram for nix::LocalStoreAccessor:
nix::PosixSourceAccessor nix::SourceAccessor

Public Member Functions

 LocalStoreAccessor (ref< LocalFSStore > store, bool requireValidPath)
 
CanonPath toRealPath (const CanonPath &path)
 
std::optional< StatmaybeLstat (const CanonPath &path) override
 
DirEntries readDirectory (const CanonPath &path) override
 
void readFile (const CanonPath &path, Sink &sink, std::function< void(uint64_t)> sizeCallback) override
 
std::string readLink (const CanonPath &path) override
 
- Public Member Functions inherited from nix::PosixSourceAccessor
 PosixSourceAccessor (std::filesystem::path &&root)
 
void readFile (const CanonPath &path, Sink &sink, std::function< void(uint64_t)> sizeCallback) override
 
bool pathExists (const CanonPath &path) override
 
std::optional< StatmaybeLstat (const CanonPath &path) override
 
DirEntries readDirectory (const CanonPath &path) override
 
std::string readLink (const CanonPath &path) override
 
std::optional< std::filesystem::path > getPhysicalPath (const CanonPath &path) override
 
- Public Member Functions inherited from nix::SourceAccessor
virtual std::string readFile (const CanonPath &path)
 
Stat lstat (const CanonPath &path)
 
virtual void dumpPath (const CanonPath &path, Sink &sink, PathFilter &filter=defaultPathFilter)
 
Hash hashPath (const CanonPath &path, PathFilter &filter=defaultPathFilter, HashAlgorithm ha=HashAlgorithm::SHA256)
 
bool operator== (const SourceAccessor &x) const
 
auto operator<=> (const SourceAccessor &x) const
 
void setPathDisplay (std::string displayPrefix, std::string displaySuffix="")
 
virtual std::string showPath (const CanonPath &path)
 
CanonPath resolveSymlinks (const CanonPath &path, SymlinkResolution mode=SymlinkResolution::Full)
 
virtual std::optional< time_t > getLastModified ()
 

Public Attributes

ref< LocalFSStorestore
 
bool requireValidPath
 
- Public Attributes inherited from nix::PosixSourceAccessor
const std::filesystem::path root
 
time_t mtime = 0
 
- Public Attributes inherited from nix::SourceAccessor
const size_t number
 
std::string displayPrefix
 
std::string displaySuffix
 
std::optional< std::string > fingerprint
 

Additional Inherited Members

- Public Types inherited from nix::SourceAccessor
enum  Type {
  tRegular , tSymlink , tDirectory , tChar ,
  tBlock , tSocket , tFifo , tUnknown
}
 
typedef std::optional< TypeDirEntry
 
typedef std::map< std::string, DirEntry > DirEntries
 
- Static Public Member Functions inherited from nix::PosixSourceAccessor
static SourcePath createAtRoot (const std::filesystem::path &path)
 

Member Function Documentation

◆ maybeLstat()

std::optional< Stat > nix::LocalStoreAccessor::maybeLstat ( const CanonPath & path)
inlineoverridevirtual

Implements nix::SourceAccessor.

◆ readDirectory()

DirEntries nix::LocalStoreAccessor::readDirectory ( const CanonPath & path)
inlineoverridevirtual
Note
Like readFile, this method should not follow symlinks.

Implements nix::SourceAccessor.

◆ readFile()

void nix::LocalStoreAccessor::readFile ( const CanonPath & path,
Sink & sink,
std::function< void(uint64_t)> sizeCallback )
inlineoverridevirtual

Write the contents of a file as a sink. sizeCallback must be called with the size of the file before any data is written to the sink.

Note
Like the other readFile, this method should not follow symlinks.
subclasses of SourceAccessor need to implement at least one of the readFile() variants.

Reimplemented from nix::SourceAccessor.

◆ readLink()

std::string nix::LocalStoreAccessor::readLink ( const CanonPath & path)
inlineoverridevirtual

Implements nix::SourceAccessor.


The documentation for this struct was generated from the following file: