aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/compression.hh
AgeCommit message (Collapse)Author
2024-07-11libutil: remove makeDecompressionSinkeldritch horrors
the sole remaining user of this function can use makeDecompressionSource instead, while making the sinkToSource in the caller unnecessary as well Change-Id: I4258227b5dbbb735a75b477d8a57007bfca305e9
2024-06-19libutil: add makeDecompressionSourceeldritch horrors
Change-Id: Iac7f24d79e24417436b9b5cbefd6af051aeea0a6
2023-04-07Rename and protect `BufferedSink::write`Théophane Hufschmitt
The `write` name is ambiguous and could lead to some funny bugs like https://github.com/NixOS/nix/pull/8173#issuecomment-1500009480. So rename it to the more explicit `writeUnbuffered`. Besides, this method shouldn't be (and isn't) used outside of the class implementation, so mark it `protected`. This makes it more symetrical to `BufferedSource` which uses a `protected readUnbuffered` method.
2023-03-31Ensure all headers have `#pragma once` and are in API docsJohn Ericson
`///@file` makes them show up in the internal API dos. A tiny few were missing `#pragma once`.
2022-01-18Get rid of std::shared_ptr<std::string> and ref<std::string>Eelco Dolstra
These were needed back in the pre-C++11 era because we didn't have move semantics. But now we do.
2021-10-12Add compression level for NARsTom Bereknyei
Based off on @dtzWill's #2276
2021-04-22Remove makeDecompressionSource()Eelco Dolstra
This function doesn't support all compression methods (i.e. 'none' and 'br') so it shouldn't be exposed. Also restore the original decompress() as a wrapper around makeDecompressionSink().
2021-04-15Drop libbz2 / zlib / lzma dependency + style fixesEelco Dolstra
2021-03-10Use libarchive for all compressionYorick van Pelt
2018-08-06Fix Brotli decompression in 'nix log'Eelco Dolstra
This didn't work anymore since decompression was only done in the non-coroutine case. Decompressors are now sinks, just like compressors. Also fixed a bug in bzip2 API handling (we have to handle BZ_RUN_OK rather than BZ_OK), which we didn't notice because there was a missing 'throw': if (ret != BZ_OK) CompressionError("error while compressing bzip2 file");
2018-03-16decompress(): Use a Source and SinkEelco Dolstra
This allows decompression to happen in O(1) memory.
2018-02-07make multi threaded compression configurable and use single threadedAmineChikhaoui
by default.
2017-03-21LocalFSStore::getBuildLog(): Handle corrupted logsEelco Dolstra
2016-05-04Do compression in a sinkEelco Dolstra
2016-05-04Add a Store::addToStore() variant that accepts a NAREelco Dolstra
As a side effect, this ensures that signatures are propagated when copying paths between stores. Also refactored import/export to make use of this.
2016-04-29BinaryCacheStore: Support "none" compression methodEelco Dolstra
2016-04-15BinaryCacheStore::readFile(): Return a shared_ptr to a stringEelco Dolstra
This allows readFile() to indicate that a file doesn't exist, and might eliminate some large string copying.
2016-02-15Add xz compression functionEelco Dolstra
This is used by the Hydra queue runner, but since it may also be useful for the C++ rewrite of nix-push, I'm putting it here.
2015-10-30<nix/fetchurl.nix>: Support xz-compressed NARsEelco Dolstra