herzbube / libsgfcplusplus

libsgfc++. A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
Apache License 2.0
12 stars 2 forks source link

How should the library deal with pre-FF4 properties? #21

Closed herzbube closed 3 years ago

herzbube commented 4 years ago

SGFC converts to FF4 automatically, and writes FF4 only. A case can be made from this that the library should only support FF4 properties.

What would this mean for the current implementation?

herzbube commented 4 years ago

SGFC has an enumeration token that contains the following elements that are not part of FF4:

TKN_CH, TKN_SI, TKN_BS, TKN_WS, TKN_ID, TKN_TC, TKN_OM, TKN_OP,
TKN_OV, TKN_LT, TKN_RG, TKN_SC, TKN_SE, TKN_EL, TKN_EX

Two elements are from FF1/FF2 but are not documented as such:

TKN_L
TKN_M

Four elements are from FF4 but are specific for game type Go:

TKN_HA
TKN_KM
TKN_TB
TKN_TW

One element is for a non-standard application-specific property:

TKN_KI
herzbube commented 3 years ago

SGFC performs the following conversions and passes on the converted properties to libsgfc++:

The other properties listed in the previous comment are not converted and passed on to libsgfc++ without change.

herzbube commented 3 years ago

Decision: libsgfc++ supports the same property set as SGFC, i.e. it continues to support pre-FF4 properties. Library clients that do not wish to see pre-FF4 properties can use SgfcArgumentType::DeleteObsoleteProperties when reading in SGF content.