netwerk/streamconv/converters/nsIndexedToHTML.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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 ____nsindexedtohtml___h___
     7 #define ____nsindexedtohtml___h___
     9 #include "nsCOMPtr.h"
    10 #include "nsString.h"
    11 #include "nsIStreamConverter.h"
    12 #include "nsIDirIndexListener.h"
    14 #define NS_NSINDEXEDTOHTMLCONVERTER_CID \
    15 { 0xcf0f71fd, 0xfafd, 0x4e2b, {0x9f, 0xdc, 0x13, 0x4d, 0x97, 0x2e, 0x16, 0xe2} }
    17 class nsIDateTimeFormat;
    18 class nsIStringBundle;
    19 class nsITextToSubURI;
    20 class nsIUnicodeEncoder;
    22 class nsIndexedToHTML : public nsIStreamConverter,
    23                         public nsIDirIndexListener
    24 {
    25 public:
    26     NS_DECL_ISUPPORTS
    27     NS_DECL_NSISTREAMCONVERTER
    28     NS_DECL_NSIREQUESTOBSERVER
    29     NS_DECL_NSISTREAMLISTENER
    30     NS_DECL_NSIDIRINDEXLISTENER
    32     nsIndexedToHTML();
    33     virtual ~nsIndexedToHTML();
    35     nsresult Init(nsIStreamListener *aListener);
    37     static nsresult
    38     Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
    40 protected:
    42     void FormatSizeString(int64_t inSize, nsCString& outSizeString);
    43     nsresult SendToListener(nsIRequest* aRequest, nsISupports *aContext, const nsACString &aBuffer);
    44     // Helper to properly implement OnStartRequest
    45     nsresult DoOnStartRequest(nsIRequest* request, nsISupports *aContext,
    46                               nsCString& aBuffer);
    48 protected:
    49     nsCOMPtr<nsIDirIndexParser>     mParser;
    50     nsCOMPtr<nsIStreamListener>     mListener; // final listener (consumer)
    52     nsCOMPtr<nsIDateTimeFormat> mDateTime;
    53     nsCOMPtr<nsIStringBundle> mBundle;
    55     nsCOMPtr<nsITextToSubURI> mTextToSubURI;
    56     nsCOMPtr<nsIUnicodeEncoder> mUnicodeEncoder;
    58 private:
    59     // Expecting absolute locations, given by 201 lines.
    60     bool mExpectAbsLoc;
    61 };
    63 #endif

mercurial