Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Types | Private Attributes
nsDecodeAppleFile Class Reference

#include <nsDecodeAppleFile.h>

Inheritance diagram for nsDecodeAppleFile:
Inheritance graph
[legend]
Collaboration diagram for nsDecodeAppleFile:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIOUTPUTSTREAM 
nsDecodeAppleFile ()
virtual ~nsDecodeAppleFile ()
nsresult Initialize (nsIOutputStream *output, nsIFile *file)
void close ()
 Close the stream.
void flush ()
 Flush the stream.
unsigned long write (in string aBuf, in unsigned long aCount)
 Write data into the stream.
unsigned long writeFrom (in nsIInputStream aFromStream, in unsigned long aCount)
 Writes data into the stream from an input stream.
unsigned long writeSegments (in nsReadSegmentFun aReader, in voidPtr aClosure, in unsigned long aCount)
 Low-level write method that has access to the stream's underlying buffer.
boolean isNonBlocking ()

Private Types

enum  ParserState {
  parseHeaders, parseEntries, parseLookupPart, parsePart,
  parseSkipPart, parseDataFork, parseResourceFork, parseWriteThrough
}

Private Attributes

nsCOMPtr< nsIOutputStreamm_output
FSSpec m_fsFileSpec
SInt16 m_rfRefNum
unsigned char * m_dataBuffer
PRInt32 m_dataBufferLength
ParserState m_state
ap_header m_headers
ap_entrym_entries
PRInt32 m_offset
PRInt32 m_dataForkOffset
PRInt32 m_totalDataForkWritten
PRInt32 m_totalResourceForkWritten
PRBool m_headerOk
PRInt32 m_currentPartID
PRInt32 m_currentPartLength
PRInt32 m_currentPartCount
Str255 m_comment
ap_dates m_dates
FInfo m_finderInfo
FXInfo m_finderExtraInfo

Detailed Description

Definition at line 109 of file nsDecodeAppleFile.h.


Member Enumeration Documentation

Enumerator:
parseHeaders 
parseEntries 
parseLookupPart 
parsePart 
parseSkipPart 
parseDataFork 
parseResourceFork 
parseWriteThrough 

Definition at line 122 of file nsDecodeAppleFile.h.


Constructor & Destructor Documentation

Definition at line 52 of file nsDecodeAppleFile.cpp.

Here is the call graph for this function:

Definition at line 69 of file nsDecodeAppleFile.cpp.

{
  
  PR_FREEIF(m_dataBuffer);
  if (m_entries)
    delete [] m_entries;
}

Member Function Documentation

void nsIOutputStream::close ( ) [inherited]

Close the stream.

Forces the output stream to flush any buffered data.

Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif unable to flush without blocking the calling thread (non-blocking mode only)
void nsIOutputStream::flush ( ) [inherited]

Flush the stream.

Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif unable to flush without blocking the calling thread (non-blocking mode only)

Definition at line 77 of file nsDecodeAppleFile.cpp.

{
  m_output = output;
  
  nsCOMPtr<nsILocalFileMac> macFile = do_QueryInterface(file);
  macFile->GetTargetFSSpec(&m_fsFileSpec);

  m_offset = 0;
  m_dataForkOffset = 0;

  return NS_OK;
}

Here is the call graph for this function:

Returns:
true if stream is non-blocking

NOTE: writing to a blocking output stream will block the calling thread until all given data can be consumed by the stream.

unsigned long nsIOutputStream::write ( in string  aBuf,
in unsigned long  aCount 
) [inherited]

Write data into the stream.

Parameters:
aBufthe buffer containing the data to be written
aCountthe maximum number of bytes to be written
Returns:
number of bytes written (may be less than aCount)
Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif writing to the output stream would block the calling thread (non-blocking mode only)
<other-error>on failure
unsigned long nsIOutputStream::writeFrom ( in nsIInputStream  aFromStream,
in unsigned long  aCount 
) [inherited]

Writes data into the stream from an input stream.

Parameters:
aFromStreamthe stream containing the data to be written
aCountthe maximum number of bytes to be written
Returns:
number of bytes written (may be less than aCount)
Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif writing to the output stream would block the calling thread (non-blocking mode only)
<other-error>on failure

NOTE: This method is defined by this interface in order to allow the output stream to efficiently copy the data from the input stream into its internal buffer (if any). If this method was provided as an external facility, a separate char* buffer would need to be used in order to call the output stream's other Write method.

unsigned long nsIOutputStream::writeSegments ( in nsReadSegmentFun  aReader,
in voidPtr  aClosure,
in unsigned long  aCount 
) [inherited]

Low-level write method that has access to the stream's underlying buffer.

The reader function may be called multiple times for segmented buffers. WriteSegments is expected to keep calling the reader until either there is nothing left to write or the reader returns an error. WriteSegments should not call the reader with zero bytes to provide.

Parameters:
aReaderthe "provider" of the data to be written
aClosureopaque parameter passed to reader
aCountthe maximum number of bytes to be written
Returns:
number of bytes written (may be less than aCount)
Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif writing to the output stream would block the calling thread (non-blocking mode only)
<other-error>on failure

NOTE: this function may be unimplemented if a stream has no underlying buffer (e.g., socket output stream).


Member Data Documentation

Str255 nsDecodeAppleFile::m_comment [private]

Definition at line 144 of file nsDecodeAppleFile.h.

Definition at line 142 of file nsDecodeAppleFile.h.

Definition at line 140 of file nsDecodeAppleFile.h.

Definition at line 141 of file nsDecodeAppleFile.h.

unsigned char* nsDecodeAppleFile::m_dataBuffer [private]

Definition at line 129 of file nsDecodeAppleFile.h.

Definition at line 130 of file nsDecodeAppleFile.h.

Definition at line 135 of file nsDecodeAppleFile.h.

Definition at line 145 of file nsDecodeAppleFile.h.

Definition at line 133 of file nsDecodeAppleFile.h.

Definition at line 147 of file nsDecodeAppleFile.h.

Definition at line 146 of file nsDecodeAppleFile.h.

Definition at line 126 of file nsDecodeAppleFile.h.

Definition at line 138 of file nsDecodeAppleFile.h.

Definition at line 132 of file nsDecodeAppleFile.h.

Definition at line 134 of file nsDecodeAppleFile.h.

Definition at line 125 of file nsDecodeAppleFile.h.

Definition at line 127 of file nsDecodeAppleFile.h.

Definition at line 131 of file nsDecodeAppleFile.h.

Definition at line 136 of file nsDecodeAppleFile.h.

Definition at line 137 of file nsDecodeAppleFile.h.


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