1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsAppleFileDecoder_h__
7 #define nsAppleFileDecoder_h__
9 #include "nsIAppleFileDecoder.h"
10 #include "nsILocalFileMac.h"
13 ** applefile definitions used
15 #if PRAGMA_STRUCT_ALIGN
16 #pragma options align=mac68k
19 #define APPLESINGLE_MAGIC 0x00051600L
20 #define APPLEDOUBLE_MAGIC 0x00051607L
21 #define VERSION 0x00020000
28 #define ENT_COMMENT 4L
32 #define CONVERT_TIME 1265437696L
35 ** data type used in the header decoder.
37 typedef struct ap_header
46 typedef struct ap_entry
54 typedef struct ap_dates
56 int32_t create
, modify
, backup
, access
;
60 #if PRAGMA_STRUCT_ALIGN
61 #pragma options align=reset
68 errADNotEnoughData
= -12099,
74 class nsAppleFileDecoder
: public nsIAppleFileDecoder
78 NS_DECL_NSIOUTPUTSTREAM
79 NS_DECL_NSIAPPLEFILEDECODER
82 virtual ~nsAppleFileDecoder();
85 #define MAX_BUFFERSIZE 1024
86 enum ParserState
{parseHeaders
, parseEntries
, parseLookupPart
, parsePart
, parseSkipPart
,
87 parseDataFork
, parseResourceFork
, parseWriteThrough
};
89 nsCOMPtr
<nsIOutputStream
> m_output
;
93 unsigned char * m_dataBuffer
;
94 int32_t m_dataBufferLength
;
99 int32_t m_dataForkOffset
;
100 int32_t m_totalDataForkWritten
;
101 int32_t m_totalResourceForkWritten
;
104 int32_t m_currentPartID
;
105 int32_t m_currentPartLength
;
106 int32_t m_currentPartCount
;
111 FXInfo m_finderExtraInfo
;