libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
Loading...
Searching...
No Matches
List of all members
LibSgfcPlusPlus::SgfcPrivateConstants Class Reference

The SgfcPrivateConstants class is a container class for library-internal constants. More...

#include <SgfcPrivateConstants.h>

Static Public Attributes

General string constants
static const std::string EmptyString = ""
 The empty string.
 
static const std::string SpaceCharacter = " "
 A string consisting of a single space character.
 
static const char NewlineCharacter = '\n'
 A string consisting of a single newline character ("\n").
 
static const char CarriageReturnCharacter = '\r'
 A string consisting of a single newline character ("\r").
 
static const std::string IndentationWhitespace = " "
 A string consisting of a number of space characters thaht is used generate indentation in formatted output.
 
static const std::string EndOfLineStringUsedBySgfc = "\r\n"
 The line ending used by SGFC. Currently this is used by SGFC only when it writes SGF content. Currently SGFC does not use this when it writes messages with PrintError() - in that case it always uses SgfcPrivateConstants::NewlineCharacter.
 
Filesystem related constants
static const std::string DirectorySeparator = "/"
 This constant contains a platform-specific string that is used as the directory separator in filesystem paths.
 
static const std::string TempFilePrefix = "libsgfc++"
 The prefix used in names of temporary files created by the library.
 
static const std::string TempFileSuffix = "tmp"
 The suffix used in names of temporary files created by the library.
 
String constants defined by the SGF standard to structure the file format
static const std::string GameTreeBeginToken = "("
 The token that marks the beginning of a game tree.
 
static const std::string GameTreeEndToken = ")"
 The token that marks the end of a game tree.
 
static const std::string NodeBeginToken = ";"
 The token that marks the beginning of a node in a game tree.
 
static const std::string PropertyValueBeginToken = "["
 The token that marks the beginning of a property value.
 
static const std::string PropertyValueEndToken = "]"
 The token that marks the end of a property value.
 
static const std::string ComposedValueSeparatorToken = ":"
 The token that separates the first from the second value in a composed value.
 
static const std::string EscapeCharacterToken = "\\"
 The escape character.
 
static const std::string EscapedPropertyValueEndToken
 A composition of EscapeCharacterToken and PropertyValueEndToken.
 
static const std::string EscapedComposedValueSeparatorToken
 A composition of EscapeCharacterToken and ComposedValueSeparatorToken.
 
static const std::string EscapedEscapeCharacterToken
 A composition of EscapeCharacterToken and EscapeCharacterToken.
 
Regular expression constants
static const std::string LineEndingsPattern = "(\\r\\n|\\n\\r|\\n|\\r)"
 A regex pattern that matches the line endings on all platforms.
 
static const std::regex EscapedPropertyValueEndTokenRegex
 A regex with a pattern that matches EscapedPropertyValueEndToken.
 
static const std::regex EscapedComposedValueSeparatorTokenRegex
 A regex with a pattern that matches EscapedComposedValueSeparatorToken.
 
static const std::regex EscapedEscapeCharacterRegex
 A regex with a pattern that matches EscapedEscapeCharacterToken.
 
static const std::regex EscapedLineEndingsRegex
 A regex with a pattern that matches any of the line endings in LineEndingsPattern when it is escaped with EscapeCharacterToken.
 
static const std::regex UnescapedPropertyValueEndTokenRegex
 A regex with a pattern that matches PropertyValueEndToken.
 
static const std::regex UnescapedComposedValueSeparatorTokenRegex
 A regex with a pattern that matches ComposedValueSeparatorToken.
 
static const std::regex UnescapedEscapeCharacterRegex
 A regex with a pattern that matches EscapeCharacterToken.
 
static const std::regex UnescapedLineEndingsRegex
 A regex with a pattern that matches LineEndingsPattern.
 
static const std::regex ZeroOrMoreLineEndingsAtEndOfStringRegex
 A regex with a pattern that matches 0-n LineEndingsPattern at the end of the string.
 
static const std::regex GameResultRegex
 A regex with a pattern that matches the parts of an SgfcPropertyType::RE property value.
 
static const std::regex RoundInformationRegex
 A regex with a pattern that matches the parts of an SgfcPropertyType::RO property value.
 
static const std::regex GoPlayerRankRegex
 A regex with a pattern that matches the parts of an SgfcPropertyType::BR or SgfcPropertyType::WR property value.
 
Constants for strings that can appear in messages generated by SGFC
static const std::string LineToken = "Line:"
 The token that precedes the line number.
 
static const std::string ColumnToken = "Col:"
 The token that precedes the column number.
 
static const std::string DashToken = "-"
 The dash character ("-").
 
