OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
OpenSim.Framework.Serialization.TarArchiveReader Class Reference

Temporary code to do the bare minimum required to read a tar archive for our purposes More...

Public Types

enum  TarEntryType {
  TarEntryType.TYPE_UNKNOWN = 0, TarEntryType.TYPE_NORMAL_FILE = 1, TarEntryType.TYPE_HARD_LINK = 2, TarEntryType.TYPE_SYMBOLIC_LINK = 3,
  TarEntryType.TYPE_CHAR_SPECIAL = 4, TarEntryType.TYPE_BLOCK_SPECIAL = 5, TarEntryType.TYPE_DIRECTORY = 6, TarEntryType.TYPE_FIFO = 7,
  TarEntryType.TYPE_CONTIGUOUS_FILE = 8
}
 

Public Member Functions

 TarArchiveReader (Stream s)
 Generate a tar reader which reads from the given stream. More...
 
byte[] ReadEntry (out string filePath, out TarEntryType entryType)
 Read the next entry in the tar file. More...
 
void Close ()
 

Static Public Member Functions

static int ConvertOctalBytesToDecimal (byte[] bytes, int startIndex, int count)
 Convert octal bytes to a decimal representation More...
 

Protected Member Functions

TarHeader ReadHeader ()
 Read the next 512 byte chunk of data as a tar header. More...
 
byte[] ReadData (int fileSize)
 Read data following a header More...
 

Protected Attributes

BinaryReader m_br
 Binary reader for the underlying stream More...
 

Static Protected Attributes

static char[] m_nullCharArray = new char[] { '\0' }
 Used to trim off null chars More...
 
static char[] m_spaceCharArray = new char[] { ' ' }
 Used to trim off space chars More...
 

Detailed Description

Temporary code to do the bare minimum required to read a tar archive for our purposes

Definition at line 39 of file TarArchiveReader.cs.

Member Enumeration Documentation

enum OpenSim.Framework.Serialization.TarArchiveReader.TarEntryType
Enumerator
TYPE_UNKNOWN 
TYPE_NORMAL_FILE 
TYPE_HARD_LINK 
TYPE_SYMBOLIC_LINK 
TYPE_CHAR_SPECIAL 
TYPE_BLOCK_SPECIAL 
TYPE_DIRECTORY 
TYPE_FIFO 
TYPE_CONTIGUOUS_FILE 

Definition at line 43 of file TarArchiveReader.cs.

Constructor & Destructor Documentation

OpenSim.Framework.Serialization.TarArchiveReader.TarArchiveReader ( Stream  s)
inline

Generate a tar reader which reads from the given stream.

Parameters
s

Definition at line 74 of file TarArchiveReader.cs.

Member Function Documentation

void OpenSim.Framework.Serialization.TarArchiveReader.Close ( )
inline

Definition at line 192 of file TarArchiveReader.cs.

static int OpenSim.Framework.Serialization.TarArchiveReader.ConvertOctalBytesToDecimal ( byte[]  bytes,
int  startIndex,
int  count 
)
inlinestatic

Convert octal bytes to a decimal representation

Parameters
bytes
Returns

Definition at line 202 of file TarArchiveReader.cs.

byte [] OpenSim.Framework.Serialization.TarArchiveReader.ReadData ( int  fileSize)
inlineprotected

Read data following a header

Parameters
fileSize
Returns

Definition at line 173 of file TarArchiveReader.cs.

byte [] OpenSim.Framework.Serialization.TarArchiveReader.ReadEntry ( out string  filePath,
out TarEntryType  entryType 
)
inline

Read the next entry in the tar file.

Parameters
filePath
Returns
the data for the entry. Returns null if there are no more entries

Definition at line 84 of file TarArchiveReader.cs.

Here is the caller graph for this function:

TarHeader OpenSim.Framework.Serialization.TarArchiveReader.ReadHeader ( )
inlineprotected

Read the next 512 byte chunk of data as a tar header.

Returns
A tar header struct. null if we have reached the end of the archive.

Definition at line 102 of file TarArchiveReader.cs.

Member Data Documentation

BinaryReader OpenSim.Framework.Serialization.TarArchiveReader.m_br
protected

Binary reader for the underlying stream

Definition at line 59 of file TarArchiveReader.cs.

char [] OpenSim.Framework.Serialization.TarArchiveReader.m_nullCharArray = new char[] { '\0' }
staticprotected

Used to trim off null chars

Definition at line 64 of file TarArchiveReader.cs.

char [] OpenSim.Framework.Serialization.TarArchiveReader.m_spaceCharArray = new char[] { ' ' }
staticprotected

Used to trim off space chars

Definition at line 68 of file TarArchiveReader.cs.


The documentation for this class was generated from the following file: