Working proof of concept
This commit is contained in:
commit
3dcfcc7f0c
6 changed files with 394 additions and 0 deletions
23
src/parser.hpp
Normal file
23
src/parser.hpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include <string_view>
|
||||
#include <boost/spirit/home/x3/support/ast/variant.hpp>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace duck {
|
||||
typedef std::string_view TorrentStringType;
|
||||
|
||||
struct TorrentValue : public boost::spirit::x3::variant<
|
||||
long long,
|
||||
TorrentStringType,
|
||||
boost::spirit::x3::forward_ast< std::vector<TorrentValue> >,
|
||||
boost::spirit::x3::forward_ast< std::map<TorrentStringType, TorrentValue> >
|
||||
> {
|
||||
using base_type::base_type;
|
||||
using base_type::operator=;
|
||||
};
|
||||
|
||||
std::vector<TorrentValue> parse_torrent (std::string_view binary_data);
|
||||
|
||||
} //namespace duck
|
Loading…
Add table
Add a link
Reference in a new issue