static const std::string WarningToken = "Warning"
 The token that marks a message to be of typw SgfcMessageType::Warning.
 
static const std::string ErrorUpperCaseToken = "Error"
 The token that marks a message to be of typw SgfcMessageType::Error (beginning with an uppercase letter).
 
static const std::string FatalToken = "Fatal"
 The token that marks a message to be of typw SgfcMessageType::FatalError.
 
static const std::string ErrorLowerCaseToken = "error"
 The token that marks a message to be of typw SgfcMessageType::Error (beginning with a lowercase letter).
 
static const std::string CriticalToken = "(critical):"
 The token that marks a message to be a critical message.
 
SGFC command line argument constants
static const std::map< SgfcArgumentType, std::string > ArgumentTypeToCmdlineOptionMap
 Maps values from the enumeration SgfcArgumentType to command line options as defined by the SGFC documentation.
 
static const int EncodingModeSingleEncoding = 1
 Parameter value for SgfcArgumentType::EncodingMode. Specifies that a single encoding is used to decode all game trees in the entire SGF content.
 
static const int EncodingModeMultipleEncodings = 2
 Parameter value for SgfcArgumentType::EncodingMode. Specifies that each game tree in the SGF content is decoded separately with the encoding specified in the game tree's CA property.
 
static const int EncodingModeNoDecoding = 3
 Parameter value for SgfcArgumentType::EncodingMode. Specifies that no decoding is to be done and that the SGF content is to be read as-is.
 
Constants for parsing messages generated by SGFC
static const SgfcMessageType DefaultMessageType = SgfcMessageType::FatalError
 The default message type to be used when the message type for some reason cannot be determined by parsing.
 
static const bool DefaultIsCriticalMessage = false
 The default message criticality to be used when the criticality for some reason cannot be determined by parsing.
 
static const std::string DefaultMessageText = SgfcPrivateConstants::EmptyString
 The default message text to be used when the text for some reason cannot be determined by parsing.
 
static const std::string DefaultRawMessageText = SgfcPrivateConstants::EmptyString
 The default raw message text to be used when the raw text for some reason cannot be determined by parsing.
 
Mappings between libsgfc++ values and SGF standard values, and vice versa
static const std::map< SgfcPropertyCategory, SgfcNodeTraitPropertyCategoryToNodeTraitMap
 Maps values from the enumeration SgfcPropertyCategory to values from the enumeration SgfcNodeTrait.
 
Other private constants
static const std::string TextEncodingNameUTF8 = "UTF-8"
 Name of the UTF-8 text encoding. This is used both as CA property value and to form SGFC command line arguments.
 

Detailed Description

The SgfcPrivateConstants class is a container class for library-internal constants.

Member Data Documentation

◆ ArgumentTypeToCmdlineOptionMap

