Find List of Options for given dictionary key programmatically
So I'm working on a vim plugin for OpenFOAM that will hopefully provide some completion help.
To do that, I need a list of possible options for a given dictionary key. How can I access the available options easily and programmatically? I've found a brute force way of doing it; misname a option and the error message will show the available options: Code:
--> FOAM FATAL IO ERROR: The way I see it, it could be done by two ways: either go through OpenFOAM to find it (ie. mangle around with C++ or use a builtin function that I don't know about) OR find out how it creates the list in the first place. I've tried looking at the source code (look at "OpenFOAM/OpenFOAM-v1712/src/finiteVolume/lnInclude/ddtScheme.C" at line 76 for the code that created the output of the above example), but I have no experience in C++ (or any statically typed language for that matter) and have had a very difficult time figuring it out. Any help would be greatly appreciated! |
Update on the "How do they know whether an option is available?" problem; The list that is output through the error message comes from a runTimeSelectionTable.
Now my question turns to how can I access said runTimeSelectionTable? |
All times are GMT -4. The time now is 01:20. |