From fd78f92863361a3b25808f2ca988f820f2d35618 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sun, 23 Jan 2022 20:57:28 +0100 Subject: Create project --- src/pgnp.hpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/pgnp.hpp (limited to 'src/pgnp.hpp') diff --git a/src/pgnp.hpp b/src/pgnp.hpp new file mode 100644 index 0000000..25e74c8 --- /dev/null +++ b/src/pgnp.hpp @@ -0,0 +1,46 @@ +#include +#include +#include +#include +#include +#include + +namespace pgnp { + + + typedef struct HalfMove { + + } HalfMove; + + + class PGN { + private: + std::unordered_map tags; + HalfMove moves; + std::string pgn_content; + + public: + void FromFile(std::string); + void FromString(std::string); + + + private: + + /// @brief Populate @a tags with by parsing the one starting at location in argument + int ParseNextTag(int); + + /// @brief Get the next non-blank char location starting from location in argument + int NextNonBlank(int); + }; + + + + struct UnexpectedEOF : public std::exception + { + const char * what () const throw () + { + return "Unexpected end of pgn file"; + } + }; + +} -- cgit v1.2.3