/* Copyright 2025, Michele "King_DuckZ" Santullo * This file is part of ducktorrent. * * Ducktorrent is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Ducktorrent is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with ducktorrent. If not, see . */ #pragma once #include #include #include #include #include namespace duck { typedef std::string_view TorrentStringType; typedef signed long long int TorrentIntType; class ParseError : public std::runtime_error { public: ParseError (const std::string& desc); ~ParseError() noexcept = default; }; struct TorrentValue : public boost::spirit::x3::variant< TorrentIntType, TorrentStringType, boost::spirit::x3::forward_ast< std::vector >, boost::spirit::x3::forward_ast< std::map > > { using base_type::base_type; using base_type::operator=; }; std::vector parse_torrent (std::string_view binary_data); } //namespace duck