Skip to content
API Documentation
BastionGuard™
xdg-open.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#include <string>
23
25public:
26 static bool open_if_trusted(const std::string& url);
27 static bool open(const std::string& url, int argc, char** argv);
28
29private:
30 static std::string extract_domain(const std::string& url);
31 static bool is_trusted_domain(const std::string& domain);
32 static bool is_payment_domain(const std::string& domain);
33 static std::string clean_domain(const std::string& d);
34 static bool ends_with(const std::string& value, const std::string& suffix);
35};
36
static bool is_payment_domain(const std::string &domain)
Definition xdg-open.cpp:150
static bool is_trusted_domain(const std::string &domain)
Definition xdg-open.cpp:90
static bool ends_with(const std::string &value, const std::string &suffix)
Definition xdg-open.cpp:81
static std::string extract_domain(const std::string &url)
Definition xdg-open.cpp:68
static bool open(const std::string &url, int argc, char **argv)
static bool open_if_trusted(const std::string &url)
Definition xdg-open.cpp:37
static std::string clean_domain(const std::string &d)
Definition xdg-open.cpp:227