Package org.eclipse.cdt.utils.som

# Class AR

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

All Implemented Interfaces:
  `AutoCloseable`

public class AR extends Object implements AutoCloseable
The `AR` class is used for parsing standard SOM archive (ar) files.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`AR.ARHeader`
Archive and archive member header.
`class`
`AR.LSTHeader`
Library Symbol Table header

## Field Summary

Fields
Modifier and Type
Field
Description
`protected RandomAccessFile`
`file`
`protected String`
`filename`
`static final String`
`NL`

## 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)`
`protected void`
`finalize()`
`AR.ARHeader[]`
`getHeaders()`
Get an array of all the object file headers for this archive.
`protected RandomAccessFile`
`getRandomAccessFile()`
`static boolean`
`isARHeader(byte[] ident)`
`static void`
`main(String[] args)`
`String`
`toString()`

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

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

## Field Details

### NL

public static final String NL

### filename

protected String filename

### file

protected RandomAccessFile file

## 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)

### getRandomAccessFile

protected RandomAccessFile getRandomAccessFile() throws IOException

Throws:
  `IOException`

### 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) throws IOException

Throws:
  `IOException`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### main

public static void main(String[] args)