uk.me.parabola.mkgmap.osmstyle
Class CombinedStyleFileLoader

java.lang.Object
  extended by uk.me.parabola.mkgmap.osmstyle.StyleFileLoader
      extended by uk.me.parabola.mkgmap.osmstyle.CombinedStyleFileLoader

public class CombinedStyleFileLoader
extends StyleFileLoader

Load a style from a single file. All the files that make up the style are held in the same file and delimited by a simple header.

Lines before the first header are ignored. A header looks like this: <<<filename>>>, that is three opening angle brackets, the name of the file and three closing angle brackets. The opening brackets must be at the beginning of the line, there can be trailing junk after the closing brackets which is ignored.

All lines after the header and before the next header or end of file are part of the named file.

If there are no headers in the file, then we create a fake version 0 file and place the complete file in the name 'map-features.csv'. This allows us to wrap an existing map-features.csv file in the new style system.

Author:
Steve Ratcliffe

Constructor Summary
CombinedStyleFileLoader(java.lang.String filename)
           
 
Method Summary
 void close()
          Close the FileLoader.
 java.lang.String[] list()
          List the names of the styles that are contained in this loader.
static void main(java.lang.String[] args)
          Covert between the single file simple-archive form and the directory form.
 java.io.Reader open(java.lang.String filename)
          Open the specified file in the style definition.
 
Methods inherited from class uk.me.parabola.mkgmap.osmstyle.StyleFileLoader
createStyleLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombinedStyleFileLoader

public CombinedStyleFileLoader(java.lang.String filename)
                        throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException
Method Detail

open

public java.io.Reader open(java.lang.String filename)
                    throws java.io.FileNotFoundException
Open the specified file in the style definition.

Specified by:
open in class StyleFileLoader
Parameters:
filename - The name of the file in the style.
Returns:
An open file reader for the file.
Throws:
java.io.FileNotFoundException - When the file can't be opened.

close

public void close()
Close the FileLoader. This is different from closing individual files that were opened via open(java.lang.String). After this call then you shouldn't open any more files.

Specified by:
close in class StyleFileLoader

list

public java.lang.String[] list()
Description copied from class: StyleFileLoader
List the names of the styles that are contained in this loader.

Specified by:
list in class StyleFileLoader
Returns:
An array of style names.

main

public static void main(java.lang.String[] args)
Covert between the single file simple-archive form and the directory form. Mostly for fun.

Parameters:
args - Arguments, you supply a directory or a file. If its a directory then covert into a simple-archive file and if it is a file then expand into separate files.