2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
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"
|
|
|
|
|
2000-01-24 21:28:28 +00:00
|
|
|
#include "nsIFile.h"
|
1999-09-13 20:20:21 +00:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsIInputStream.h"
|
2000-01-24 21:28:28 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2006-03-30 03:02:59 +00:00
|
|
|
#include "nsCOMArray.h"
|
2001-10-03 00:43:30 +00:00
|
|
|
#include "nsITextToSubURI.h"
|
1999-09-13 20:20:21 +00:00
|
|
|
|
2011-12-18 03:47:45 +00:00
|
|
|
class nsDirectoryIndexStream MOZ_FINAL : public nsIInputStream
|
1999-09-13 20:20:21 +00:00
|
|
|
{
|
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;
|
1999-09-13 20:20:21 +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
|
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.
|
|
|
|
*/
|
2000-01-24 21:28:28 +00:00
|
|
|
nsresult Init(nsIFile* aDir);
|
2006-01-02 02:30:32 +00:00
|
|
|
~nsDirectoryIndexStream();
|
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.
|
|
|
|
*/
|
1999-09-13 20:20:21 +00:00
|
|
|
static nsresult
|
2000-01-24 21:28:28 +00:00
|
|
|
Create(nsIFile* aDir, nsIInputStream** aStreamResult);
|
1999-09-13 20:20:21 +00:00
|
|
|
|
|
|
|
// nsISupportsInterface
|
2013-07-19 02:24:13 +00:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
1999-09-13 20:20:21 +00:00
|
|
|
|
|
|
|
// nsIInputStream interface
|
|
|
|
NS_DECL_NSIINPUTSTREAM
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsDirectoryIndexStream_h__
|
|
|
|
|