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

The SgfcArgument class provides an implementation of the ISgfcArgument interface. See the interface header file for documentation. More...

#include <SgfcArgument.h>

Inheritance diagram for LibSgfcPlusPlus::SgfcArgument:
LibSgfcPlusPlus::ISgfcArgument

Public Member Functions

 SgfcArgument (SgfcArgumentType argumentType)
 Initializes a newly constructed SgfcArgument object with the type argumentType.
 
 SgfcArgument (SgfcArgumentType argumentType, int parameter)
 Initializes a newly constructed SgfcArgument object with the type argumentType and the integer type parameter parameter.
 
 SgfcArgument (SgfcArgumentType argumentType, std::string parameter)
 Initializes a newly constructed SgfcArgument object with the type argumentType and the string type parameter parameter.
 
 SgfcArgument (SgfcArgumentType argumentType, SgfcPropertyType parameter)
 Initializes a newly constructed SgfcArgument object with the type argumentType and the SgfcPropertyType parameter parameter.
 
 SgfcArgument (SgfcArgumentType argumentType, SgfcMessageID parameter)
 Initializes a newly constructed SgfcArgument object with the type argumentType and the SgfcMessageID parameter parameter.
 
virtual ~SgfcArgument ()
 Destroys and cleans up the SgfcArgument object.
 
virtual SgfcArgumentType GetArgumentType () const override
 Returns the argument type.
 
virtual bool HasIntegerTypeParameter () const override
 Returns true if the argument has an integer type parameter.
 
virtual int GetIntegerTypeParameter () const override
 Returns the argument's integer type parameter value. The return value is undefined if HasIntegerTypeParameter() returns false.
 
virtual bool HasStringTypeParameter () const override
 Returns true if the argument has a string type parameter.
 
virtual std::string GetStringTypeParameter () const override
 Returns the argument's string type parameter value. The return value is undefined if HasStringTypeParameter() returns false.
 
virtual bool HasPropertyTypeParameter () const override
 Returns true if the argument has an SgfcPropertyType parameter.
 
virtual SgfcPropertyType GetPropertyTypeParameter () const override
 Returns the argument's SgfcPropertyType parameter value. The return value is undefined if HasPropertyTypeParameter() returns false.
 
virtual bool HasMessageIDParameter () const override
 Returns true if the argument has an SgfcMessageID parameter.
 
virtual SgfcMessageID GetMessageIDParameter () const override
 Returns the argument's SgfcMessageID parameter value. The return value is undefined if HasMessageIDParameter() returns false.
 
virtual std::string ToString () const override
 Returns the argument as a string, exactly as it would be specified on the SGFC command line. Examples: -n, -b1, -yMA.
 
- Public Member Functions inherited from LibSgfcPlusPlus::ISgfcArgument
 ISgfcArgument ()
 Initializes a newly constructed ISgfcArgument object.
 
virtual ~ISgfcArgument ()
 Destroys and cleans up the ISgfcArgument object.
 

Detailed Description

The SgfcArgument class provides an implementation of the ISgfcArgument interface. See the interface header file for documentation.

Constructor & Destructor Documentation

◆ SgfcArgument() [1/5]

LibSgfcPlusPlus::SgfcArgument::SgfcArgument ( SgfcArgumentType argumentType)

Initializes a newly constructed SgfcArgument object with the type argumentType.

Exceptions
std::invalid_argumentis thrown if argumentType requires a parameter.

◆ SgfcArgument() [2/5]

LibSgfcPlusPlus::SgfcArgument::SgfcArgument ( SgfcArgumentType argumentType,
int parameter )

Initializes a newly constructed SgfcArgument object with the type argumentType and the integer type parameter parameter.

Exceptions
std::invalid_argumentis thrown if argumentType does not require an integer type parameter.

◆ SgfcArgument() [3/5]

LibSgfcPlusPlus::SgfcArgument::SgfcArgument ( SgfcArgumentType argumentType,
std::string parameter )

Initializes a newly constructed SgfcArgument object with the type argumentType and the string type parameter parameter.

