This class provides helper functions for use in MapLink WMS plug-ins.
Tokenise a string containing comma-separated-values.
All whitespace is significant in the string. To use a comma in a value, enclose the whole value in double-quotes. To use a double-quote in double-quotes, follow it with another double-quote. A double-quote cannot be used outside double-quotes.
Examples: (We use square brackets as string delimiters in the following for clarity.) The input string ["ab,",c ,,d,"","e""",]
will produce 7 values as output: [ab,] [c ] [] [d] [] [e"] []
. The input [,,,,]
will produce 5 empty strings as output. The input []
will produce 1 empty string as output.
- Parameters
-
str | Input string to be tokenised. |
errorType | Will be set to the kind of syntax error that occurred, if any. Pass NULL to throw away this information. |
charPosReached | Will be set to the character position of the first syntax error, if one occurred, or else the position of the terminating NUL character. Pass NULL to throw away this information. |
resultIndexReached | Will be set to the number of delimiters (unquoted commas) before the position of the first syntax error (or the NUL, if no error occurred). Pass NULL to throw away this information. |
- Returns
- the list of strings, if tokenisation succeeded. This list will need to be destroyed when it is no longer needed. Returns NULL, if there was a syntax error in the input string.
static bool TSLWMSPluginHelper::populateMapPathlist |
( |
const char * | mapPath, |
|
|
TSLPathList * | pathList ) |
|
static |
If a plug-in requires the loading of a MapLink Map, then there is one very important consideration that this methods aids in addressing. When loading a map, the palette file for that map will overwrite the global palette used by all drawing surfaces in that process. Normally in MapLink this isn't an issue as the use of MapLink is usually in a single threaded environment and with only a single drawing surface in existence at anyone time. For the MapLink WMS, where usually many drawing surfaces will be used in a fully multithreaded environment, we have to prevent the loading of the palette file or we will crash the process.
To prevent the TSLMapDataLayer loading the .pal file for the loading map, we provide it with a pathlist before calling TSLMapDataLayer::loadData. This function will populate a TSLPathList object based upon the path for the map so that the palette is not loaded. The user should provide the fully qualified path to the map and TSLPathList which after this call should be given to the map data layer using the TSLMapDataLayer::addPathList call.
When the subsequent TSLMapDataLayer::loadData method is called the user must not provide the fully qualified path to the map. No path, fully qualified or relative, should be included. The removal of the path from the sting passed as the mapPath argument to this function can be achieved using the helper method getFileNameFromPath().
- Parameters
-
mapPath | The fully qualified path to the MapLink map. If this path is invalid or null then the call will return false. |
pathList | A pathlist object. If this object is not valid then the call will return false; |
- Returns
- true on successful population, false otherwise.