com.github.abrarsyed.jastyle
Class OptParser

java.lang.Object
  extended by com.github.abrarsyed.jastyle.OptParser

public class OptParser
extends java.lang.Object


Field Summary
 ASFormatter formatter
           
 
Constructor Summary
OptParser(ASFormatter formatter)
           
 
Method Summary
 void parseOption(java.lang.String opt)
           
 java.util.ArrayList<java.lang.String> parseOptionFile(java.io.File file)
          Parses an Astyle Options file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

formatter

public final ASFormatter formatter
Constructor Detail

OptParser

public OptParser(ASFormatter formatter)
Parameters:
formatter - The formatter to which the parsed options will apply. Options are parsed and applied immediately.
Method Detail

parseOptionFile

public java.util.ArrayList<java.lang.String> parseOptionFile(java.io.File file)
Parses an Astyle Options file. Unsupported, illegal, or malformed options will be logged and ignored. Options are parsed and applied immediately.

Parameters:
file - Options file to parse. Extension is irrelevant.
log - A logger to output stuff to. if this is null, the Global logger will be used.
Returns:
A list of all the errored lines. Empty list if there were no errored lines. NULL if something went wrong reading the file.

parseOption

public void parseOption(java.lang.String opt)
                 throws MalformedOptionException
Parameters:
opt - This string is assumed to be starting with one or two hyphens.
Throws:
MalformedOptionException