libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
The SgfcPlusPlusFactory class is a class that contains only static functions. The functions are used to construct various library objects. More...
#include <SgfcPlusPlusFactory.h>
Static Public Member Functions | |
static std::shared_ptr< ISgfcArguments > | CreateSgfcArguments () |
Returns a newly constructed ISgfcArguments object that initially contains no arguments. Use the ISgfcArguments object's add methods to populate it with arguments. | |
static std::shared_ptr< ISgfcCommandLine > | CreateSgfcCommandLine (std::shared_ptr< ISgfcArguments > arguments) |
Returns a newly constructed ISgfcCommandLine object that passes the specified command line arguments to SGFC. | |
static std::shared_ptr< ISgfcCommandLine > | CreateSgfcCommandLine () |
Returns a newly constructed ISgfcCommandLine object that passes no command line arguments to SGFC. | |
static std::shared_ptr< ISgfcDocumentReader > | CreateDocumentReader () |
Returns a newly constructed ISgfcDocumentReader object. | |
static std::shared_ptr< ISgfcDocumentWriter > | CreateDocumentWriter () |
Returns a newly constructed ISgfcDocumentWriter object. | |
static std::shared_ptr< ISgfcDocument > | CreateDocument () |
Returns a newly constructed ISgfcDocument object. The ISgfcDocument content consists of a single ISgfcGame object with an empty root node. | |
static std::shared_ptr< ISgfcDocument > | CreateDocument (std::shared_ptr< ISgfcGame > game) |
Returns a newly constructed ISgfcDocument object. The ISgfcDocument content consists of the specified game game. The ISgfcDocument object takes ownership of game. | |
static std::shared_ptr< ISgfcGame > | CreateGame () |
Returns a newly constructed ISgfcGame object. The game type is SgfcConstants::DefaultGameType. The game is not associated with any document. The game has a game tree that consists of an empty root node. | |
static std::shared_ptr< ISgfcGame > | CreateGame (std::shared_ptr< ISgfcNode > rootNode) |
Returns a newly constructed ISgfcGame object. The game tree's root node is rootNode. The game type depends on the content of the root node. The game is not associated with any document. The ISgfcGame object takes ownership of rootNode. | |
static std::shared_ptr< ISgfcNode > | CreateNode () |
Returns a newly constructed ISgfcNode object that has no parent, child or sibling and is not associated with any game. | |
static std::shared_ptr< ISgfcGoGameInfo > | CreateGameInfo () |
Returns a newly constructed ISgfcGoGameInfo object with default values. | |
static std::shared_ptr< ISgfcGameInfo > | CreateGameInfo (std::shared_ptr< ISgfcNode > rootNode) |
Initializes a newly constructed ISgfcGameInfo object with values taken from the properties in root node rootNode. All values that would normally be taken from the properties in the game info node have default values. | |
static std::shared_ptr< ISgfcGameInfo > | CreateGameInfo (std::shared_ptr< ISgfcNode > rootNode, std::shared_ptr< ISgfcNode > gameInfoNode) |
Returns a newly constructed ISgfcGameInfo object with values taken from the content of root node rootNode and from game info node gameInfoNode. | |
static std::shared_ptr< ISgfcPropertyFactory > | CreatePropertyFactory () |
Returns a newly constructed ISgfcPropertyFactory object that can be used to create ISgfcProperty objects, and objects of every known sub-type of ISgfcProperty. | |
static std::shared_ptr< ISgfcPropertyValueFactory > | CreatePropertyValueFactory () |
Returns a newly constructed ISgfcPropertyValueFactory object that can be used to create ISgfcPropertyValue objects, and objects of every known sub-type of ISgfcPropertyValue. | |
The SgfcPlusPlusFactory class is a class that contains only static functions. The functions are used to construct various library objects.
|
static |
Returns a newly constructed ISgfcDocument object. The ISgfcDocument content consists of the specified game game. The ISgfcDocument object takes ownership of game.
std::invalid_argument | Is thrown if game is nullptr. |
|
static |
Returns a newly constructed ISgfcGame object. The game tree's root node is rootNode. The game type depends on the content of the root node. The game is not associated with any document. The ISgfcGame object takes ownership of rootNode.
std::invalid_argument | Is thrown if rootNode is nullptr. |
|
static |
Initializes a newly constructed ISgfcGameInfo object with values taken from the properties in root node rootNode. All values that would normally be taken from the properties in the game info node have default values.
If the content of rootNode indicates that the game type is SgfcGameType::Go then the returned object is an ISgfcGoGameInfo object. The game type is SgfcGameType::Go in the following cases:
std::invalid_argument | Is thrown if rootNode is nullptr. |
|
static |
Returns a newly constructed ISgfcGameInfo object with values taken from the content of root node rootNode and from game info node gameInfoNode.
If the content in rootNode indicates that the game type is SgfcGameType::Go then the returned object is an ISgfcGoGameInfo object. The game type is SgfcGameType::Go in the following cases:
std::invalid_argument | Is thrown if rootNode is nullptr or if gameInfoNode is nullptr. |
|
static |
Returns a newly constructed ISgfcCommandLine object that passes the specified command line arguments to SGFC.
arguments | The command line arguments to pass to SGFC. Invoke the ISgfcCommandLine::IsCommandLineValid() method on the resulting object to find out whether the arguments are valid. |