Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
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__ */ |