3#ifndef CPGN_H_KL_2020_06_11_
4#define CPGN_H_KL_2020_06_11_
13#include "ChessStepsChinese.h"
27 std::string GetTag(
const std::string &szTag);
28 int SetTag(
const std::string &szTag,
const std::string& szValue);
47 int SetEvent(
const char* pEvent);
53 const std::string&
GetSite()
const;
54 int SetSite(
const char* pSite);
61 int SetDate(
const time_t &t);
63 int parseDate(
const std::string& dateText);
64 std::string dateToString(
const time_t &t)
const;
71 int SetRound(
const char* pRound);
77 const std::string&
GetRed()
const;
78 int SetRed(
const char* pRed);
85 int SetBlack(
const char* pBlack);
92 int SetResult(
const char* pResult);
94 const std::string& GetFen()
const;
95 int SetFen(
const char* pFen);
97 const std::string& GetFormat()
const;
98 int SetFormat(
const char* pFormat);
100 int SetSteps(std::shared_ptr<CChessSteps> steps);
110 std::string m_Result;
112 std::string m_Format;
113 std::map<std::string, std::string> m_Tags;
115 std::shared_ptr<CChessSteps> m_pSteps;
Class to hold all information for the Portable Game Notation (PGN) of a single game.
std::string toString() const
Gets the game as PGN string.
const std::string & GetRed() const
Get the player(s) of the white pieces.
const std::string & GetRound() const
Get the playing round ordinal of the game.
const std::string & GetBlack() const
Get the player(s) of the black pieces.
const time_t & GetDate() const
Gets the date of the event.
int ParseString(const std::string szPgn)
解析 PGN
const std::string & GetResult() const
Gets the result of the game, if any.
const std::string & GetSite() const
Gets the location of the event.
const std::string & GetEvent() const
Gets the name of the tournament or match event.