nsArrayEnumerator.h 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. /* -*- Mode: C++; tab-width: 8; 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 nsArrayEnumerator_h__
  6. #define nsArrayEnumerator_h__
  7. // enumerator implementation for nsIArray
  8. #include "nscore.h"
  9. class nsISimpleEnumerator;
  10. class nsIArray;
  11. class nsCOMArray_base;
  12. // Create an enumerator for an existing nsIArray implementation
  13. // The enumerator holds an owning reference to the array.
  14. nsresult
  15. NS_NewArrayEnumerator(nsISimpleEnumerator** aResult,
  16. nsIArray* aArray);
  17. // create an enumerator for an existing nsCOMArray<T> implementation
  18. // The enumerator will hold an owning reference to each ELEMENT in
  19. // the array. This means that the nsCOMArray<T> can safely go away
  20. // without its objects going away.
  21. nsresult
  22. NS_NewArrayEnumerator(nsISimpleEnumerator** aResult,
  23. const nsCOMArray_base& aArray);
  24. #endif