Class ConvertFile32From64

java.lang.Object
com.peterabeles.autocode.ConvertFile32From64

public class ConvertFile32From64 extends Object
Converts a file written for 64bit numbers into 32bit numbers by replacing keywords.
  • Field Details

    • markAsAutoGenerated

      public boolean markAsAutoGenerated
      If true then the files will be marked as being auto generated code. These files are often skipped my code validation tools.
  • Constructor Details

    • ConvertFile32From64

      public ConvertFile32From64(Language language, boolean addDefaultReplacements)
      Constructor
      Parameters:
      addDefaultReplacements - If true all of the defaults replacement patterns are applied.
    • ConvertFile32From64

      public ConvertFile32From64(boolean addDefaultReplacements)
  • Method Details

    • fileNameNoExtension

      public static String fileNameNoExtension(File f, Language language)
    • process

      public void process(File inputFile, File outputFile) throws IOException
      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

      public void scanForCustomization(File inputFile) throws IOException
      Throws:
      IOException
    • replacePattern

      public void replacePattern(String pattern, String replacement)
      Adds a text replacement rule. These will be run in the first pass
      Parameters:
      pattern - REGEX pattern that is searched for inside the word
      replacement - The string that the matching portion will be replaced with
    • replaceStartsWith

      public void replaceStartsWith(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.
      Parameters:
      pattern - Regular text string
      replacement - The string that the matching portion will be replaced with
    • replacePatternAfter

      public void replacePatternAfter(String pattern, String replacement)
      Adds a text replacement rule. These will be run in the final pass
      Parameters:
      pattern - REGEX pattern that is searched for inside the word
      replacement - The string that the matching portion will be replaced with
    • getLanguage

      public Language getLanguage()
    • setLanguage

      public void setLanguage(Language language)