mozStorageResultSet.h (1140B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ : 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozStorageResultSet_h 8 #define mozStorageResultSet_h 9 10 #include "mozIStorageResultSet.h" 11 #include "nsCOMArray.h" 12 class mozIStorageRow; 13 14 namespace mozilla { 15 namespace storage { 16 17 class ResultSet final : public mozIStorageResultSet { 18 public: 19 NS_DECL_THREADSAFE_ISUPPORTS 20 NS_DECL_MOZISTORAGERESULTSET 21 22 ResultSet(); 23 24 /** 25 * Adds a tuple to this result set. 26 */ 27 nsresult add(mozIStorageRow* aTuple); 28 29 /** 30 * @returns the number of rows this result set holds. 31 */ 32 int32_t rows() const { return mData.Count(); } 33 34 private: 35 ~ResultSet(); 36 37 /** 38 * Stores the current index of the active result set. 39 */ 40 int32_t mCurrentIndex; 41 42 /** 43 * Stores the tuples. 44 */ 45 nsCOMArray<mozIStorageRow> mData; 46 }; 47 48 } // namespace storage 49 } // namespace mozilla 50 51 #endif // mozStorageResultSet_h