michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef __nsftpdirlistingdconv__h__ michael@0: #define __nsftpdirlistingdconv__h__ michael@0: michael@0: #include "nsIStreamConverter.h" michael@0: #include "nsString.h" michael@0: michael@0: class nsIURI; michael@0: michael@0: #define NS_FTPDIRLISTINGCONVERTER_CID \ michael@0: { /* 14C0E880-623E-11d3-A178-0050041CAF44 */ \ michael@0: 0x14c0e880, \ michael@0: 0x623e, \ michael@0: 0x11d3, \ michael@0: {0xa1, 0x78, 0x00, 0x50, 0x04, 0x1c, 0xaf, 0x44} \ michael@0: } michael@0: michael@0: class nsFTPDirListingConv : public nsIStreamConverter { michael@0: public: michael@0: // nsISupports methods michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: // nsIStreamConverter methods michael@0: NS_DECL_NSISTREAMCONVERTER michael@0: michael@0: // nsIStreamListener methods michael@0: NS_DECL_NSISTREAMLISTENER michael@0: michael@0: // nsIRequestObserver methods michael@0: NS_DECL_NSIREQUESTOBSERVER michael@0: michael@0: // nsFTPDirListingConv methods michael@0: nsFTPDirListingConv(); michael@0: virtual ~nsFTPDirListingConv(); michael@0: nsresult Init(); michael@0: michael@0: private: michael@0: // Get the application/http-index-format headers michael@0: nsresult GetHeaders(nsACString& str, nsIURI* uri); michael@0: char* DigestBufferLines(char *aBuffer, nsCString &aString); michael@0: michael@0: // member data michael@0: nsCString mBuffer; // buffered data. michael@0: bool mSentHeading; // have we sent 100, 101, 200, and 300 lines yet? michael@0: michael@0: nsIStreamListener *mFinalListener; // this guy gets the converted data via his OnDataAvailable() michael@0: }; michael@0: michael@0: #endif /* __nsftpdirlistingdconv__h__ */