SlHelpers
Toggle main menu visibility
Loading...
Searching...
No Matches
CVE2Bugzilla.h
1
// SPDX-License-Identifier: GPL-2.0-only
2
3
#pragma once
4
5
#include <filesystem>
6
#include <optional>
7
#include <unordered_map>
8
#include <string>
9
10
#include "../helpers/String.h"
11
12
namespace
SlCVEs {
13
17
class
CVE2Bugzilla {
18
public
:
20
using
Map
= std::unordered_map<std::string, std::string,
SlHelpers::String::Hash
,
21
SlHelpers::String::Eq
>;
22
23
CVE2Bugzilla() =
delete
;
24
30
static
std::optional<CVE2Bugzilla>
create
(
const
std::filesystem::path &cve2bugzilla)
noexcept
;
31
37
std::string
get_bsc
(std::string_view cve_number)
const
;
38
44
std::string
get_cve
(std::string_view bsc_number)
const
;
45
private
:
46
CVE2Bugzilla(
Map
cve_bsc_map,
Map
bsc_cve_map) :
47
m_cve_bsc_map(std::move(cve_bsc_map)),
48
m_bsc_cve_map(std::move(bsc_cve_map)) {}
49
50
Map
m_cve_bsc_map;
51
Map
m_bsc_cve_map;
52
};
53
54
}
SlCVEs::CVE2Bugzilla::get_cve
std::string get_cve(std::string_view bsc_number) const
Get CVE number for a bugzilla.
SlCVEs::CVE2Bugzilla::get_bsc
std::string get_bsc(std::string_view cve_number) const
Get bugzilla number for a CVE.
SlCVEs::CVE2Bugzilla::Map
std::unordered_map< std::string, std::string, SlHelpers::String::Hash, SlHelpers::String::Eq > Map
CVE -> Bugzilla mapping.
Definition
CVE2Bugzilla.h:20
SlCVEs::CVE2Bugzilla::create
static std::optional< CVE2Bugzilla > create(const std::filesystem::path &cve2bugzilla) noexcept
Create a new CVE2Bugzilla map from cve2bugzilla.
SlHelpers::String::Eq
Equality test for string and string_view to be used in containers.
Definition
String.h:250
SlHelpers::String::Hash
Hash for string and string_view to be used in hashing containers.
Definition
String.h:223
include
cves
CVE2Bugzilla.h
Generated by
1.17.0