DirectoryProvider.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #ifndef DirectoryProvider_h__
  5. #define DirectoryProvider_h__
  6. #include "nsIDirectoryService.h"
  7. #include "nsComponentManagerUtils.h"
  8. #include "nsISimpleEnumerator.h"
  9. #include "nsIFile.h"
  10. #include "mozilla/Attributes.h"
  11. #define NS_BROWSERDIRECTORYPROVIDER_CONTRACTID \
  12. "@mozilla.org/browser/directory-provider;1"
  13. namespace mozilla {
  14. namespace browser {
  15. class DirectoryProvider final : public nsIDirectoryServiceProvider2
  16. {
  17. public:
  18. NS_DECL_ISUPPORTS
  19. NS_DECL_NSIDIRECTORYSERVICEPROVIDER
  20. NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
  21. private:
  22. ~DirectoryProvider() {}
  23. class AppendingEnumerator final : public nsISimpleEnumerator
  24. {
  25. public:
  26. NS_DECL_ISUPPORTS
  27. NS_DECL_NSISIMPLEENUMERATOR
  28. AppendingEnumerator(nsISimpleEnumerator* aBase,
  29. char const *const *aAppendList);
  30. private:
  31. ~AppendingEnumerator() {}
  32. nsCOMPtr<nsISimpleEnumerator> mBase;
  33. char const *const *const mAppendList;
  34. nsCOMPtr<nsIFile> mNext;
  35. };
  36. };
  37. } // namespace browser
  38. } // namespace mozilla
  39. #endif // DirectoryProvider_h__