libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
The SgfcDocumentReadResult class provides an implementation of the ISgfcDocumentReadResult interface. See the interface header file for documentation. More...
#include <SgfcDocumentReadResult.h>
Public Member Functions | |
SgfcDocumentReadResult (std::shared_ptr< ISgfcMessage > invalidCommandLineReason) | |
Initializes a newly constructed SgfcDocumentReadResult object that encapsulates a read operation result consisting of a single message invalidCommandLineReason and an empty document. | |
SgfcDocumentReadResult (std::vector< std::shared_ptr< ISgfcMessage > > parseResult, std::shared_ptr< ISgfcDocument > document) | |
Initializes a newly constructed SgfcDocumentReadResult object that encapsulates a read operation result consisting of the collection of messages parseResult and the document document. | |
virtual | ~SgfcDocumentReadResult () |
Destroys and cleans up the SgfcDocumentReadResult object. | |
virtual SgfcExitCode | GetExitCode () const override |
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 override |
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 override |
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< ISgfcDocument > | GetDocument () const override |
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 override |
Prints the content of the ISgfcDocumentReadResult to stdout for debugging purposes. | |
Public Member Functions inherited from LibSgfcPlusPlus::ISgfcDocumentReadResult | |
ISgfcDocumentReadResult () | |
Initializes a newly constructed ISgfcDocumentReadResult object. | |
virtual | ~ISgfcDocumentReadResult () |
Destroys and cleans up the ISgfcDocumentReadResult object. | |
The SgfcDocumentReadResult class provides an implementation of the ISgfcDocumentReadResult interface. See the interface header file for documentation.
LibSgfcPlusPlus::SgfcDocumentReadResult::SgfcDocumentReadResult | ( | std::shared_ptr< ISgfcMessage > | invalidCommandLineReason | ) |
Initializes a newly constructed SgfcDocumentReadResult object that encapsulates a read operation result consisting of a single message invalidCommandLineReason and an empty document.
This constructor is intended to be used when the read operation failed due to invalid arguments passed to SGFC.
LibSgfcPlusPlus::SgfcDocumentReadResult::SgfcDocumentReadResult | ( | std::vector< std::shared_ptr< ISgfcMessage > > | parseResult, |
std::shared_ptr< ISgfcDocument > | document ) |
Initializes a newly constructed SgfcDocumentReadResult object that encapsulates a read operation result consisting of the collection of messages parseResult and the document document.
This constructor is intended to be used when the arguments passed to SGFC were valid. The read operation may still have failed due to other reasons.
|
overridevirtual |
Prints the content of the ISgfcDocumentReadResult to stdout for debugging purposes.
Implements LibSgfcPlusPlus::ISgfcDocumentReadResult.
|
overridevirtual |
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.
Implements LibSgfcPlusPlus::ISgfcDocumentReadResult.
|
overridevirtual |
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.
Implements LibSgfcPlusPlus::ISgfcDocumentReadResult.
|
overridevirtual |
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.
Implements LibSgfcPlusPlus::ISgfcDocumentReadResult.
|
overridevirtual |
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.
Implements LibSgfcPlusPlus::ISgfcDocumentReadResult.