1 // Copyright 2017 The Chromium OS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "bsdiff/patch_writer_factory.h" 6 7 #include "bsdiff/endsley_patch_writer.h" 8 #include "bsdiff/patch_writer.h" 9 10 namespace bsdiff { 11 12 std::unique_ptr<PatchWriterInterface> CreateBsdiffPatchWriter( 13 const std::string& patch_filename) { 14 return std::unique_ptr<PatchWriterInterface>( 15 new BsdiffPatchWriter(patch_filename)); 16 } 17 18 std::unique_ptr<PatchWriterInterface> CreateBSDF2PatchWriter( 19 const std::string& patch_filename, 20 CompressorType type, 21 int quality) { 22 return std::unique_ptr<PatchWriterInterface>( 23 new BsdiffPatchWriter(patch_filename, type, quality)); 24 } 25 26 std::unique_ptr<PatchWriterInterface> CreateEndsleyPatchWriter( 27 std::vector<uint8_t>* patch, 28 CompressorType type, 29 int quality) { 30 return std::unique_ptr<PatchWriterInterface>( 31 new EndsleyPatchWriter(patch, type, quality)); 32 } 33 34 std::unique_ptr<PatchWriterInterface> CreateEndsleyPatchWriter( 35 std::vector<uint8_t>* patch) { 36 return std::unique_ptr<PatchWriterInterface>( 37 new EndsleyPatchWriter(patch, CompressorType::kNoCompression, 0)); 38 } 39 40 } // namespace bsdiff 41