use of uk.me.parabola.mkgmap.Option in project mkgmap by openstreetmap.
the class StyleImpl method readOptions.
/**
* If there is an options file, then read it and keep options that
* we are interested in.
*
* Only specific options can be set.
*/
private void readOptions() {
try {
Reader r = fileLoader.open(FILE_OPTIONS);
Options opts = new Options(new OptionProcessor() {
public void processOption(Option opt) {
String key = opt.getOption();
String val = opt.getValue();
if (key.equals("name-tag-list")) {
if ("name".equals(val) == false) {
System.err.println("Warning: option name-tag-list used in the style options is ignored. " + "Please use only the command line option to specify this value.");
}
} else if (OPTION_LIST.contains(key)) {
// Simple options that have string value. Perhaps we should allow
// anything here?
generalOptions.put(key, val);
}
}
});
opts.readOptionFile(r, FILE_OPTIONS);
} catch (FileNotFoundException e) {
// the file is optional, so ignore if not present, or causes error
log.debug("no options file");
}
}
use of uk.me.parabola.mkgmap.Option in project mkgmap by openstreetmap.
the class StyleImpl method readInfo.
/**
* Read the info file. This is just information about the style.
*/
private void readInfo() {
try {
Reader br = new BufferedReader(fileLoader.open(FILE_INFO));
info = new StyleInfo();
Options opts = new Options(new OptionProcessor() {
public void processOption(Option opt) {
String word = opt.getOption();
String value = opt.getValue();
if (word.equals("summary"))
info.setSummary(value);
else if (word.equals("version")) {
info.setVersion(value);
} else if (word.equals("base-style")) {
info.addBaseStyleName(value);
} else if (word.equals("description")) {
info.setLongDescription(value);
}
}
});
opts.readOptionFile(br, FILE_INFO);
} catch (FileNotFoundException e) {
// optional file..
log.debug("no info file");
}
}
Aggregations