Generate a C# enum for every enum the catalog carries - #19
Merged
Merged
Conversation
MEOS states thirteen enums beside the error codes — `interpType`, `MeosType`, `tempSubtype`, `IndexSearchOp`, `SPTreeKind`, `MeosOper`, `spatialRel`, `SkipListType`, `nullHandleType`, `MeosPixType`, `COMPRESSIONS`, `ENDIANS`, `PC_FILTERTYPE` — and the catalog carries each with its members and their values. `objectgen.py` projects them into `MEOS.NET/Enums/`, one file each, so a caller names a MEOS constant where the C API takes an int and the values come from MEOS rather than from a transcription. The names are the ones MEOS gives: the type is its catalog name with an upper-case first letter (`interpType` reads `InterpType`, `MeosType` and `ENDIANS` stand), and a member is its constant PascalCased (`INTERP_NONE` reads `InterpNone`, `T_TFLOAT` reads `TTfloat`). The generator refuses an enum whose members would collide into one C# name. Four tests hold the values to MEOS itself: `meostype_name`, `interptype_name` and `tempsubtype_name` name back what the member names, and `interptype_from_string` reads a name back as its member. A value that drifted from MEOS names something else, or nothing. Two files in the library are written by hand, both of them the runtime substrate: the MEOS session lifecycle, and the error check every wrapper makes after a call. Everything else under `MEOS.NET/` is a projection of the catalog.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MEOS states thirteen enums beside the error codes —
interpType,MeosType,tempSubtype,IndexSearchOp,SPTreeKind,MeosOper,spatialRel,SkipListType,nullHandleType,MeosPixType,COMPRESSIONS,ENDIANS,PC_FILTERTYPE— and the catalog carries each with its members and theirvalues.
objectgen.pyprojects them intoMEOS.NET/Enums/, one file each, soa caller names a MEOS constant where the C API takes an int and the values
come from MEOS rather than from a transcription.
The names are the ones MEOS gives: the type is its catalog name with an
upper-case first letter (
interpTypereadsInterpType,MeosTypeandENDIANSstand), and a member is its constant PascalCased (INTERP_NONEreads
InterpNone,T_TFLOATreadsTTfloat). The generator refuses an enumwhose members would collide into one C# name.
Four tests hold the values to MEOS itself:
meostype_name,interptype_nameandtempsubtype_namename back what the member names, andinterptype_from_stringreads a name back as its member. A value that driftedfrom MEOS names something else, or nothing.
Two files in the library are written by hand, both of them the runtime
substrate: the MEOS session lifecycle, and the error check every wrapper makes
after a call. Everything else under
MEOS.NET/is a projection of thecatalog.