Package org.eclipse.cdt.utils
Class AR
java.lang.Object
org.eclipse.cdt.utils.AR
- All Implemented Interfaces:
AutoCloseable
The
AR class is used for parsing standard ELF archive (ar) files.
Each object within the archive is represented by an ARHeader class. Each of
of these objects can then be turned into an Elf object for performing Elf
class operations.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassTheARHeaderclass is used to store the per-object file archive headers. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voiddispose()String[]extractFiles(String outdir) String[]extractFiles(String outdir, String[] names) protected voidfinalize()Get an array of all the object file headers for this archive.static booleanisARHeader(byte[] ident)
-
Field Details
-
filename
-
efile
-
strtbl_pos
protected long strtbl_pos
-
-
Constructor Details
-
AR
Creates a newARobject from the contents of the given file.- Parameters:
filename- The file to process.- Throws:
IOException- The file is not a valid archive.
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
dispose
public void dispose() -
finalize
-
isARHeader
public static boolean isARHeader(byte[] ident) -
getHeaders
Get an array of all the object file headers for this archive.- Returns:
- An array of headers, one for each object within the archive.
- Throws:
IOException- Unable to process the archive file.- See Also:
-
extractFiles
- Throws:
IOException
-
extractFiles
- Throws:
IOException
-