refactor: use std::function in filesystem_(extractor|writer)

This commit is contained in:
Marcus Holland-Moritz 2024-07-26 18:12:21 +02:00
parent dd72ef3f65
commit 42c0bc528a
2 changed files with 4 additions and 6 deletions

View File

@ -22,13 +22,12 @@
#pragma once #pragma once
#include <filesystem> #include <filesystem>
#include <functional>
#include <memory> #include <memory>
#include <ostream> #include <ostream>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <folly/Function.h>
namespace dwarfs { namespace dwarfs {
class filesystem_v2; class filesystem_v2;
@ -38,7 +37,7 @@ class os_access;
struct filesystem_extractor_options { struct filesystem_extractor_options {
size_t max_queued_bytes{4096}; size_t max_queued_bytes{4096};
bool continue_on_error{false}; bool continue_on_error{false};
folly::Function<void(std::string_view, uint64_t, uint64_t) const> progress; std::function<void(std::string_view, uint64_t, uint64_t)> progress;
}; };
class filesystem_extractor { class filesystem_extractor {

View File

@ -23,14 +23,13 @@
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include <functional>
#include <memory> #include <memory>
#include <ostream> #include <ostream>
#include <span> #include <span>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <folly/Function.h>
#include <dwarfs/compression_constraints.h> #include <dwarfs/compression_constraints.h>
#include <dwarfs/fragment_category.h> #include <dwarfs/fragment_category.h>
#include <dwarfs/fs_section.h> #include <dwarfs/fs_section.h>
@ -48,7 +47,7 @@ class worker_group;
class filesystem_writer { class filesystem_writer {
public: public:
using physical_block_cb_type = folly::Function<void(size_t)>; using physical_block_cb_type = std::function<void(size_t)>;
filesystem_writer( filesystem_writer(
std::ostream& os, logger& lgr, worker_group& wg, progress& prog, std::ostream& os, logger& lgr, worker_group& wg, progress& prog,