File Scanner 1.0.0
A high-performance C++ malicious file scanner.
Loading...
Searching...
No Matches
scanner::ScannerBuilder Class Referencefinal

#include <scanner_builder.h>

Inheritance diagram for scanner::ScannerBuilder:
Inheritance graph
Collaboration diagram for scanner::ScannerBuilder:
Collaboration graph

Public Member Functions

IScannerBuilderWithCsvDatabase (const std::filesystem::path &path) override
 Configures the hash database from a CSV file.
 
IScannerBuilderWithFileLogger (const std::filesystem::path &path) override
 Configures the logger to write to a file.
 
IScannerBuilderWithMd5Hasher () override
 Configures the scanner to use an MD5 file hasher.
 
IScannerBuilderWithThreads (std::size_t num_threads) override
 Sets the number of threads for the scanner.
 
std::unique_ptr< IScannerBuild () override
 Builds the final IScanner instance.
 
- Public Member Functions inherited from scanner::IScannerBuilder
virtual ~IScannerBuilder ()=default
 

Private Attributes

std::unique_ptr< IHashDatabasedb_
 
std::unique_ptr< ILoggerlogger_
 
std::unique_ptr< IFileHasherhasher_
 
std::size_t num_threads_ = 0
 

Member Function Documentation

◆ Build()

std::unique_ptr< IScanner > scanner::ScannerBuilder::Build ( )
overridevirtual

Builds the final IScanner instance.

Returns
A unique pointer to the configured IScanner.
Exceptions
std::runtime_errorif dependencies are missing or fail to load.

Implements scanner::IScannerBuilder.

◆ WithCsvDatabase()

IScannerBuilder & scanner::ScannerBuilder::WithCsvDatabase ( const std::filesystem::path &  path)
overridevirtual

Configures the hash database from a CSV file.

Parameters
pathThe path to the CSV file.
Returns
A reference to this builder for chaining.

Implements scanner::IScannerBuilder.

◆ WithFileLogger()

IScannerBuilder & scanner::ScannerBuilder::WithFileLogger ( const std::filesystem::path &  path)
overridevirtual

Configures the logger to write to a file.

Parameters
pathThe path to the log file.
Returns
A reference to this builder for chaining.

Implements scanner::IScannerBuilder.

◆ WithMd5Hasher()

IScannerBuilder & scanner::ScannerBuilder::WithMd5Hasher ( )
overridevirtual

Configures the scanner to use an MD5 file hasher.

Returns
A reference to this builder for chaining.

Implements scanner::IScannerBuilder.

◆ WithThreads()

IScannerBuilder & scanner::ScannerBuilder::WithThreads ( std::size_t  num_threads)
overridevirtual

Sets the number of threads for the scanner.

Parameters
num_threadsThe number of threads to use.
Returns
A reference to this builder for chaining.

Implements scanner::IScannerBuilder.

Member Data Documentation

◆ db_

std::unique_ptr<IHashDatabase> scanner::ScannerBuilder::db_
private

◆ hasher_

std::unique_ptr<IFileHasher> scanner::ScannerBuilder::hasher_
private

◆ logger_

std::unique_ptr<ILogger> scanner::ScannerBuilder::logger_
private

◆ num_threads_

std::size_t scanner::ScannerBuilder::num_threads_ = 0
private

The documentation for this class was generated from the following files: