Thu, 15 Jan 2015 21:03:48 +0100
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: 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__ */