mirror of https://github.com/microsoft/vcpkg.git
write_all_lines() -> write_lines()
This commit is contained in:
parent
bd01f8ce83
commit
8abbce6361
|
|
@ -13,7 +13,7 @@ namespace vcpkg::Files
|
|||
virtual std::vector<fs::path> get_files_recursive(const fs::path& dir) const = 0;
|
||||
virtual std::vector<fs::path> get_files_non_recursive(const fs::path& dir) const = 0;
|
||||
|
||||
virtual void write_all_lines(const fs::path& file_path, const std::vector<std::string>& lines) = 0;
|
||||
virtual void write_lines(const fs::path& file_path, const std::vector<std::string>& lines) = 0;
|
||||
virtual void write_contents(const fs::path& file_path, const std::string& data) = 0;
|
||||
virtual void rename(const fs::path& oldpath, const fs::path& newpath) = 0;
|
||||
virtual bool remove(const fs::path& path) = 0;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace vcpkg::Commands::Install
|
|||
|
||||
std::sort(output.begin(), output.end());
|
||||
|
||||
fs.write_all_lines(paths.listfile_path(bpgh), output);
|
||||
fs.write_lines(paths.listfile_path(bpgh), output);
|
||||
}
|
||||
|
||||
static void remove_first_n_chars(std::vector<std::string>* strings, const size_t n)
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace vcpkg::Files
|
|||
return ret;
|
||||
}
|
||||
|
||||
virtual void write_all_lines(const fs::path & file_path, const std::vector<std::string>& lines) override
|
||||
virtual void write_lines(const fs::path & file_path, const std::vector<std::string>& lines) override
|
||||
{
|
||||
std::fstream output(file_path, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc);
|
||||
for (const std::string& line : lines)
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ namespace vcpkg
|
|||
|
||||
// Replace the listfile on disk
|
||||
const fs::path updated_listfile_path = listfile_path.generic_string() + "_updated";
|
||||
fs.write_all_lines(updated_listfile_path, *lines);
|
||||
fs.write_lines(updated_listfile_path, *lines);
|
||||
fs.rename(updated_listfile_path, listfile_path);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue