#include <content-address.hh>
Public Types | |
enum struct | Raw { Flat , NixArchive , Git , Text } |
Public Member Functions | |
bool | operator== (const ContentAddressMethod &) const =default |
auto | operator<=> (const ContentAddressMethod &) const =default |
MAKE_WRAPPER_CONSTRUCTOR (ContentAddressMethod) | |
std::string_view | render () const |
std::string_view | renderPrefix () const |
std::string | renderWithAlgo (HashAlgorithm ha) const |
FileIngestionMethod | getFileIngestionMethod () const |
Static Public Member Functions | |
static ContentAddressMethod | parse (std::string_view rawCaMethod) |
static ContentAddressMethod | parsePrefix (std::string_view &m) |
static std::pair< ContentAddressMethod, HashAlgorithm > | parseWithAlgo (std::string_view rawCaMethod) |
Public Attributes | |
Raw | raw |
An enumeration of all the ways we can content-address store objects.
Just the type of a content address. Combine with the hash itself, and we have a ContentAddress
as defined below. Combine that, in turn, with info on references, and we have ContentAddressWithReferences
, as defined further below.
|
strong |
Enumerator | |
---|---|
Flat | Calculate a store path using the See |
NixArchive | Calculate a store path using the See |
Git | Calculate a store path using the Part of See |
Text | Calculate a store path using the See |
FileIngestionMethod nix::ContentAddressMethod::getFileIngestionMethod | ( | ) | const |
Get the underlying way to content-address file system objects.
Different ways of hashing store objects may use the same method for hashing file systeme objects.
|
static |
Parse a content addressing method (name).
The inverse of render
.
|
static |
Parse the prefix tag which indicates how the files were ingested, with the fixed output case not prefixed for back compat.
m | A string that should begin with the prefix. On return, the remainder of the string after the prefix. |
|
static |
Parse a content addressing method and hash algorithm.
std::string_view nix::ContentAddressMethod::render | ( | ) | const |
Render a content addressing method (name).
The inverse of parse
.
std::string_view nix::ContentAddressMethod::renderPrefix | ( | ) | const |
Render the prefix tag which indicates how the files wre ingested.
The rough inverse of parsePrefix()
.
std::string nix::ContentAddressMethod::renderWithAlgo | ( | HashAlgorithm | ha | ) | const |
Render a content addressing method and hash algorithm in a nicer way, prefixing both cases.
The rough inverse of parse()
.