libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
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, SgfcNodeTrait > | PropertyCategoryToNodeTraitMap |
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. | |
The SgfcPrivateConstants class is a container class for library-internal constants.
|
static |
Maps values from the enumeration SgfcArgumentType to command line options as defined by the SGFC documentation.
|
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.
|
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.
|
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.
|
static |
A composition of EscapeCharacterToken and ComposedValueSeparatorToken.
|
static |
A composition of EscapeCharacterToken and EscapeCharacterToken.
|
static |
A composition of EscapeCharacterToken and PropertyValueEndToken.
|
static |
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.