michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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 michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsDirectoryIndexStream_h__ michael@0: #define nsDirectoryIndexStream_h__ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: #include "nsString.h" michael@0: #include "nsIInputStream.h" michael@0: #include "nsCOMArray.h" michael@0: michael@0: class nsIFile; michael@0: michael@0: class nsDirectoryIndexStream MOZ_FINAL : public nsIInputStream michael@0: { michael@0: private: michael@0: nsCString mBuf; michael@0: int32_t mOffset; michael@0: nsresult mStatus; michael@0: michael@0: int32_t mPos; // position within mArray michael@0: nsCOMArray mArray; // file objects within the directory michael@0: michael@0: nsDirectoryIndexStream(); michael@0: /** michael@0: * aDir will only be used on the calling thread. michael@0: */ michael@0: nsresult Init(nsIFile* aDir); michael@0: ~nsDirectoryIndexStream(); michael@0: michael@0: public: michael@0: /** michael@0: * aDir will only be used on the calling thread. michael@0: */ michael@0: static nsresult michael@0: Create(nsIFile* aDir, nsIInputStream** aStreamResult); michael@0: michael@0: // nsISupportsInterface michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: michael@0: // nsIInputStream interface michael@0: NS_DECL_NSIINPUTSTREAM michael@0: }; michael@0: michael@0: #endif // nsDirectoryIndexStream_h__ michael@0: