Package com.peterabeles.autocode
Class ConvertFile32From64
java.lang.Object
com.peterabeles.autocode.ConvertFile32From64
Converts a file written for 64bit numbers into 32bit numbers by replacing keywords.
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanIf true then the files will be marked as being auto generated code. -
Constructor Summary
ConstructorsConstructorDescriptionConvertFile32From64(boolean addDefaultReplacements) ConvertFile32From64(Language language, boolean addDefaultReplacements) Constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic StringfileNameNoExtension(File f, Language language) voidApplies the specified keyword replacements to the input file and saves the results to the output filevoidreplacePattern(String pattern, String replacement) Adds a text replacement rule.voidreplacePatternAfter(String pattern, String replacement) Adds a text replacement rule.voidreplaceStartsWith(String pattern, String replacement) If a world starts with the pattern (just a string not a REGEX) then the matching text will be replaced by the replacement string.voidscanForCustomization(File inputFile) voidsetLanguage(Language language)
-
Field Details
-
markAsAutoGenerated
public boolean markAsAutoGeneratedIf true then the files will be marked as being auto generated code. These files are often skipped my code validation tools.
-
-
Constructor Details
-
ConvertFile32From64
Constructor- Parameters:
addDefaultReplacements- If true all of the defaults replacement patterns are applied.
-
ConvertFile32From64
public ConvertFile32From64(boolean addDefaultReplacements)
-
-
Method Details
-
fileNameNoExtension
-
process
Applies the specified keyword replacements to the input file and saves the results to the output file- Parameters:
inputFile- File that is to be transformed. Unmodified.outputFile- Where results of the transformation are written to. Modified- Throws:
IOException- If something goes wrong this is thrown.
-
scanForCustomization
- Throws:
IOException
-
replacePattern
Adds a text replacement rule. These will be run in the first pass- Parameters:
pattern- REGEX pattern that is searched for inside the wordreplacement- The string that the matching portion will be replaced with
-
replaceStartsWith
If a world starts with the pattern (just a string not a REGEX) then the matching text will be replaced by the replacement string.- Parameters:
pattern- Regular text stringreplacement- The string that the matching portion will be replaced with
-
replacePatternAfter
Adds a text replacement rule. These will be run in the final pass- Parameters:
pattern- REGEX pattern that is searched for inside the wordreplacement- The string that the matching portion will be replaced with
-
getLanguage
-
setLanguage
-