Belofte version 2.1.9
A promising chess program using the UCI or Winboard interface
fen.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------+
2 * File: fen.h
3 * Project: part of belofte - A Promising Chess Program
4 * Author: yves
5 * SPDX-License-Identifier: GPL-2.0-only
6+----------------------------------------------------------------------*/
7
8#if !defined(FEN_H)
9#define FEN_H
10
11//-----------------------------------------------------------------------
12
13/** FEN string */
14class bFen {
15public:
16 bFen(bFen const& f)
17 : m_fen{f.m_fen}
18 {}
19 explicit bFen(std::string const& fs)
20 : m_fen{fs}
21 {}
22 explicit bFen(bFen&& f)
23 : m_fen{(f.operator std::string())}
24 {}
26 {}
27
28 // no copy or move ctor nor assignment defined
29 bFen& operator=(bFen const&) = delete;
30 bFen& operator=(bFen&&) = delete;
31
32 operator std::string() const&
33 { return const_cast<std::string const&>(m_fen); }
34
35private:
36 friend std::ostream& operator<<(std::ostream& os, bFen const& f);
37
38private:
39 std::string m_fen;
40};
41
42// --------------------------------------------------------------------
43
44#endif // defined FEN_H
45
46// eof
FEN string.
Definition fen.h:14
~bFen()
Definition fen.h:25
bFen(std::string const &fs)
Definition fen.h:19
bFen(bFen &&f)
Definition fen.h:22
bFen & operator=(bFen &&)=delete
operator std::string() const &
Definition fen.h:32
bFen(bFen const &f)
Definition fen.h:16
friend std::ostream & operator<<(std::ostream &os, bFen const &f)
Definition fen.cpp:12
bFen & operator=(bFen const &)=delete