BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
MoveFormats.hpp
Go to the documentation of this file.
1/*
2 * ======================================================================================
3 *
4 * ░▒▓███████▓▒░░▒▓████████▓▒░▒▓███████▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░▒▓████████▓▒░
5 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
6 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
7 * ░▒▓███████▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
8 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
9 * ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
10 * ░▒▓███████▓▒░░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓█▓▒░
11 *
12 * ======================================================================================
13 */
14
20
21#pragma once
22
23#include <cstdint> // IWYU pragma: keep - for std::uint_least8_t
24#include <expected>
26#include <string>
27#include <string_view>
28
29namespace chess::game {
30struct Position;
31} // namespace chess::game
32
33namespace chess::notation {
34
35using game::Position;
36using moves::Move;
37
42enum class MoveFormat : std::uint_least8_t {
46};
47
52[[nodiscard]] auto format_move(
53 MoveFormat format,
54 const Position& position,
55 Move move,
56 bool algPieceTypeAsUTF8 = false) -> std::string;
57
62[[nodiscard]] auto parse_move(
63 MoveFormat format,
64 const Position& position,
65 std::string_view string)
66 -> std::expected<Move, std::string>;
67
68} // namespace chess::notation
auto parse_move(MoveFormat format, const Position &position, std::string_view string) -> std::expected< Move, std::string >
auto format_move(MoveFormat format, const Position &position, Move move, bool algPieceTypeAsUTF8=false) -> std::string
@ ICCF
ICCF numeric notation.
@ Algebraic
Algebraic notation.