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

Classes

struct  Submodule
 

Public Member Functions

 GitSourceAccessor (ref< GitRepoImpl > repo_, const Hash &rev)
 
std::string readBlob (const CanonPath &path, bool symlink)
 
std::string readFile (const CanonPath &path) 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< HashgetSubmoduleRev (const CanonPath &path)
 
git_tree_entry * lookup (const CanonPath &path)
 
std::optional< Tree > lookupTree (const CanonPath &path)
 
git_tree_entry * need (const CanonPath &path)
 
std::variant< Tree, SubmodulegetTree (const CanonPath &path)
 
Blob getBlob (const CanonPath &path, bool expectSymlink)
 
- Public Member Functions inherited from nix::SourceAccessor
virtual void readFile (const CanonPath &path, Sink &sink, std::function< void(uint64_t)> sizeCallback=[](uint64_t size){})
 
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)
 
virtual std::optional< std::filesystem::path > getPhysicalPath (const CanonPath &path)
 
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< GitRepoImplrepo
 
Object root
 
std::unordered_map< CanonPath, TreeEntrylookupCache
 
- 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
 

Detailed Description

Raw git tree input accessor.

Member Function Documentation

◆ getSubmoduleRev()

std::optional< Hash > nix::GitSourceAccessor::getSubmoduleRev ( const CanonPath & path)
inline

If path exists and is a submodule, return its revision. Otherwise return nothing.

◆ maybeLstat()

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

Implements nix::SourceAccessor.

◆ pathExists()

bool nix::GitSourceAccessor::pathExists ( const CanonPath & path)
inlineoverridevirtual

Reimplemented from nix::SourceAccessor.

◆ readDirectory()

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

Implements nix::SourceAccessor.

◆ readFile()

std::string nix::GitSourceAccessor::readFile ( const CanonPath & path)
inlineoverridevirtual

Return the contents of a file as a string.

Note
Unlike Unix, this method should not follow symlinks. Nix by default wants to manipulate symlinks explicitly, and not implictly follow them, as they are frequently untrusted user data and thus may point to arbitrary locations. Acting on the targets targets of symlinks should only occasionally be done, and only with care.

Reimplemented from nix::SourceAccessor.

◆ readLink()

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

Implements nix::SourceAccessor.


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