Notation helpers for positions and moves at movetext locations. More...
#include "scid/core/move.h"#include "scid/core/primitives.h"#include <cstddef>#include <optional>#include <string>
Include dependency graph for notation.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Namespaces | |
| namespace | scid |
| Public namespace for libscid. | |
| namespace | scid::core |
| Chess games, positions, movetext and notation. | |
Typedefs | |
| using | scid::core::sanStringT = char[SAN_STRING_SIZE] |
| Legacy fixed-size SAN buffer type. | |
| using | scid::core::sanFlagT = byte |
| Controls whether generated SAN includes check and mate suffix testing. | |
Functions | |
| std::string | scid::core::notation::currentPositionUci (const Game &game, MovetextLocation location) |
| Builds a UCI "position" command for the position at a game location. | |
| std::string | scid::core::notation::previousMoveUci (const Game &game, MovetextLocation location) |
| Returns the previous move at a location in UCI long algebraic notation. | |
| std::string | scid::core::notation::nextMoveUci (const Game &game, MovetextLocation location) |
| Returns the next move at a location in UCI long algebraic notation. | |
| std::string | scid::core::notation::previousSan (const Game &game, MovetextLocation location) |
| Returns the SAN text of the previous move at a location. | |
| std::string | scid::core::notation::nextSan (const Game &game, MovetextLocation location) |
| Returns the SAN text of the next move at a location. | |
| std::string | scid::core::notation::partialMoveList (const Game &game, std::size_t plyCount) |
Formats the first plyCount mainline half-moves as compact SAN text. | |
Variables | |
| constexpr std::size_t | scid::core::SAN_STRING_SIZE = 10 |
| Maximum storage size for legacy fixed-size SAN buffers. | |
| constexpr sanFlagT | scid::core::SAN_NO_CHECKTEST = 0 |
| Generate SAN without checking for check or mate suffixes. | |
| constexpr sanFlagT | scid::core::SAN_CHECKTEST = 1 |
| Generate SAN with check suffix testing. | |
| constexpr sanFlagT | scid::core::SAN_MATETEST = 2 |
| Generate SAN with mate suffix testing. | |
| constexpr std::size_t | scid::core::UCI_MOVE_STRING_SIZE = 6 |
| Maximum storage size for legacy fixed-size UCI move buffers. | |
Notation helpers for positions and moves at movetext locations.
| std::string scid::core::notation::currentPositionUci | ( | const Game & | game, |
| MovetextLocation | location | ||
| ) |
Builds a UCI "position" command for the position at a game location.
Standard-start games are emitted as position startpos followed by the moves from the current effective start. Non-standard starts and positions after null moves are emitted from an explicit FEN.
| std::string scid::core::notation::nextMoveUci | ( | const Game & | game, |
| MovetextLocation | location | ||
| ) |
Returns the next move at a location in UCI long algebraic notation.
| std::string scid::core::notation::nextSan | ( | const Game & | game, |
| MovetextLocation | location | ||
| ) |
Returns the SAN text of the next move at a location.
Stored SAN is preferred when available; otherwise it is generated from the current position.
| std::string scid::core::notation::previousMoveUci | ( | const Game & | game, |
| MovetextLocation | location | ||
| ) |
Returns the previous move at a location in UCI long algebraic notation.
| std::string scid::core::notation::previousSan | ( | const Game & | game, |
| MovetextLocation | location | ||
| ) |
Returns the SAN text of the previous move at a location.
Stored SAN is preferred when available; otherwise it is generated from the preceding position.