netwerk/streamconv/converters/nsFTPDirListingConv.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.)

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5 #ifndef __nsftpdirlistingdconv__h__
michael@0 6 #define __nsftpdirlistingdconv__h__
michael@0 7
michael@0 8 #include "nsIStreamConverter.h"
michael@0 9 #include "nsString.h"
michael@0 10
michael@0 11 class nsIURI;
michael@0 12
michael@0 13 #define NS_FTPDIRLISTINGCONVERTER_CID \
michael@0 14 { /* 14C0E880-623E-11d3-A178-0050041CAF44 */ \
michael@0 15 0x14c0e880, \
michael@0 16 0x623e, \
michael@0 17 0x11d3, \
michael@0 18 {0xa1, 0x78, 0x00, 0x50, 0x04, 0x1c, 0xaf, 0x44} \
michael@0 19 }
michael@0 20
michael@0 21 class nsFTPDirListingConv : public nsIStreamConverter {
michael@0 22 public:
michael@0 23 // nsISupports methods
michael@0 24 NS_DECL_ISUPPORTS
michael@0 25
michael@0 26 // nsIStreamConverter methods
michael@0 27 NS_DECL_NSISTREAMCONVERTER
michael@0 28
michael@0 29 // nsIStreamListener methods
michael@0 30 NS_DECL_NSISTREAMLISTENER
michael@0 31
michael@0 32 // nsIRequestObserver methods
michael@0 33 NS_DECL_NSIREQUESTOBSERVER
michael@0 34
michael@0 35 // nsFTPDirListingConv methods
michael@0 36 nsFTPDirListingConv();
michael@0 37 virtual ~nsFTPDirListingConv();
michael@0 38 nsresult Init();
michael@0 39
michael@0 40 private:
michael@0 41 // Get the application/http-index-format headers
michael@0 42 nsresult GetHeaders(nsACString& str, nsIURI* uri);
michael@0 43 char* DigestBufferLines(char *aBuffer, nsCString &aString);
michael@0 44
michael@0 45 // member data
michael@0 46 nsCString mBuffer; // buffered data.
michael@0 47 bool mSentHeading; // have we sent 100, 101, 200, and 300 lines yet?
michael@0 48
michael@0 49 nsIStreamListener *mFinalListener; // this guy gets the converted data via his OnDataAvailable()
michael@0 50 };
michael@0 51
michael@0 52 #endif /* __nsftpdirlistingdconv__h__ */

mercurial