Update for receiveContents taking string_view

nix change: https://github.com/NixOS/nix/commit/faa31f40
This commit is contained in:
Orivej Desh 2020-12-26 11:23:26 +00:00
parent bde8d81876
commit 34a856c7ab

View file

@ -45,15 +45,15 @@ struct Extractor : ParseSink
hashSink = std::make_unique<HashSink>(htSHA256);
}
void receiveContents(unsigned char * data, size_t len) override
void receiveContents(std::string_view data) override
{
assert(expectedSize);
assert(curMember);
assert(hashSink);
*curMember->fileSize += len;
(*hashSink)(data, len);
*curMember->fileSize += data.size();
(*hashSink)(data);
if (curMember->contents) {
curMember->contents->append((char *) data, len);
curMember->contents->append(data);
}
assert(curMember->fileSize <= expectedSize);
if (curMember->fileSize == expectedSize) {