_rrPython_CrossBatch is a simple class to create batch/script files for multiple OS at the same time.
It keeps a list of variables that will be replaced with values if you save a batch file.
Class _rrPython_CrossBatch functions:
Return type |
Name |
Description |
||||||||||||||||
|
add(string text) |
Adds text to the current line |
||||||||||||||||
|
addFlag(string text) |
Add a commandline flag to the current line. It automatically adds " " around the flag. |
||||||||||||||||
|
addEnd() |
Adds a line end. |
||||||||||||||||
|
addLine(string text) |
Adds the text to the current line and a line end. |
||||||||||||||||
|
setBaseFileName(string filename) |
Set the base path+filename of the resulting file. Do not include any extension. |
||||||||||||||||
|
osVarAdd (string &uni, string &win, string &linux, string &osx) |
Adds variables and values to the replacement list. the parameter uni should not include the surrounding < > that you use in your commandlines. There are already a few variables added by default:
|
||||||||||||||||
|
setEnvVar (string &name, string &win, string &linux, string &osx) |
Set the environment variable "name" to the value specified. |
||||||||||||||||
bool |
saveWin() |
Saves the batch file for Windows. Returns false if the file could not be saved. |
||||||||||||||||
bool |
saveOsx() |
Saves the script file for Osx. Returns false if the file could not be saved. |
||||||||||||||||
bool |
saveLx() |
Saves the script file for Linux. Returns false if the file could not be saved. |
||||||||||||||||
String |
getOSFileName(int OSID) |
Return the batch filename for 0: Windows, 1: Linux or 2: OSX |
||||||||||||||||
String |
fileErrorMessage() |
Returns the error message in case a save has failed. |
||||||||||||||||
|
addCommentLine(string text) |
Adds a comment line to the script. This line is not executed. |
||||||||||||||||
|
addCondition(string var1, string condition, string var2) |
Adds an "if var1 <condition> var2 then " expression to the shell script. Do not forget to add the endif later! Available values for the condition string are: •"contains" •"equal" •"unEqual" •"larger" •"smaller" •"largerEqual" •"smallerEqual" |
||||||||||||||||
|
addConditionElse() |
Adds an "else" to the shell script. |
||||||||||||||||
|
addConditionEndif() |
Adds the "endif" to the batch file. |