Opened 13 years ago
#4031 new enhancement
Enable mapfile strings and arbitrary file streams to be tokenized
Reported by: | homme | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | MapServer C Library | Version: | svn-trunk (development) |
Severity: | normal | Keywords: | |
Cc: |
Description
mapfile.c contains the function msTokenizeMap() which is useful in systems which adopt a more declarative style to manipulating mapfiles and generating maps than traditional mapscript applications. A declarative system commonly creates a mapfile which it then passes to the stock CGI mapserv application for rendering.
msTokenizeMap(), however, only allows tokenizing of mapfiles referenced on disk by file paths. Applications sometimes need more flexibility in sourcing mapfiles (e.g. from databases and alternative file streams) without the overhead of saving them to disk for use with msTokenizeMap().
The attached patch extends the mapserver API to provide msTokenizeMapStream() and msTokenizeMapString() which allow arbitrary FILE streams and strings representing mapfiles to be tokenized. It refactors the original msTokenizeMap() code to maximise code reuse and minimise any code maintenance.
Also attached is a small test program which demonstrates the API.
Attachments (2)
Change History (2)
by , 13 years ago
Attachment: | msTokenize.patch added |
---|
by , 13 years ago
Attachment: | tokenize-test.c added |
---|
Example program demonstrating the use of msTokenizeMapStream() and msTokenizeMapString()
A patch for mapserver.h and mapfile.c against revision 12562