nsStreamConverterService.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  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 __nsstreamconverterservice__h___
  6. #define __nsstreamconverterservice__h___
  7. #include "nsIStreamConverterService.h"
  8. #include "nsClassHashtable.h"
  9. #include "nsCOMArray.h"
  10. #include "nsTArrayForwardDeclare.h"
  11. class nsCString;
  12. class nsIAtom;
  13. class nsStreamConverterService : public nsIStreamConverterService {
  14. public:
  15. /////////////////////////////////////////////////////
  16. // nsISupports methods
  17. NS_DECL_ISUPPORTS
  18. /////////////////////////////////////////////////////
  19. // nsIStreamConverterService methods
  20. NS_DECL_NSISTREAMCONVERTERSERVICE
  21. /////////////////////////////////////////////////////
  22. // nsStreamConverterService methods
  23. nsStreamConverterService();
  24. private:
  25. virtual ~nsStreamConverterService();
  26. // Responsible for finding a converter for the given MIME-type.
  27. nsresult FindConverter(const char *aContractID, nsTArray<nsCString> **aEdgeList);
  28. nsresult BuildGraph(void);
  29. nsresult AddAdjacency(const char *aContractID);
  30. nsresult ParseFromTo(const char *aContractID, nsCString &aFromRes, nsCString &aToRes);
  31. // member variables
  32. nsClassHashtable<nsCStringHashKey, nsCOMArray<nsIAtom>> mAdjacencyList;
  33. };
  34. #endif // __nsstreamconverterservice__h___