const std::map< SgfcArgumentType, std::string > LibSgfcPlusPlus::SgfcPrivateConstants::ArgumentTypeToCmdlineOptionMap
static
Initial value:
=
{
{ SgfcArgumentType::DefaultEncoding, "--default-encoding" },
}
@ DisableWarningMessages
Disable all warning messages. The corresponding SGFC command line option is -w.
@ HardLineBreakMode
Select how to interpret line breaks when reading Text property values. This argument requires a numer...
@ ExpandCompressedPointLists
When writing SGF content, expand compressed point lists. This argument works only for games of type G...
@ ReverseVariationOrdering
Reverse ordering of variations. The corresponding SGFC command line option is -z.
@ DisableMessageID
Disable a given message ID. This argument requires an SgfcMessageID parameter value,...
@ DeleteUnknownProperties
Delete unknown properties, i.e. properties that are not part of FF1-FF4. The corresponding SGFC comma...
@ DeleteObsoleteProperties
Delete obsolete properties, i.e. properties that are not part of FF4. The corresponding SGFC command ...
@ CorrectVariationLevelAndRootMoves
Correct variation level and root moves. Variation level correction works only for games of type Go (G...
@ DeleteEmptyNodes
Delete empty nodes, i.e. nodes that contain no properties. The corresponding SGFC command line option...
@ NoSoftLineBreaksInTextValues
Do not insert soft line breaks into Text values. The corresponding SGFC command line option is -t.
@ BeginningOfSgfData
Select how to search for the beginning of SGF data. This argument requires a numeric parameter value ...
@ DeletePropertyType
Delete properties of a given property type. This argument requires an SgfcPropertyType parameter valu...
@ ForcedEncoding
Select the encoding to be used. This overrides even a CA property found in the SGF content....
@ LineBreakAtEndOfNode
When writing SGF content try to make each line end at the end of a node. The corresponding SGFC comma...
@ UseOldPassMoveNotation
Write pass moves as "[tt]" if possible. This argument works only for games of type Go (GM[1])....
@ EnableRestrictiveChecking
Enable restrictive checking. The corresponding SGFC command line option is -r.
@ EncodingMode
Select how to determine the character encoding(s) used to decode SGF content. This argument requires ...
@ DefaultEncoding
Select the default encoding to be used if the SGF content does not contain a CA property....
@ DeleteMarkupOnCurrentMove
Delete markup on current move. This argument works only for games of type Go (GM[1])....

Maps values from the enumeration SgfcArgumentType to command line options as defined by the SGFC documentation.

◆ EncodingModeMultipleEncodings

const int LibSgfcPlusPlus::SgfcPrivateConstants::EncodingModeMultipleEncodings = 2
static

Parameter value for SgfcArgumentType::EncodingMode. Specifies that each game tree in the SGF content is decoded separately with the encoding specified in the game tree's CA property.

The numeric value of this constant is 2.

◆ EncodingModeNoDecoding

const int LibSgfcPlusPlus::SgfcPrivateConstants::EncodingModeNoDecoding = 3
static

Parameter value for SgfcArgumentType::EncodingMode. Specifies that no decoding is to be done and that the SGF content is to be read as-is.

The numeric value of this constant is 3.

◆ EncodingModeSingleEncoding

const int LibSgfcPlusPlus::SgfcPrivateConstants::EncodingModeSingleEncoding = 1
static

Parameter value for SgfcArgumentType::EncodingMode. Specifies that a single encoding is used to decode all game trees in the entire SGF content.

The numeric value of this constant is 1.

◆ EscapedComposedValueSeparatorToken

const std::string LibSgfcPlusPlus::SgfcPrivateConstants::EscapedComposedValueSeparatorToken
static
Initial value:
=
static const std::string EscapeCharacterToken
The escape character.
Definition SgfcPrivateConstants.h:92
static const std::string ComposedValueSeparatorToken
The token that separates the first from the second value in a composed value.
Definition SgfcPrivateConstants.h:90

A composition of EscapeCharacterToken and ComposedValueSeparatorToken.

◆ EscapedEscapeCharacterToken

const std::string LibSgfcPlusPlus::SgfcPrivateConstants::EscapedEscapeCharacterToken
static
Initial value:

A composition of EscapeCharacterToken and EscapeCharacterToken.

◆ EscapedPropertyValueEndToken

const std::string LibSgfcPlusPlus::SgfcPrivateConstants::EscapedPropertyValueEndToken
static
Initial value:
=
static const std::string PropertyValueEndToken
The token that marks the end of a property value.
Definition SgfcPrivateConstants.h:87

A composition of EscapeCharacterToken and PropertyValueEndToken.

◆ PropertyCategoryToNodeTraitMap

const std::map< SgfcPropertyCategory, SgfcNodeTrait > LibSgfcPlusPlus::SgfcPrivateConstants::PropertyCategoryToNodeTraitMap
static
Initial value:
{
}
@ GameInfo
The node is a game info node. Game info nodes are nodes that contain one or more game info properties...
@ Move
The node is a move node. Move nodes are nodes that contain one or more move properties....
@ Setup
The node is a setup node. Setup nodes are nodes that contain one or more setup properties....
@ MoveAnnotation
The node contains one or more properties that are classified as SgfcPropertyCategory::MoveAnnotation.
@ NodeAnnotation
The node contains one or more properties that are classified as SgfcPropertyCategory::NodeAnnotation.
@ Timing
The node contains one or more properties that are classified as SgfcPropertyCategory::Timing.
@ Markup
The node contains one or more properties that are classified as SgfcPropertyCategory::Markup.
@ GameInfo
The property is a game info property. Game info properties provide some information about the game pl...
@ Move
The property is a move property. Move properties concentrate on the move made, not on the position ar...
@ Setup
The property is a setup property. Setup properties concentrate on the current position.
@ MoveAnnotation
The property in some way annotates the move that is contained in the same node as the property.
@ NodeAnnotation
The property in some way annotates the node that contains it.
@ Timing
The property provides a value related to timing.
@ Markup
The property in some way marks up one or more points.

Maps values from the enumeration SgfcPropertyCategory to values from the enumeration SgfcNodeTrait.

If a node contains one or more properties classified as a specific SgfcPropertyCategory then the node has the SgfcNodeTrait that is mapped to that SgfcPropertyCategory. For some SgfcPropertyCategory values there is no mapping. Because this use of the map is not overly intuitive it is not part of the public constants.


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