2018-11-30 19:52:05 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-09-13 20:20:21 +00:00
|
|
|
|
|
|
|
#ifndef nsDirectoryIndexStream_h__
|
|
|
|
#define nsDirectoryIndexStream_h__
|
|
|
|
|
2011-12-18 03:47:45 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
|
1999-09-13 20:20:21 +00:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsIInputStream.h"
|
2006-03-30 03:02:59 +00:00
|
|
|
#include "nsCOMArray.h"
|
2013-09-22 03:04:57 +00:00
|
|
|
|
|
|
|
class nsIFile;
|
1999-09-13 20:20:21 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class nsDirectoryIndexStream final : public nsIInputStream {
|
2006-01-02 02:30:32 +00:00
|
|
|
private:
|
2008-06-30 18:46:47 +00:00
|
|
|
nsCString mBuf;
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mOffset;
|
2006-01-02 02:30:32 +00:00
|
|
|
nsresult mStatus;
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mPos; // position within mArray
|
2006-03-30 03:02:59 +00:00
|
|
|
nsCOMArray<nsIFile> mArray; // file objects within the directory
|
2018-11-30 10:46:48 +00:00
|
|
|
|
1999-09-13 20:20:21 +00:00
|
|
|
nsDirectoryIndexStream();
|
2003-11-05 12:39:05 +00:00
|
|
|
/**
|
|
|
|
* aDir will only be used on the calling thread.
|
2017-07-06 12:00:35 +00:00
|
|
|
*/
|
2000-01-24 21:28:28 +00:00
|
|
|
nsresult Init(nsIFile* aDir);
|
2006-01-02 02:30:32 +00:00
|
|
|
~nsDirectoryIndexStream();
|
2018-11-30 10:46:48 +00:00
|
|
|
|
1999-09-13 20:20:21 +00:00
|
|
|
public:
|
2003-11-05 12:39:05 +00:00
|
|
|
/**
|
|
|
|
* aDir will only be used on the calling thread.
|
2017-07-06 12:00:35 +00:00
|
|
|
*/
|
2000-01-24 21:28:28 +00:00
|
|
|
static nsresult Create(nsIFile* aDir, nsIInputStream** aStreamResult);
|
2018-11-30 10:46:48 +00:00
|
|
|
|
1999-09-13 20:20:21 +00:00
|
|
|
// nsISupportsInterface
|
2013-07-19 02:24:13 +00:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2018-11-30 10:46:48 +00:00
|
|
|
|
1999-09-13 20:20:21 +00:00
|
|
|
// nsIInputStream interface
|
|
|
|
NS_DECL_NSIINPUTSTREAM
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsDirectoryIndexStream_h__
|