Adaptable paths for input and output files

Hi list, I prepared a diff against r1657 which implements an --output-dir option for mkgmap. According to the tests I've made, mkmap does not change its behaviour if this option is left alone. However, the diff is rather ugly, since file write operations are scattered over a number of classes. Thus the code prepending the pathname is equally scattered. Untangling things a bit (eg. by supplying a custom ResultWriter() class) would be worth a thought or two. However this might probably make other changes necessary. As such a decision is up to the core developer(s), I don't intend to foreclose that. I uploaded a unified diff as well as the changed files to the following URL: http://aloha.target23.de/mkgmap-outputdir.zip I'd be happy to apply changes if anybody tells me about the preferred way to implement this in a more centralized manner. All the best, /Markus

Hi Thanks this option would be useful.
However, the diff is rather ugly, since file write operations are scattered over a number of classes. Thus the code prepending the pathname is equally scattered.
I think it would be better to define a method on CommandArgs called getOutputPath(String filename) or similar that returns the right thing. ..Steve
participants (2)
-
Markus
-
Steve Ratcliffe