File Scanner 1.0.0
A high-performance C++ malicious file scanner.
Loading...
Searching...
No Matches
csv_hash_database.h
Go to the documentation of this file.
1#ifndef SRC_SCANNER_LIB_CSV_HASH_DATABASE_H_
2#define SRC_SCANNER_LIB_CSV_HASH_DATABASE_H_
3
4#include <filesystem>
5#include <optional>
6#include <string>
7#include <unordered_map>
8
10
11namespace scanner {
12
23class CsvHashDatabase final : public IHashDatabase {
24public:
35 std::size_t Load(const std::filesystem::path& source_path) override;
36
44 std::optional<std::string> FindHash(const std::string& hash) const override;
45
46private:
47 std::unordered_map<std::string, std::string> signatures_;
48};
49
50} // namespace scanner
51
52#endif // SRC_SCANNER_LIB_CSV_HASH_DATABASE_H_
An implementation of IHashDatabase that loads signatures from a CSV file.
Definition csv_hash_database.h:23
std::size_t Load(const std::filesystem::path &source_path) override
Loads malicious signatures from a specified CSV file.
Definition csv_hash_database.cpp:25
std::unordered_map< std::string, std::string > signatures_
Definition csv_hash_database.h:47
std::optional< std::string > FindHash(const std::string &hash) const override
Looks up a hash in the loaded database.
Definition csv_hash_database.cpp:57
Defines the contract for a database of malicious signatures.
Definition interfaces.h:35
Definition domain.h:12