Class WindowsPlatform
java.lang.Object
net.sf.antcontrib.cpptasks.platforms.WindowsPlatform
Platform specific behavior for Microsoft Windows.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addVersionFiles
(VersionInfo versionInfo, LinkType linkType, File outputFile, boolean isDebug, File objDir, TargetMatcher matcher) Adds source or object files to the bidded fileset to support version information.private static void
encodeVersion
(StringBuffer buf, short[] version) Converts parsed version information into a string representation.private static boolean
hasSameContent
(InputStream stream1, InputStream stream2) Compare two input streams for duplicate content Naive implementation, but should not be performance issue.static short[]
parseVersion
(String version) Parse version string into array of four short values.static void
writeResource
(Writer writer, VersionInfo versionInfo, File outputFile, boolean isDebug, LinkType linkType) Writes windows resource.
-
Constructor Details
-
WindowsPlatform
private WindowsPlatform()Constructor.
-
-
Method Details
-
addVersionFiles
public static void addVersionFiles(VersionInfo versionInfo, LinkType linkType, File outputFile, boolean isDebug, File objDir, TargetMatcher matcher) throws IOException Adds source or object files to the bidded fileset to support version information.- Parameters:
versionInfo
- version informationlinkType
- link typeoutputFile
- name of generated executableisDebug
- true if debug buildobjDir
- directory for generated filesmatcher
- bidded fileset- Throws:
IOException
- if unable to write version resource
-
hasSameContent
Compare two input streams for duplicate content Naive implementation, but should not be performance issue.- Parameters:
stream1
- streamstream2
- stream- Returns:
- true if streams are identical in content
- Throws:
IOException
- if error reading streams
-
parseVersion
Parse version string into array of four short values.- Parameters:
version
- String version- Returns:
- short[] four element array
-
encodeVersion
Converts parsed version information into a string representation.- Parameters:
buf
- StringBuffer string buffer to receive version numberversion
- short[] four-element array
-
writeResource
public static void writeResource(Writer writer, VersionInfo versionInfo, File outputFile, boolean isDebug, LinkType linkType) throws IOException Writes windows resource.- Parameters:
writer
- writer, may not be nulversionInfo
- version informationoutputFile
- executable fileisDebug
- true if debuglinkType
- link type- Throws:
IOException
- if error writing resource file
-