Skip to content
API Documentation
BastionGuard™
ArchiveResult.hpp
Go to the documentation of this file.
1/*
2 * BastionGuard™
3 * Copyright (C) 2025–2026 Calogero Scarnà
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 *
17 * BastionGuard™ is a trademark of Calogero Scarnà.
18 * The BastionGuard™ name and branding are not licensed under the GPL.
19 */
20
21#pragma once
22
23#include <string>
24
31
32inline const char* archiveRiskToString(ArchiveRisk risk) {
33 switch (risk) {
34 case ArchiveRisk::CLEAN: return "CLEAN";
35 case ArchiveRisk::SUSPICIOUS: return "SUSPICIOUS";
36 case ArchiveRisk::MALFORMED: return "MALFORMED";
37 case ArchiveRisk::EVASIVE: return "EVASIVE";
38 default: return "UNKNOWN";
39 }
40}
41
43 bool success = false;
44 bool sandbox_timeout = false;
45 bool sandbox_failed = false;
46
47 bool is_zip = false;
48
50 bool header_mismatch = false;
51 bool invalid_offset = false;
52 bool overlapping_entries = false;
53 bool nested_archive = false;
54
55 int risk_score = 0;
57
58 std::string reason_code;
59 std::string detail;
60 std::string raw_json;
61};
ArchiveRisk
const char * archiveRiskToString(ArchiveRisk risk)