libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
LibSgfcPlusPlus::ISgfcDocument Class Referenceabstract

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>

Inheritance diagram for LibSgfcPlusPlus::ISgfcDocument:
LibSgfcPlusPlus::SgfcDocument

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< ISgfcGameGetGame () 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.
 

Detailed Description

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.

Member Function Documentation

◆ AppendGame()

virtual void LibSgfcPlusPlus::ISgfcDocument::AppendGame ( std::shared_ptr< ISgfcGame > game)
pure virtual

Adds game as the last game to the collection of games that together make up the document. game may not be nullptr.

Exceptions
std::invalid_argumentIs thrown if game is nullptr or if game is already in the collection.

Implemented in LibSgfcPlusPlus::SgfcDocument.

◆ DebugPrintToConsole()

virtual void LibSgfcPlusPlus::ISgfcDocument::DebugPrintToConsole ( ) const
pure virtual

Prints the content of the ISgfcDocument to stdout for debugging purposes.

Implemented in LibSgfcPlusPlus::SgfcDocument.

◆ GetGame()

virtual std::shared_ptr< ISgfcGame > LibSgfcPlusPlus::ISgfcDocument::GetGame ( ) const
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.

◆ GetGames()

virtual std::vector< std::shared_ptr< ISgfcGame > > LibSgfcPlusPlus::ISgfcDocument::GetGames ( ) const
pure virtual

Returns a collection of games that together make up the document.

Implemented in LibSgfcPlusPlus::SgfcDocument.

◆ IsEmpty()

virtual bool LibSgfcPlusPlus::ISgfcDocument::IsEmpty ( ) const
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.

◆ RemoveAllGames()

virtual void LibSgfcPlusPlus::ISgfcDocument::RemoveAllGames ( )
pure virtual

Removes all games from the collection of games that together make up the document.

Implemented in LibSgfcPlusPlus::SgfcDocument.

◆ RemoveGame()

virtual void LibSgfcPlusPlus::ISgfcDocument::RemoveGame ( std::shared_ptr< ISgfcGame > game)
pure virtual

Removes game from the collection of games that together make up the document.

Exceptions
std::invalid_argumentIs thrown if game is not part of the collection of games that together make up the document.

Implemented in LibSgfcPlusPlus::SgfcDocument.

◆ SetGames()

virtual void LibSgfcPlusPlus::ISgfcDocument::SetGames ( const std::vector< std::shared_ptr< ISgfcGame > > & games)
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.

Exceptions
std::invalid_argumentIs thrown if games contains a nullptr element, or if games contains duplicate elements.

Implemented in LibSgfcPlusPlus::SgfcDocument.


The documentation for this class was generated from the following files: