1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 nsDirectoryIndexStream_h__
7 #define nsDirectoryIndexStream_h__
9 #include "mozilla/Attributes.h"
12 #include "nsIInputStream.h"
13 #include "nsCOMArray.h"
17 class nsDirectoryIndexStream final
: public nsIInputStream
{
21 nsresult mStatus
{NS_OK
};
23 int32_t mPos
{0}; // position within mArray
24 nsCOMArray
<nsIFile
> mArray
; // file objects within the directory
26 nsDirectoryIndexStream();
28 * aDir will only be used on the calling thread.
30 nsresult
Init(nsIFile
* aDir
);
31 ~nsDirectoryIndexStream();
35 * aDir will only be used on the calling thread.
37 static nsresult
Create(nsIFile
* aDir
, nsIInputStream
** aResult
);
39 // nsISupportsInterface
40 NS_DECL_THREADSAFE_ISUPPORTS
42 // nsIInputStream interface
43 NS_DECL_NSIINPUTSTREAM
46 #endif // nsDirectoryIndexStream_h__