1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/glue/nsArrayEnumerator.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,31 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; 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 + 1.9 +#ifndef nsArrayEnumerator_h__ 1.10 +#define nsArrayEnumerator_h__ 1.11 + 1.12 +// enumerator implementation for nsIArray 1.13 + 1.14 +#include "nscore.h" 1.15 + 1.16 +class nsISimpleEnumerator; 1.17 +class nsIArray; 1.18 +class nsCOMArray_base; 1.19 + 1.20 +// Create an enumerator for an existing nsIArray implementation 1.21 +// The enumerator holds an owning reference to the array. 1.22 +NS_COM_GLUE nsresult 1.23 +NS_NewArrayEnumerator(nsISimpleEnumerator* *result, 1.24 + nsIArray* array); 1.25 + 1.26 +// create an enumerator for an existing nsCOMArray<T> implementation 1.27 +// The enumerator will hold an owning reference to each ELEMENT in 1.28 +// the array. This means that the nsCOMArray<T> can safely go away 1.29 +// without its objects going away. 1.30 +NS_COM_GLUE nsresult 1.31 +NS_NewArrayEnumerator(nsISimpleEnumerator* *aResult, 1.32 + const nsCOMArray_base& aArray); 1.33 + 1.34 +#endif