Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 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 MOZ_FINAL : public nsIInputStream
18 {
19 private:
20 nsCString mBuf;
21 int32_t mOffset;
22 nsresult mStatus;
24 int32_t mPos; // position within mArray
25 nsCOMArray<nsIFile> mArray; // file objects within the directory
27 nsDirectoryIndexStream();
28 /**
29 * aDir will only be used on the calling thread.
30 */
31 nsresult Init(nsIFile* aDir);
32 ~nsDirectoryIndexStream();
34 public:
35 /**
36 * aDir will only be used on the calling thread.
37 */
38 static nsresult
39 Create(nsIFile* aDir, nsIInputStream** aStreamResult);
41 // nsISupportsInterface
42 NS_DECL_THREADSAFE_ISUPPORTS
44 // nsIInputStream interface
45 NS_DECL_NSIINPUTSTREAM
46 };
48 #endif // nsDirectoryIndexStream_h__