public class PreProcess
extends java.lang.Object
Constructor and Description |
---|
PreProcess() |
Modifier and Type | Method and Description |
---|---|
static void |
copyInclude(java.lang.String incline,
java.lang.String sourcedir,
java.io.BufferedWriter BW)
Parses out the name of an include file from an @include directive, and
writes the contents of that file to the output blmenu file.
|
static java.io.File |
includePCD(java.io.File rawfile)
Inserts PCD code from a file into the blmenu.
|
static java.lang.String |
strindent(java.lang.String original,
int n)
This method indents a string with blanks.
|
static java.lang.String |
substituteEnvVars(java.lang.String text)
Substitute environment variables in file paths.
|
static java.lang.String |
substituteEnvVars(java.lang.String text,
java.util.Map<java.lang.String,?> replaceMap)
|
public static java.lang.String strindent(java.lang.String original, int n)
public static java.lang.String substituteEnvVars(java.lang.String text)
public static java.lang.String substituteEnvVars(java.lang.String text, java.util.Map<java.lang.String,?> replaceMap)
public static void copyInclude(java.lang.String incline, java.lang.String sourcedir, java.io.BufferedWriter BW)
incline
- line containing an include directivesourcedir
- directory containing the blmenu fileBW
- writes lines from the include file to the output blmenu filepublic static java.io.File includePCD(java.io.File rawfile)
Inserts PCD code from a file into the blmenu. The motivation for this is to allow lists for choice_menu or chooser widgets to be maintained in a file. Any time the include file changes, the blmenu will be updated at run time. This function is similar to the C include directive.
The include file may either be in the same directory as the blmenu file, or may be a fully qualified file path. The path may include environment variables. For example, the following two lines are equivalent:
@include "blastdb_n_leftjust.blinclude" @include "$BIRCH/local/dat/bldna/PCD/Database/blastdb_n_leftjust.blinclude"
By convention, an include file would have the file extension ".blinclude". However, this is not enforced, so any legal filename would be allowed. Include files may NOT have the following filenames: .blmenu, .pcd, .blitem, .biopcd.
An include line in the blmenu file must match
[<whitespace>]@include<blank>[<blank>][double quote]path[double quote]
Recursion in include files is not supported. If an include file contains an @include reference, that line is ignored and an error message is printed to the console.
rawfile
- the original blmenu file with include lines.Copyright © 2008-2022 University of Manitoba.