netwerk/streamconv/converters/nsFTPDirListingConv.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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: 2; 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/. */
     5 #ifndef __nsftpdirlistingdconv__h__
     6 #define __nsftpdirlistingdconv__h__
     8 #include "nsIStreamConverter.h"
     9 #include "nsString.h"
    11 class nsIURI;
    13 #define NS_FTPDIRLISTINGCONVERTER_CID                         \
    14 { /* 14C0E880-623E-11d3-A178-0050041CAF44 */         \
    15     0x14c0e880,                                      \
    16     0x623e,                                          \
    17     0x11d3,                                          \
    18     {0xa1, 0x78, 0x00, 0x50, 0x04, 0x1c, 0xaf, 0x44}       \
    19 }
    21 class nsFTPDirListingConv : public nsIStreamConverter {
    22 public:
    23     // nsISupports methods
    24     NS_DECL_ISUPPORTS
    26     // nsIStreamConverter methods
    27     NS_DECL_NSISTREAMCONVERTER
    29     // nsIStreamListener methods
    30     NS_DECL_NSISTREAMLISTENER
    32     // nsIRequestObserver methods
    33     NS_DECL_NSIREQUESTOBSERVER
    35     // nsFTPDirListingConv methods
    36     nsFTPDirListingConv();
    37     virtual ~nsFTPDirListingConv();
    38     nsresult Init();
    40 private:
    41     // Get the application/http-index-format headers
    42     nsresult GetHeaders(nsACString& str, nsIURI* uri);
    43     char*    DigestBufferLines(char *aBuffer, nsCString &aString);
    45     // member data
    46     nsCString           mBuffer;            // buffered data.
    47     bool                mSentHeading;       // have we sent 100, 101, 200, and 300 lines yet?
    49     nsIStreamListener   *mFinalListener; // this guy gets the converted data via his OnDataAvailable()
    50 };
    52 #endif /* __nsftpdirlistingdconv__h__ */

mercurial