Bug 1861709 replace AudioCallbackDriver::ThreadRunning() assertions that mean to...
[gecko.git] / netwerk / base / nsDirectoryIndexStream.h
blob6bdebc7cfe37654b834b7f9db82403fe5a1d8842
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"
11 #include "nsString.h"
12 #include "nsIInputStream.h"
13 #include "nsCOMArray.h"
15 class nsIFile;
17 class nsDirectoryIndexStream final : public nsIInputStream {
18 private:
19 nsCString mBuf;
20 int32_t mOffset{0};
21 nsresult mStatus{NS_OK};
23 int32_t mPos{0}; // position within mArray
24 nsCOMArray<nsIFile> mArray; // file objects within the directory
26 nsDirectoryIndexStream();
27 /**
28 * aDir will only be used on the calling thread.
30 nsresult Init(nsIFile* aDir);
31 ~nsDirectoryIndexStream();
33 public:
34 /**
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__