Package org.eclipse.cdt.utils.macho

# Class AR

java.lang.Object
org.eclipse.cdt.utils.macho.AR

All Implemented Interfaces:
  `AutoCloseable`

public class AR extends Object implements AutoCloseable
The `AR` class is used for parsing standard 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:
  - `AR.ARHeader`

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`AR.ARHeader`
The `ARHeader` class is used to store the per-object file archive headers.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected ERandomAccessFile`
`efile`
`protected String`
`filename`
`protected long`
`strtbl_pos`

## Constructor Summary

Constructors
Constructor
Description
`AR(String filename)`
Creates a new `AR` object from the contents of the given file.

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`void`
`dispose()`
`String[]`
`extractFiles(String outdir)`
`String[]`
`extractFiles(String outdir, String[] names)`
`protected void`
`finalize()`
`AR.ARHeader[]`
`getHeaders()`
Get an array of all the object file headers for this archive.
`static boolean`
`isARHeader(byte[] ident)`

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### filename

protected String filename

### efile

protected ERandomAccessFile efile

### strtbl_pos

protected long strtbl_pos

## Constructor Details

### AR

public AR(String filename) throws IOException
Creates a new `AR` object 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:
  `close` in interface `AutoCloseable`

### dispose

public void dispose()

### finalize

protected void finalize() throws Throwable

Overrides:
  `finalize` in class `Object`
Throws:
  `Throwable`

### isARHeader

public static boolean isARHeader(byte[] ident)

### getHeaders

public AR.ARHeader[] getHeaders() throws IOException
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:
  - `AR.ARHeader`

### extractFiles

public String[] extractFiles(String outdir, String[] names) throws IOException

Throws:
  `IOException`

### extractFiles

public String[] extractFiles(String outdir) throws IOException

Throws:
  `IOException`