nsFTPDirListingConv.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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__
  7. #include "nsIStreamConverter.h"
  8. #include "nsString.h"
  9. class nsIURI;
  10. #define NS_FTPDIRLISTINGCONVERTER_CID \
  11. { /* 14C0E880-623E-11d3-A178-0050041CAF44 */ \
  12. 0x14c0e880, \
  13. 0x623e, \
  14. 0x11d3, \
  15. {0xa1, 0x78, 0x00, 0x50, 0x04, 0x1c, 0xaf, 0x44} \
  16. }
  17. class nsFTPDirListingConv : public nsIStreamConverter {
  18. public:
  19. // nsISupports methods
  20. NS_DECL_ISUPPORTS
  21. // nsIStreamConverter methods
  22. NS_DECL_NSISTREAMCONVERTER
  23. // nsIStreamListener methods
  24. NS_DECL_NSISTREAMLISTENER
  25. // nsIRequestObserver methods
  26. NS_DECL_NSIREQUESTOBSERVER
  27. // nsFTPDirListingConv methods
  28. nsFTPDirListingConv();
  29. private:
  30. virtual ~nsFTPDirListingConv();
  31. // Get the application/http-index-format headers
  32. nsresult GetHeaders(nsACString& str, nsIURI* uri);
  33. char* DigestBufferLines(char *aBuffer, nsCString &aString);
  34. // member data
  35. nsCString mBuffer; // buffered data.
  36. bool mSentHeading; // have we sent 100, 101, 200, and 300 lines yet?
  37. nsIStreamListener *mFinalListener; // this guy gets the converted data via his OnDataAvailable()
  38. };
  39. #endif /* __nsftpdirlistingdconv__h__ */