The Zorba API defines Zorba_SerializerOptions, which contains values for all known serialization parameters (and typedefs enums for all legal values for those parameters). It also contains a method to convert string parameters/values appropriately.
The Zorba serializer (src/api/serialization/serializer.cpp) does not use this class, however. It defines an entirely redundant set of variables and enums for all these values, and an entirely redundant method to convert parameter/value strings. Then, there is src/api/serializerimpl.cpp, which contains methods to convert between those enums, but also ludicrously contains setSerializationParameters() which converts Zorba_SerializerOptions to internal serializer values by turning the enum values back into string parameter/value pairs and passing them to the internal serializer. This is a great deal of wasted code, and it makes adding new serialization parameters a nightmare.
When changing this, please keep the following two things in mind:
- The Zorba_Serialize rOptions are also used in the C API.
- The encodings parameter should be an arbitrary string to allow for more encodings than utf8 and utf816.