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::ISgfcDocumentReadResult Class Referenceabstract

The ISgfcDocumentReadResult interface provides access to the result of a read operation performed by ISgfcDocumentReader. More...

#include <ISgfcDocumentReadResult.h>

Inheritance diagram for LibSgfcPlusPlus::ISgfcDocumentReadResult:
LibSgfcPlusPlus::SgfcDocumentReadResult

Public Member Functions

 ISgfcDocumentReadResult ()
 Initializes a newly constructed ISgfcDocumentReadResult object.
 
virtual ~ISgfcDocumentReadResult ()
 Destroys and cleans up the ISgfcDocumentReadResult object.
 
virtual SgfcExitCode GetExitCode () const =0
 Returns an SgfcExitCode value that best fits the result of the read operation. The numeric value of the SgfcExitCode corresponds to one of the exit codes of SGFC.
 
virtual bool IsSgfDataValid () const =0
 Returns true if the SGF data that was loaded and parsed by the read operation is valid. Returns false if the SGF data is not valid.
 
virtual std::vector< std::shared_ptr< ISgfcMessage > > GetParseResult () const =0
 Returns a collection of ISgfcMessage objects which together form the parse result of the read operation. The messages appear in the order in which they were generated by SGFC. The collection is empty if the read operation did not generate any messages.
 
virtual std::shared_ptr< ISgfcDocumentGetDocument () const =0
 Returns the document object that provides access to the SGF data in structured form. If IsSgfDataValid() returns false the document object that is returned contains no data.
 
virtual void DebugPrintToConsole () const =0
 Prints the content of the ISgfcDocumentReadResult to stdout for debugging purposes.
 

Detailed Description

The ISgfcDocumentReadResult interface provides access to the result of a read operation performed by ISgfcDocumentReader.

ISgfcDocumentReadResult is immutable, i.e. once the ISgfcDocumentReadResult object is constructed it cannot be changed.

Member Function Documentation

◆ DebugPrintToConsole()

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

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

Implemented in LibSgfcPlusPlus::SgfcDocumentReadResult.

◆ GetDocument()

virtual std::shared_ptr< ISgfcDocument > LibSgfcPlusPlus::ISgfcDocumentReadResult::GetDocument ( ) const
pure virtual

Returns the document object that provides access to the SGF data in structured form. If IsSgfDataValid() returns false the document object that is returned contains no data.

Implemented in LibSgfcPlusPlus::SgfcDocumentReadResult.

◆ GetExitCode()

virtual SgfcExitCode LibSgfcPlusPlus::ISgfcDocumentReadResult::GetExitCode ( ) const
pure virtual

Returns an SgfcExitCode value that best fits the result of the read operation. The numeric value of the SgfcExitCode corresponds to one of the exit codes of SGFC.

Implemented in LibSgfcPlusPlus::SgfcDocumentReadResult.

◆ GetParseResult()

virtual std::vector< std::shared_ptr< ISgfcMessage > > LibSgfcPlusPlus::ISgfcDocumentReadResult::GetParseResult ( ) const
pure virtual

Returns a collection of ISgfcMessage objects which together form the parse result of the read operation. The messages appear in the order in which they were generated by SGFC. The collection is empty if the read operation did not generate any messages.

Implemented in LibSgfcPlusPlus::SgfcDocumentReadResult.

◆ IsSgfDataValid()

virtual bool LibSgfcPlusPlus::ISgfcDocumentReadResult::IsSgfDataValid ( ) const
pure virtual

Returns true if the SGF data that was loaded and parsed by the read operation is valid. Returns false if the SGF data is not valid.

The SGF data is considered valid if the read operation did not generate a fatal error. A fatal error shows up in the collection of ISgfcMessage objects that GetParseResult() returns, as an ISgfcMessage object with message type SgfcMessageType::FatalError.

Typical fatal errors are invalid arguments, or the SGF data could not be read e.g. because the specified SGF file does not exist.

Implemented in LibSgfcPlusPlus::SgfcDocumentReadResult.


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