Exceptions
std::invalid_argumentis thrown if argumentType does not require a string type parameter.

◆ SgfcArgument() [4/5]

LibSgfcPlusPlus::SgfcArgument::SgfcArgument ( SgfcArgumentType argumentType,
SgfcPropertyType parameter )

Initializes a newly constructed SgfcArgument object with the type argumentType and the SgfcPropertyType parameter parameter.

Exceptions
std::invalid_argumentis thrown if argumentType does not require an SgfcPropertyType parameter.

◆ SgfcArgument() [5/5]

LibSgfcPlusPlus::SgfcArgument::SgfcArgument ( SgfcArgumentType argumentType,
SgfcMessageID parameter )

Initializes a newly constructed SgfcArgument object with the type argumentType and the SgfcMessageID parameter parameter.

Exceptions
std::invalid_argumentis thrown if argumentType does not require an SgfcMessageID parameter, or if parameter is a message ID not known to SGFC (libsgfc++ message IDs with an underlying negative numeric value, or SgfcMessageID::UnknownSgfcMessageID).

Member Function Documentation

◆ GetArgumentType()

SgfcArgumentType LibSgfcPlusPlus::SgfcArgument::GetArgumentType ( ) const
overridevirtual

Returns the argument type.

Implements LibSgfcPlusPlus::ISgfcArgument.

◆ GetIntegerTypeParameter()

int LibSgfcPlusPlus::SgfcArgument::GetIntegerTypeParameter ( ) const
overridevirtual

Returns the argument's integer type parameter value. The return value is undefined if HasIntegerTypeParameter() returns false.

Implements LibSgfcPlusPlus::ISgfcArgument.

◆ GetMessageIDParameter()

SgfcMessageID LibSgfcPlusPlus::SgfcArgument::GetMessageIDParameter ( ) const
overridevirtual

Returns the argument's SgfcMessageID parameter value. The return value is undefined if HasMessageIDParameter() returns false.

Implements LibSgfcPlusPlus::ISgfcArgument.

◆ GetPropertyTypeParameter()

SgfcPropertyType LibSgfcPlusPlus::SgfcArgument::GetPropertyTypeParameter ( ) const
overridevirtual

Returns the argument's SgfcPropertyType parameter value. The return value is undefined if HasPropertyTypeParameter() returns false.

Implements LibSgfcPlusPlus::ISgfcArgument.

◆ GetStringTypeParameter()

std::string LibSgfcPlusPlus::SgfcArgument::GetStringTypeParameter ( ) const
overridevirtual

Returns the argument's string type parameter value. The return value is undefined if HasStringTypeParameter() returns false.

Implements LibSgfcPlusPlus::ISgfcArgument.

◆ HasIntegerTypeParameter()

bool LibSgfcPlusPlus::SgfcArgument::HasIntegerTypeParameter ( ) const
overridevirtual

Returns true if the argument has an integer type parameter.

Implements LibSgfcPlusPlus::ISgfcArgument.

◆ HasMessageIDParameter()

bool LibSgfcPlusPlus::SgfcArgument::HasMessageIDParameter ( ) const
overridevirtual

Returns true if the argument has an SgfcMessageID parameter.

Implements LibSgfcPlusPlus::ISgfcArgument.

◆ HasPropertyTypeParameter()

bool LibSgfcPlusPlus::SgfcArgument::HasPropertyTypeParameter ( ) const
overridevirtual

Returns true if the argument has an SgfcPropertyType parameter.

Implements LibSgfcPlusPlus::ISgfcArgument.

◆ HasStringTypeParameter()

bool LibSgfcPlusPlus::SgfcArgument::HasStringTypeParameter ( ) const
overridevirtual

Returns true if the argument has a string type parameter.

Implements LibSgfcPlusPlus::ISgfcArgument.

◆ ToString()

std::string LibSgfcPlusPlus::SgfcArgument::ToString ( ) const
overridevirtual

Returns the argument as a string, exactly as it would be specified on the SGFC command line. Examples: -n, -b1, -yMA.

Implements LibSgfcPlusPlus::ISgfcArgument.


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