2008-07-11 19:47:28 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2009-04-13 16:29:41 +00:00
|
|
|
* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
|
2012-05-21 11:12:37 +00:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2008-07-11 19:47:28 +00:00
|
|
|
|
2010-06-01 12:38:00 +00:00
|
|
|
#ifndef mozStorageResultSet_h
|
|
|
|
#define mozStorageResultSet_h
|
2008-07-11 19:47:28 +00:00
|
|
|
|
|
|
|
#include "mozIStorageResultSet.h"
|
|
|
|
#include "nsCOMArray.h"
|
2012-06-13 03:35:10 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2008-07-11 19:47:28 +00:00
|
|
|
class mozIStorageRow;
|
|
|
|
|
2009-05-09 00:29:56 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace storage {
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class ResultSet final : public mozIStorageResultSet
|
2008-07-11 19:47:28 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-07-19 02:24:15 +00:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2008-07-11 19:47:28 +00:00
|
|
|
NS_DECL_MOZISTORAGERESULTSET
|
|
|
|
|
2009-05-09 00:29:56 +00:00
|
|
|
ResultSet();
|
2008-07-11 19:47:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a tuple to this result set.
|
|
|
|
*/
|
|
|
|
nsresult add(mozIStorageRow *aTuple);
|
|
|
|
|
2008-10-29 17:13:32 +00:00
|
|
|
/**
|
|
|
|
* @returns the number of rows this result set holds.
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t rows() const { return mData.Count(); }
|
2008-10-29 17:13:32 +00:00
|
|
|
|
2008-07-11 19:47:28 +00:00
|
|
|
private:
|
2014-06-23 22:40:03 +00:00
|
|
|
~ResultSet();
|
|
|
|
|
2008-07-11 19:47:28 +00:00
|
|
|
/**
|
|
|
|
* Stores the current index of the active result set.
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mCurrentIndex;
|
2009-05-09 00:29:56 +00:00
|
|
|
|
2008-07-11 19:47:28 +00:00
|
|
|
/**
|
|
|
|
* Stores the tuples.
|
|
|
|
*/
|
|
|
|
nsCOMArray<mozIStorageRow> mData;
|
|
|
|
};
|
|
|
|
|
2009-05-09 00:29:56 +00:00
|
|
|
} // namespace storage
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2010-06-01 12:38:00 +00:00
|
|
|
#endif // mozStorageResultSet_h
|