libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
The ISgfcDocument interface provides access to a collection of SGF games. When you read an SGF file, the SGF data in that file becomes an ISgfcDocument. More...
#include <ISgfcDocument.h>
Public Member Functions | |
ISgfcDocument () | |
Initializes a newly constructed ISgfcDocument object. | |
virtual | ~ISgfcDocument () |
Destroys and cleans up the ISgfcDocument object. | |
virtual bool | IsEmpty () const =0 |
Returns true if the document has no content. Returns false if the document has some content. | |
virtual std::vector< std::shared_ptr< ISgfcGame > > | GetGames () const =0 |
Returns a collection of games that together make up the document. | |
virtual std::shared_ptr< ISgfcGame > | GetGame () const =0 |
Returns the first game from the collection of games that GetGames() returns. Returns nullptr if GetGames() returns an empty collection. | |
virtual void | SetGames (const std::vector< std::shared_ptr< ISgfcGame > > &games)=0 |
Sets the collection of games that together make up the document to games, replacing the previous collection. games may not contain nullptr. games may not contain duplicates. | |
virtual void | AppendGame (std::shared_ptr< ISgfcGame > game)=0 |
Adds game as the last game to the collection of games that together make up the document. game may not be nullptr. | |
virtual void | RemoveGame (std::shared_ptr< ISgfcGame > game)=0 |
Removes game from the collection of games that together make up the document. | |
virtual void | RemoveAllGames ()=0 |
Removes all games from the collection of games that together make up the document. | |
virtual void | DebugPrintToConsole () const =0 |
Prints the content of the ISgfcDocument to stdout for debugging purposes. | |
The ISgfcDocument interface provides access to a collection of SGF games. When you read an SGF file, the SGF data in that file becomes an ISgfcDocument.
|
pure virtual |
Adds game as the last game to the collection of games that together make up the document. game may not be nullptr.
std::invalid_argument | Is thrown if game is nullptr or if game is already in the collection. |
Implemented in LibSgfcPlusPlus::SgfcDocument.
|
pure virtual |
Prints the content of the ISgfcDocument to stdout for debugging purposes.
Implemented in LibSgfcPlusPlus::SgfcDocument.
|
pure virtual |
Returns the first game from the collection of games that GetGames() returns. Returns nullptr if GetGames() returns an empty collection.
This is a convenience method which simplifies the majority of cases where a document only contains a single game.
Implemented in LibSgfcPlusPlus::SgfcDocument.
|
pure virtual |
Returns a collection of games that together make up the document.
Implemented in LibSgfcPlusPlus::SgfcDocument.
|
pure virtual |
Returns true if the document has no content. Returns false if the document has some content.
The document is empty if it contains no games.
Implemented in LibSgfcPlusPlus::SgfcDocument.
|
pure virtual |
Removes all games from the collection of games that together make up the document.
Implemented in LibSgfcPlusPlus::SgfcDocument.
|
pure virtual |
Removes game from the collection of games that together make up the document.
std::invalid_argument | Is thrown if game is not part of the collection of games that together make up the document. |
Implemented in LibSgfcPlusPlus::SgfcDocument.
|
pure virtual |
Sets the collection of games that together make up the document to games, replacing the previous collection. games may not contain nullptr. games may not contain duplicates.
std::invalid_argument | Is thrown if games contains a nullptr element, or if games contains duplicate elements. |
Implemented in LibSgfcPlusPlus::SgfcDocument.