Enums to strings

Steve Lime steve.lime at DNR.STATE.MN.US
Sat Sep 10 10:20:26 EDT 2005


I've got a request to make available the current units for a map via MapServer templates. No big deal, just add a [mapunits] tag. However, units are an int that needs to be mapped back to a string. The way that's handled for mapfile writing is through a series of static char arrays (in mapfile.c) that are kept in sync with the enums in map.h.

One solution would be to move those definitions to map.h so they could be generally used. Or should we be considering some other more general approach. 

Finallly, do mods like this require an RFC? My initial thought is that if after a quick discussion here it looks like moving the defs from one file to the other is ok, then no the bug would suffice. A more general solution however would necessitate an RFC.

Steve



More information about the mapserver-dev mailing list