logo separator

[mkgmap-dev] New filter function trim

From Franco Bez franco.bez at web.de on Fri Apr 19 22:12:02 BST 2013

Hi all,
I've written a new filter function called trim.

It returns the first part of a value up to the first occurance of a
separator.
If the separator is not found it just returns the value.

Example:
maybe you have a values like this

destination=München;Landsberg;Augsburg;Ammersee
destination=Kaufbeuren;Neugablonz;Mauerstetten;Pforzen

and you want just the first part "München", or "Kaufbeuren"
    '${destination|trim:;}'
will do the trick.

with
destination=München/Landsberg/Augsburg/Ammersee
destination=Kaufbeuren/Neugablonz/Mauerstetten/Pforzen

use
    '${destination|trim:/}'

Find attached the new TrimFilter.java a diff for ValueBuilder.java

Ciao,
  Franco


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20130419/dea6f3a7/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TrimFilter.java
Type: text/x-java
Size: 1024 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20130419/dea6f3a7/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ValueBuilder.diff
Type: text/x-patch
Size: 417 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20130419/dea6f3a7/attachment-0001.bin 


More information about the mkgmap-dev mailing list