|
Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
|
#include <source-path.hh>
Public Member Functions | |
| std::string | readFile () const |
| bool | pathExists () const |
| InputAccessor::Stat | lstat () const |
| std::optional< InputAccessor::Stat > | maybeLstat () const |
| InputAccessor::Stat | stat () const |
| std::optional< InputAccessor::Stat > | maybeStat () const |
| InputAccessor::DirEntries | readDirectory () const |
| std::string | readLink () const |
| void | dumpPath (Sink &sink, PathFilter &filter=defaultPathFilter) const |
| Public Member Functions inherited from nix::SourcePath | |
| SourcePath (CanonPath path) | |
| std::string_view | baseName () const |
| SourcePath | parent () const |
| const CanonPath & | canonical () const |
| std::string | to_string () const |
| CheckedSourcePath | unsafeIntoChecked () |
| SourcePath | operator+ (const CanonPath &x) const |
| SourcePath | operator+ (std::string_view c) const |
| bool | operator== (const SourcePath &x) const |
| bool | operator!= (const SourcePath &x) const |
| bool | operator< (const SourcePath &x) const |
Friends | |
| struct | SourcePath |
Additional Inherited Members | |
| Protected Attributes inherited from nix::SourcePath | |
| CanonPath | path |
An abstraction for accessing source files during evaluation. Currently, it's just a wrapper around CanonPath that accesses files in the regular filesystem, but in the future it will support fetching files in other ways.
|
inline |
Dump this SourcePath to sink as a NAR archive.
| InputAccessor::Stat nix::CheckedSourcePath::lstat | ( | ) | const |
Return stats about this SourcePath, or throw an exception if it doesn't exist.
| std::optional< InputAccessor::Stat > nix::CheckedSourcePath::maybeLstat | ( | ) | const |
Return stats about this SourcePath, or std::nullopt if it doesn't exist.
| std::optional< InputAccessor::Stat > nix::CheckedSourcePath::maybeStat | ( | ) | const |
Return stats about this SourcePath, or std::nullopt if it doesn't exist. Symlinks are resolved by this function.
|
inline |
Return whether this SourcePath denotes a file (of any type) that exists
| InputAccessor::DirEntries nix::CheckedSourcePath::readDirectory | ( | ) | const |
If this SourcePath denotes a directory (not a symlink), return its directory entries; otherwise throw an error.
|
inline |
If this SourcePath denotes a regular file (not a symlink), return its contents; otherwise throw an error.
|
inline |
If this SourcePath denotes a symlink, return its target; otherwise throw an error.
| InputAccessor::Stat nix::CheckedSourcePath::stat | ( | ) | const |
Return stats about this SourcePath, or throw an exception if it doesn't exist. Symlinks are resolved by this function.