netwerk/base/src/nsDirectoryIndexStream.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/src/nsDirectoryIndexStream.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,49 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsDirectoryIndexStream_h__
    1.10 +#define nsDirectoryIndexStream_h__
    1.11 +
    1.12 +#include "mozilla/Attributes.h"
    1.13 +
    1.14 +#include "nsString.h"
    1.15 +#include "nsIInputStream.h"
    1.16 +#include "nsCOMArray.h"
    1.17 +
    1.18 +class nsIFile;
    1.19 +
    1.20 +class nsDirectoryIndexStream MOZ_FINAL : public nsIInputStream
    1.21 +{
    1.22 +private:
    1.23 +    nsCString mBuf;
    1.24 +    int32_t mOffset;
    1.25 +    nsresult mStatus;
    1.26 +
    1.27 +    int32_t             mPos;   // position within mArray
    1.28 +    nsCOMArray<nsIFile> mArray; // file objects within the directory
    1.29 +
    1.30 +    nsDirectoryIndexStream();
    1.31 +    /**
    1.32 +     * aDir will only be used on the calling thread.
    1.33 +     */ 
    1.34 +    nsresult Init(nsIFile* aDir);
    1.35 +    ~nsDirectoryIndexStream();
    1.36 +
    1.37 +public:
    1.38 +    /**
    1.39 +     * aDir will only be used on the calling thread.
    1.40 +     */ 
    1.41 +    static nsresult
    1.42 +    Create(nsIFile* aDir, nsIInputStream** aStreamResult);
    1.43 +
    1.44 +    // nsISupportsInterface
    1.45 +    NS_DECL_THREADSAFE_ISUPPORTS
    1.46 +
    1.47 +    // nsIInputStream interface
    1.48 +    NS_DECL_NSIINPUTSTREAM
    1.49 +};
    1.50 +
    1.51 +#endif // nsDirectoryIndexStream_h__
    1.52 +

mercurial