Skip to content
API Documentation
BastionGuard™
anonymous_namespace{scanner_engine.cpp} Namespace Reference

Functions

void emit_progress (const ScannerEngine::ProgressCallback &cb, const std::string &stage, const std::string &detail, uint64_t processed, uint64_t total, double fraction)
bool check_cancel (const std::function< bool()> &cancel_cb)

Function Documentation

◆ check_cancel()

bool anonymous_namespace{scanner_engine.cpp}::check_cancel ( const std::function< bool()> & cancel_cb)

Definition at line 32 of file scanner_engine.cpp.

33 {
34 if (!cancel_cb) return false;
35 return cancel_cb();
36 }

References check_cancel().

Referenced by check_cancel().

◆ emit_progress()

void anonymous_namespace{scanner_engine.cpp}::emit_progress ( const ScannerEngine::ProgressCallback & cb,
const std::string & stage,
const std::string & detail,
uint64_t processed,
uint64_t total,
double fraction )

Definition at line 13 of file scanner_engine.cpp.

19 {
20 if (!cb) return;
21
22 ScanProgress progress;
23 progress.stage = stage;
24 progress.detail = detail;
25 progress.bytes_processed = processed;
26 progress.bytes_total = total;
27 progress.fraction = fraction;
28
29 cb(progress);
30 }
std::string stage
Definition models.hpp:30
std::string detail
Definition models.hpp:31
double fraction
Definition models.hpp:34
uint64_t bytes_total
Definition models.hpp:33
uint64_t bytes_processed
Definition models.hpp:32

References ScanProgress::bytes_processed, ScanProgress::bytes_total, ScanProgress::detail, emit_progress(), ScanProgress::fraction, and ScanProgress::stage.

Referenced by emit_progress().