michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_file_domarchivezipevent_h__ michael@0: #define mozilla_dom_file_domarchivezipevent_h__ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "ArchiveEvent.h" michael@0: michael@0: #include "FileCommon.h" michael@0: #include "zipstruct.h" michael@0: michael@0: BEGIN_FILE_NAMESPACE michael@0: michael@0: /** michael@0: * ArchiveZipItem - ArchiveItem for ArchiveReaderZipEvent michael@0: */ michael@0: class ArchiveZipItem : public ArchiveItem michael@0: { michael@0: public: michael@0: ArchiveZipItem(const char* aFilename, michael@0: const ZipCentral& aCentralStruct, michael@0: const nsACString& aEncoding); michael@0: virtual ~ArchiveZipItem(); michael@0: michael@0: nsresult GetFilename(nsString& aFilename) MOZ_OVERRIDE; michael@0: michael@0: // From zipItem to DOMFile: michael@0: virtual nsIDOMFile* File(ArchiveReader* aArchiveReader) MOZ_OVERRIDE; michael@0: michael@0: public: // for the event michael@0: static uint32_t StrToInt32(const uint8_t* aStr); michael@0: static uint16_t StrToInt16(const uint8_t* aStr); michael@0: michael@0: private: michael@0: nsresult ConvertFilename(); michael@0: michael@0: private: // data michael@0: nsCString mFilename; michael@0: michael@0: nsString mFilenameU; michael@0: ZipCentral mCentralStruct; michael@0: michael@0: nsCString mEncoding; michael@0: }; michael@0: michael@0: /** michael@0: * ArchiveReaderEvent implements the ArchiveReaderEvent for the ZIP format michael@0: */ michael@0: class ArchiveReaderZipEvent : public ArchiveReaderEvent michael@0: { michael@0: public: michael@0: ArchiveReaderZipEvent(ArchiveReader* aArchiveReader, michael@0: const nsACString& aEncoding); michael@0: michael@0: nsresult Exec() MOZ_OVERRIDE; michael@0: michael@0: private: michael@0: nsCString mEncoding; michael@0: }; michael@0: michael@0: END_FILE_NAMESPACE michael@0: michael@0: #endif // mozilla_dom_file_domarchivezipevent_h__ michael@0: