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
`class` `AR.ARHeader` Archive and archive member header.
`class` `AR.LSTHeader` Library Symbol Table header

### Field Summary

Fields
`protected RandomAccessFile` `file`
`protected String` `filename`
`static String` `NL`

### Constructor Summary

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

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`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 Detail

#### NL

    public static final String NL

#### filename

    protected String filename

#### file

    protected RandomAccessFile file

### Constructor Detail

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

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