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::SgfcOptions Class Reference

The SgfcOptions class is used to capture a snapshot of the option values in an SGFCOptions struct, and to reconfigure an SGFCOptions struct with those captured values at a later time. More...

#include <SgfcOptions.h>

Public Member Functions

 SgfcOptions ()
 Initializes a newly constructed SgfcOptions object. The object holds default option values.
 
virtual ~SgfcOptions ()
 Destroys and cleans up the SgfcOptions object.
 
void CaptureOptions (const SGFCOptions *sourceOptions)
 Captures a snapshot of the option values in sourceOptions.
 
void RestoreOptions (SGFCOptions *targetOptions) const
 Reconfigures targetOptions with the option values that the SgfcOption object currently holds.
 

Detailed Description

The SgfcOptions class is used to capture a snapshot of the option values in an SGFCOptions struct, and to reconfigure an SGFCOptions struct with those captured values at a later time.

Some notes about the internal workings of SGFC:

Constructor & Destructor Documentation

◆ SgfcOptions()

LibSgfcPlusPlus::SgfcOptions::SgfcOptions ( )

Initializes a newly constructed SgfcOptions object. The object holds default option values.

Exceptions
std::runtime_errorIs thrown if SGFC fails to allocate memory.

Member Function Documentation

◆ RestoreOptions()

void LibSgfcPlusPlus::SgfcOptions::RestoreOptions ( SGFCOptions * targetOptions) const

Reconfigures targetOptions with the option values that the SgfcOption object currently holds.

If CaptureOptions() has never been invoked before, this applies default option values to targetOptions.

Attention
The members SGFCOptions::forced_encoding and SGFCOptions::default_encoding in targetOptions are configured with pointers into buffers that are valid only for a limited time. The pointers become invalid as soon as CaptureOptions is invoked the next time on the same SgfcOptions object, or when the SgfcOptions object is destroyed.

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