Class UserInterfaceCompiler
java.lang.Object
net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
net.sf.antcontrib.cpptasks.compiler.AbstractCompiler
net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler
net.sf.antcontrib.cpptasks.trolltech.UserInterfaceCompiler
Adapter for the Trolltech Qt UIC Compiler.
-
Field Summary
FieldsFields inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
DEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
UserInterfaceCompiler
(boolean newEnvironment, org.apache.tools.ant.types.Environment env) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addImpliedArgs
(Vector args, boolean debug, boolean multithreaded, boolean exceptions, LinkType linkType, Boolean rtti, OptimizationEnum optimization) Add arguments for debug, etc.protected void
addWarningSwitch
(Vector args, int level) Add arguments for specified warning level.changeEnvironment
(boolean newEnvironment, org.apache.tools.ant.types.Environment env) Change enviroment (deprecated).void
compile
(CCTask task, File outputDir, String[] sourceFiles, String[] args, String[] endArgs, boolean relentless, CommandLineCompilerConfiguration config, ProgressMonitor monitor) Compiles an .ui file into the corresponding .h, .cpp and moc_*.cpp files.protected Parser
createParser
(File source) The include parser for C will work just fine, but we didn't want to inherit from CommandLineCCompiler.protected int
Gets number of command line arguments per input file.protected void
getDefineSwitch
(StringBuffer buffer, String define, String value) Gets switch to define preprocessor macro.protected File[]
Gets standard include paths.protected String
getIncludeDirSwitch
(String includeDir) Gets include directory switch.protected String
getInputFileArgument
(File outputDir, String filename, int index) Gets input file arguments.static UserInterfaceCompiler
Gets singleton instance of compiler.Gets linker associated with this type.int
Gets maximum length of command line.protected int
Gets maximum number of input files processed per command.String[]
getOutputFileNames
(String inputFile, VersionInfo versionInfo) Gets output file names.protected int
getTotalArgumentLengthForInputFile
(File outputDir, String inputFile) Get total command line length due to the input file.protected void
getUndefineSwitch
(StringBuffer buffer, String define) Gets switch to undefine preprocessor macro.Methods inherited from class net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler
addIncludes, buildDefineArguments, createConfiguration, getCommand, getIdentifier, getLibtool, getLibtoolCompiler, runCommand, setCommand
Methods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractCompiler
canParse, createConfiguration, getBaseOutputName, parseIncludes, resolveInclude
Methods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
bid, clone, getHeaderExtensions, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, toString
-
Field Details
-
INSTANCE
Singleton instance.
-
-
Constructor Details
-
UserInterfaceCompiler
private UserInterfaceCompiler(boolean newEnvironment, org.apache.tools.ant.types.Environment env) Constructor.- Parameters:
newEnvironment
- boolean establish an new environment.env
- Environment environment.
-
-
Method Details
-
getInstance
Gets singleton instance of compiler.- Returns:
- MetaObjectCompiler singleton instance
-
addImpliedArgs
protected void addImpliedArgs(Vector args, boolean debug, boolean multithreaded, boolean exceptions, LinkType linkType, Boolean rtti, OptimizationEnum optimization) Add arguments for debug, etc.- Specified by:
addImpliedArgs
in classCommandLineCompiler
- Parameters:
args
- Vector command argument listdebug
- boolean build for debug if truemultithreaded
- boolean build for multithreading if trueexceptions
- boolean enable exceptions if truelinkType
- LinkType output and runtime typertti
- Boolean enable run-time type identification if trueoptimization
- OptimizationEnum optimization
-
addWarningSwitch
Add arguments for specified warning level.- Specified by:
addWarningSwitch
in classCommandLineCompiler
- Parameters:
args
- Vector command line argumentslevel
- int warning level value
-
changeEnvironment
public Processor changeEnvironment(boolean newEnvironment, org.apache.tools.ant.types.Environment env) Change enviroment (deprecated).- Specified by:
changeEnvironment
in interfaceProcessor
- Overrides:
changeEnvironment
in classAbstractProcessor
- Parameters:
newEnvironment
- boolean use new environment.env
- Environment environment- Returns:
- Processor modified processor
-
createParser
The include parser for C will work just fine, but we didn't want to inherit from CommandLineCCompiler.- Specified by:
createParser
in classAbstractCompiler
- Parameters:
source
- source file to be parsed- Returns:
- parser
-
getArgumentCountPerInputFile
protected int getArgumentCountPerInputFile()Gets number of command line arguments per input file.- Overrides:
getArgumentCountPerInputFile
in classCommandLineCompiler
- Returns:
- int number of command line arguments per input file.
-
getOutputFileNames
Gets output file names.- Specified by:
getOutputFileNames
in interfaceProcessor
- Overrides:
getOutputFileNames
in classAbstractCompiler
- Parameters:
inputFile
- String input file nameversionInfo
- version info, not used by this compiler.- Returns:
- String[] output file names
-
getInputFileArgument
Gets input file arguments.- Overrides:
getInputFileArgument
in classCommandLineCompiler
- Parameters:
outputDir
- File output directoryfilename
- String input file name.index
- int argument index, 0 to getNumberOfArgumentsPerInputFile() -1- Returns:
- String input file argument
-
getMaximumCommandLength
public int getMaximumCommandLength()Gets maximum length of command line.- Specified by:
getMaximumCommandLength
in classCommandLineCompiler
- Returns:
- int maximum length of command line
-
getMaximumInputFilesPerCommand
protected int getMaximumInputFilesPerCommand()Gets maximum number of input files processed per command.- Overrides:
getMaximumInputFilesPerCommand
in classCommandLineCompiler
- Returns:
- int maximum number of input files processed per command.
-
getIncludeDirSwitch
Gets include directory switch.- Specified by:
getIncludeDirSwitch
in classCommandLineCompiler
- Parameters:
includeDir
- String include directory- Returns:
- String command switch to add specified directory to search path
-
getDefineSwitch
Gets switch to define preprocessor macro.- Specified by:
getDefineSwitch
in classCommandLineCompiler
- Parameters:
buffer
- StringBuffer command line argumentdefine
- String macro namevalue
- String macro value, may be null.
-
getUndefineSwitch
Gets switch to undefine preprocessor macro.- Specified by:
getUndefineSwitch
in classCommandLineCompiler
- Parameters:
buffer
- StringBuffer command line argumentdefine
- String macro name
-
getEnvironmentIncludePath
Gets standard include paths.- Specified by:
getEnvironmentIncludePath
in classCommandLineCompiler
- Returns:
- File[] standard include paths
-
getLinker
Gets linker associated with this type.- Parameters:
type
- LinkType linker, returns ld.- Returns:
- Linker
-
compile
public void compile(CCTask task, File outputDir, String[] sourceFiles, String[] args, String[] endArgs, boolean relentless, CommandLineCompilerConfiguration config, ProgressMonitor monitor) Compiles an .ui file into the corresponding .h, .cpp and moc_*.cpp files.- Overrides:
compile
in classCommandLineCompiler
- Parameters:
task
- current cc taskoutputDir
- output directorysourceFiles
- source filesargs
- command line arguments that appear before input filesendArgs
- command line arguments that appear after input filesrelentless
- if true, do not stop at first compilation errorconfig
- compiler configurationmonitor
- progress monitor
-
getTotalArgumentLengthForInputFile
Get total command line length due to the input file.- Overrides:
getTotalArgumentLengthForInputFile
in classCommandLineCompiler
- Parameters:
outputDir
- File output directoryinputFile
- String input file- Returns:
- int characters added to command line for the input file.
-