Class MetaObjectCompiler
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.MetaObjectCompiler
Adapter for the Trolltech Qt MOC Compiler.
- Author:
- Curt Arnold
-
Field Summary
Fields inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
DEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddImpliedArgs(Vector args, boolean debug, boolean multithreaded, boolean exceptions, LinkType linkType, Boolean rtti, OptimizationEnum optimization) Add arguments for debug, etc.protected voidaddWarningSwitch(Vector args, int level) Add arguments for specified warning level.intReturns the bid of the processor for the file.changeEnvironment(boolean newEnvironment, org.apache.tools.ant.types.Environment env) Change enviroment (deprecated).protected ParsercreateParser(File source) Gets a parser to scan source file for dependencies.protected intGets number of command line arguments per input file.protected voidgetDefineSwitch(StringBuffer buffer, String define, String value) Gets switch to define preprocessor macro.protected File[]Gets standard include paths.protected StringgetIncludeDirSwitch(String includeDir) Gets include directory switch.protected StringgetInputFileArgument(File outputDir, String filename, int index) Gets input file arguments.static MetaObjectCompilerGets singleton instance of compiler.Gets linker associated with this type.intGets maximum length of command line.protected intGets maximum number of input files processed per command.String[]getOutputFileNames(String inputFile, VersionInfo versionInfo) Gets output file names.protected intgetTotalArgumentLengthForInputFile(File outputDir, String inputFile) Get total command line length due to the input file.protected voidgetUndefineSwitch(StringBuffer buffer, String define) Gets switch to undefine preprocessor macro.Methods inherited from class net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler
addIncludes, buildDefineArguments, compile, createConfiguration, getCommand, getIdentifier, getLibtool, getLibtoolCompiler, runCommand, setCommandMethods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractCompiler
canParse, createConfiguration, getBaseOutputName, parseIncludes, resolveIncludeMethods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
clone, getHeaderExtensions, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, toString
-
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:
addImpliedArgsin 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:
addWarningSwitchin 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:
changeEnvironmentin interfaceProcessor- Overrides:
changeEnvironmentin classAbstractProcessor- Parameters:
newEnvironment- boolean use new environment.env- Environment environment- Returns:
- Processor modified processor
-
createParser
Gets a parser to scan source file for dependencies.- Specified by:
createParserin classAbstractCompiler- Parameters:
source- source file- Returns:
- parser
-
getArgumentCountPerInputFile
protected int getArgumentCountPerInputFile()Gets number of command line arguments per input file.- Overrides:
getArgumentCountPerInputFilein classCommandLineCompiler- Returns:
- int number of command line arguments per input file.
-
bid
Returns the bid of the processor for the file.- Specified by:
bidin interfaceProcessor- Overrides:
bidin classAbstractProcessor- Parameters:
inputFile- filename of input file- Returns:
- bid for the file, 0 indicates no interest, 1 indicates that the processor recognizes the file but doesn't process it (header files, for example), 100 indicates strong interest
-
getOutputFileNames
Gets output file names.- Specified by:
getOutputFileNamesin interfaceProcessor- Overrides:
getOutputFileNamesin 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:
getInputFileArgumentin 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:
getMaximumCommandLengthin classCommandLineCompiler- Returns:
- int maximum length of command line
-
getMaximumInputFilesPerCommand
protected int getMaximumInputFilesPerCommand()Gets maximum number of input files processed per command.- Overrides:
getMaximumInputFilesPerCommandin classCommandLineCompiler- Returns:
- int maximum number of input files processed per command.
-
getIncludeDirSwitch
Gets include directory switch.- Specified by:
getIncludeDirSwitchin 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:
getDefineSwitchin 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:
getUndefineSwitchin classCommandLineCompiler- Parameters:
buffer- StringBuffer command line argumentdefine- String macro name
-
getEnvironmentIncludePath
Gets standard include paths.- Specified by:
getEnvironmentIncludePathin classCommandLineCompiler- Returns:
- File[] standard include paths
-
getLinker
Gets linker associated with this type.- Parameters:
type- LinkType linker, returns ld.- Returns:
- Linker
-
getTotalArgumentLengthForInputFile
Get total command line length due to the input file.- Overrides:
getTotalArgumentLengthForInputFilein classCommandLineCompiler- Parameters:
outputDir- File output directoryinputFile- String input file- Returns:
- int characters added to command line for the input file.
-