| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.antcontrib.cpptasks.CUtil
public class CUtil
Some utilities used by the CC and Link tasks.
| Nested Class Summary | |
|---|---|
| static class | CUtil.StringArrayBuilderA class that splits a white-space, comma-separated list into a String array. | 
| Field Summary | |
|---|---|
| static int | FILETIME_EPSILON | 
| Constructor Summary | |
|---|---|
| CUtil() | |
| Method Summary | |
|---|---|
| static void | addAll(java.util.Vector dest,
       java.lang.Object[] src)Adds the elements of the array to the given vector | 
| static int | checkDirectoryArray(java.lang.String[] names)Checks a array of names for non existent or non directory entries and nulls them out. | 
| static java.lang.String | getBasename(java.io.File file)Extracts the basename of a file, removing the extension, if present | 
| static java.io.File | getExecutableLocation(java.lang.String exeName)Gets the parent directory for the executable file name using the current directory and system executable path | 
| static java.lang.String | getParentPath(java.lang.String path)Extracts the parent of a file | 
| static java.io.File[] | getPathFromEnvironment(java.lang.String envVariable,
                       java.lang.String delim)Returns an array of File for each existing directory in the specified environment variable | 
| static java.lang.String | getRelativePath(java.lang.String base,
                java.io.File targetFile)Returns a relative path for the targetFile relative to the base directory. | 
| static boolean | isActive(org.apache.tools.ant.Project p,
         java.lang.String ifCond,
         java.lang.String unlessCond) | 
| static boolean | isSignificantlyAfter(long time1,
                     long time2)Determines whether time1 is later than time2 to a degree that file system time truncation is not significant. | 
| static boolean | isSignificantlyBefore(long time1,
                      long time2)Determines whether time1 is earlier than time2 to a degree that file system time truncation is not significant. | 
| static boolean | isSystemPath(java.io.File source)Determines if source file has a system path, that is part of the compiler or platform. | 
| static java.io.File[] | parsePath(java.lang.String path,
          java.lang.String delim)Parse a string containing directories into an File[] | 
| static int | runCommand(CCTask task,
           java.io.File workingDir,
           java.lang.String[] cmdline,
           boolean newEnvironment,
           org.apache.tools.ant.types.Environment env)This method is exposed so test classes can overload and test the arguments without actually spawning the compiler | 
| static boolean | sameList(java.lang.Object[] a,
         java.lang.Object[] b)Compares the contents of 2 arrays for equaliy. | 
| static boolean | sameList(java.util.Vector v,
         java.lang.Object[] a)Compares the contents of an array and a Vector for equality. | 
| static boolean | sameSet(java.lang.Object[] a,
        java.util.Vector b)Compares the contents of an array and a Vector for set equality. | 
| static java.lang.String[] | toArray(java.util.Vector src)Converts a vector to a string array. | 
| static java.lang.String | toUnixPath(java.lang.String path) | 
| static java.lang.String | toWindowsPath(java.lang.String path) | 
| static java.lang.String | xmlAttribEncode(java.lang.String attrValue)Replaces any embedded quotes in the string so that the value can be placed in an attribute in an XML file | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final int FILETIME_EPSILON
| Constructor Detail | 
|---|
public CUtil()
| Method Detail | 
|---|
public static void addAll(java.util.Vector dest,
                          java.lang.Object[] src)
public static int checkDirectoryArray(java.lang.String[] names)
public static java.lang.String getBasename(java.io.File file)
public static java.io.File getExecutableLocation(java.lang.String exeName)
exeName - Name of executable such as "cl.exe"
public static java.lang.String getParentPath(java.lang.String path)
public static java.io.File[] getPathFromEnvironment(java.lang.String envVariable,
                                                    java.lang.String delim)
envVariable - environment variable name such as "LIB" or "INCLUDE"delim - delimitor used to separate parts of the path, typically ";"
            or ":"
public static java.lang.String getRelativePath(java.lang.String base,
                                               java.io.File targetFile)
base - base directory as returned by File.getCanonicalPath()targetFile - target file
public static boolean isActive(org.apache.tools.ant.Project p,
                               java.lang.String ifCond,
                               java.lang.String unlessCond)
                        throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
public static java.io.File[] parsePath(java.lang.String path,
                                       java.lang.String delim)
path - path string, for example ".;c:\something\include"delim - delimiter, typically ; or :
public static int runCommand(CCTask task,
                             java.io.File workingDir,
                             java.lang.String[] cmdline,
                             boolean newEnvironment,
                             org.apache.tools.ant.types.Environment env)
                      throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
public static boolean sameList(java.lang.Object[] a,
                               java.lang.Object[] b)
public static boolean sameList(java.util.Vector v,
                               java.lang.Object[] a)
public static boolean sameSet(java.lang.Object[] a,
                              java.util.Vector b)
public static java.lang.String[] toArray(java.util.Vector src)
public static java.lang.String xmlAttribEncode(java.lang.String attrValue)
attrValue - value to be expressed
public static boolean isSignificantlyBefore(long time1,
                                            long time2)
time1 - long first time valuetime2 - long second time value
public static boolean isSignificantlyAfter(long time1,
                                           long time2)
time1 - long first time valuetime2 - long second time value
public static java.lang.String toWindowsPath(java.lang.String path)
public static java.lang.String toUnixPath(java.lang.String path)
public static boolean isSystemPath(java.io.File source)
source - source, may not be null.
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||