Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
compression-algo.hh File Reference
#include "nix/util/error.hh"
#include <string_view>

Go to the source code of this file.

Macros

#define NIX_FOR_EACH_COMPRESSION_ALGO(MACRO)
#define NIX_DEFINE_COMPRESSION_ALGO(name, value)

Enumerations

enum class  CompressionAlgo { NIX_FOR_EACH_COMPRESSION_ALGO =(NIX_DEFINE_COMPRESSION_ALGO) }

Functions

CompressionAlgo nix::parseCompressionAlgo (std::string_view method, bool suggestions)
std::string nix::showCompressionAlgo (CompressionAlgo method)
 nix::MakeError (UnknownCompressionMethod, Error)

Macro Definition Documentation

◆ NIX_DEFINE_COMPRESSION_ALGO

#define NIX_DEFINE_COMPRESSION_ALGO ( name,
value )
Value:
value,

◆ NIX_FOR_EACH_COMPRESSION_ALGO

#define NIX_FOR_EACH_COMPRESSION_ALGO ( MACRO)
Value:
MACRO("none", none) \
MACRO("br", brotli) \
MACRO("bzip2", bzip2) \
MACRO("compress", compress) \
MACRO("grzip", grzip) \
MACRO("gzip", gzip) \
MACRO("lrzip", lrzip) \
MACRO("lz4", lz4) \
MACRO("lzip", lzip) \
MACRO("lzma", lzma) \
MACRO("lzop", lzop) \
MACRO("xz", xz) \
MACRO("zstd", zstd)

Function Documentation

◆ parseCompressionAlgo()

CompressionAlgo nix::parseCompressionAlgo ( std::string_view method,
bool suggestions = false )

Parses a compression method into the corresponding enum. This is only used in the compression case and user interface. Content-Encoding should not use these.

Parameters
suggestionsWhether to throw an exception with suggestions.