sapling/eden/fs/model/git/GitBlob.h
Adam Simpkins e7a8605e0d update deserializeGitBlob() to accept an IOBuf
Summary:
Update deserializeGitBlob() to work on an IOBuf, rather than an rvalue
reference to a string.

The ugliness about having to wrap a std::string in a managed IOBuf is now
hidden inside the StoreResult class, rather than being something that the
GitBlob code has to know about.

Reviewed By: bolinfest

Differential Revision: D3403977

fbshipit-source-id: 0c58c019557050d6e201c1a462fa051c2526674a
2016-06-08 19:01:14 -07:00

33 lines
693 B
C++

/*
* Copyright (c) 2016, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma once
#include <folly/Range.h>
namespace folly {
class IOBuf;
}
namespace facebook {
namespace eden {
class Hash;
class Blob;
/**
* Creates an Eden Blob from the serialized version of a Git blob object.
* As such, the SHA-1 of the gitBlobObject should match the hash.
*/
std::unique_ptr<Blob> deserializeGitBlob(
const Hash& hash,
const folly::IOBuf* data);
}
}