BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
EPD.hpp
Go to the documentation of this file.
1/*
2 * ======================================================================================
3 *
4 * ░▒▓███████▓▒░░▒▓████████▓▒░▒▓███████▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░▒▓████████▓▒░
5 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
6 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
7 * ░▒▓███████▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
8 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
9 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
10 * ░▒▓███████▓▒░░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓█▓▒░
11 *
12 * ======================================================================================
13 */
14
19
20#pragma once
21
22#include <expected>
24#include <string>
25#include <string_view>
26#include <unordered_map>
27#include <vector>
28
29namespace chess::notation {
30
31using game::Position;
32using std::string;
33
38struct [[nodiscard]] EPDPosition final {
41
45 std::unordered_map<string, string> operations;
46
50 [[nodiscard]] auto operator==(const EPDPosition& other) const noexcept -> bool = default;
51};
52
61[[nodiscard]] auto from_epd(std::string_view epdString)
62 -> std::expected<EPDPosition, string>;
63
70[[nodiscard]] auto parse_all_epds(std::string_view fileContent)
71 -> std::vector<EPDPosition>;
72
78[[nodiscard]] auto to_epd(const EPDPosition& pos) -> string;
79
80} // namespace chess::notation
auto parse_all_epds(std::string_view fileContent) -> std::vector< EPDPosition >
auto to_epd(const EPDPosition &pos) -> string
auto from_epd(std::string_view epdString) -> std::expected< EPDPosition, string >
std::unordered_map< string, string > operations
Definition EPD.hpp:45
auto operator==(const EPDPosition &other) const noexcept -> bool=default