applypatch: {Load,Save}FileContents and ParseSha1 take std::string.

Test: mmma -j bootable/recovery
Test: Run recovery_component_test on marlin.
Change-Id: Ifcf244346a88dac833d91b169a4c2aee1fe677f1
This commit is contained in:
Tao Bao
2018-06-20 10:14:40 -07:00
parent 859bfc5659
commit 8dc704930b
4 changed files with 19 additions and 18 deletions
+3 -3
View File
@@ -50,7 +50,7 @@ int CacheSizeCheck(size_t bytes);
// Parses a given string of 40 hex digits into 20-byte array 'digest'. 'str' may contain only the
// digest or be of the form "<digest>:<anything>". Returns 0 on success, or -1 on any error.
int ParseSha1(const char* str, uint8_t* digest);
int ParseSha1(const std::string& str, uint8_t* digest);
// Applies binary patches to eMMC target files in a way that is safe (the original file is not
// touched until we have the desired replacement for it) and idempotent (it's okay to run this
@@ -91,10 +91,10 @@ int applypatch_flash(const char* source_filename, const char* target_filename,
// Reads a file into memory; stores the file contents and associated metadata in *file. Returns 0
// on success, or -1 on error.
int LoadFileContents(const char* filename, FileContents* file);
int LoadFileContents(const std::string& filename, FileContents* file);
// Saves the given FileContents object to the given filename. Returns 0 on success, or -1 on error.
int SaveFileContents(const char* filename, const FileContents* file);
int SaveFileContents(const std::string& filename, const FileContents* file);
// bspatch.cpp