1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/streamconv/converters/nsFTPDirListingConv.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 +#ifndef __nsftpdirlistingdconv__h__ 1.9 +#define __nsftpdirlistingdconv__h__ 1.10 + 1.11 +#include "nsIStreamConverter.h" 1.12 +#include "nsString.h" 1.13 + 1.14 +class nsIURI; 1.15 + 1.16 +#define NS_FTPDIRLISTINGCONVERTER_CID \ 1.17 +{ /* 14C0E880-623E-11d3-A178-0050041CAF44 */ \ 1.18 + 0x14c0e880, \ 1.19 + 0x623e, \ 1.20 + 0x11d3, \ 1.21 + {0xa1, 0x78, 0x00, 0x50, 0x04, 0x1c, 0xaf, 0x44} \ 1.22 +} 1.23 + 1.24 +class nsFTPDirListingConv : public nsIStreamConverter { 1.25 +public: 1.26 + // nsISupports methods 1.27 + NS_DECL_ISUPPORTS 1.28 + 1.29 + // nsIStreamConverter methods 1.30 + NS_DECL_NSISTREAMCONVERTER 1.31 + 1.32 + // nsIStreamListener methods 1.33 + NS_DECL_NSISTREAMLISTENER 1.34 + 1.35 + // nsIRequestObserver methods 1.36 + NS_DECL_NSIREQUESTOBSERVER 1.37 + 1.38 + // nsFTPDirListingConv methods 1.39 + nsFTPDirListingConv(); 1.40 + virtual ~nsFTPDirListingConv(); 1.41 + nsresult Init(); 1.42 + 1.43 +private: 1.44 + // Get the application/http-index-format headers 1.45 + nsresult GetHeaders(nsACString& str, nsIURI* uri); 1.46 + char* DigestBufferLines(char *aBuffer, nsCString &aString); 1.47 + 1.48 + // member data 1.49 + nsCString mBuffer; // buffered data. 1.50 + bool mSentHeading; // have we sent 100, 101, 200, and 300 lines yet? 1.51 + 1.52 + nsIStreamListener *mFinalListener; // this guy gets the converted data via his OnDataAvailable() 1.53 +}; 1.54 + 1.55 +#endif /* __nsftpdirlistingdconv__h__ */