2008-07-11 12:47:28 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2009-04-13 09:29:41 -07:00
|
|
|
* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
|
2012-05-21 04:12:37 -07: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 12:47:28 -07:00
|
|
|
|
2010-06-01 05:38:00 -07:00
|
|
|
#ifndef mozStorageRow_h
|
|
|
|
#define mozStorageRow_h
|
2008-07-11 12:47:28 -07:00
|
|
|
|
|
|
|
#include "mozIStorageRow.h"
|
|
|
|
#include "nsCOMArray.h"
|
|
|
|
#include "nsDataHashtable.h"
|
2012-06-12 20:35:10 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2008-07-11 12:47:28 -07:00
|
|
|
class nsIVariant;
|
|
|
|
struct sqlite3_stmt;
|
|
|
|
|
2009-05-08 17:29:56 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace storage {
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
class Row final : public mozIStorageRow
|
2008-07-11 12:47:28 -07:00
|
|
|
{
|
|
|
|
public:
|
2013-07-18 19:24:15 -07:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2008-07-11 12:47:28 -07:00
|
|
|
NS_DECL_MOZISTORAGEROW
|
|
|
|
NS_DECL_MOZISTORAGEVALUEARRAY
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initializes the object with the given statement. Copies the values from
|
|
|
|
* the statement.
|
|
|
|
*
|
|
|
|
* @param aStatement
|
|
|
|
* The sqlite statement to pull results from.
|
|
|
|
*/
|
|
|
|
nsresult initialize(sqlite3_stmt *aStatement);
|
|
|
|
|
|
|
|
private:
|
2014-06-23 15:40:03 -07:00
|
|
|
~Row() {}
|
|
|
|
|
2008-07-11 12:47:28 -07:00
|
|
|
/**
|
|
|
|
* The number of columns in this tuple.
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mNumCols;
|
2008-07-11 12:47:28 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Stores the data in the tuple.
|
|
|
|
*/
|
|
|
|
nsCOMArray<nsIVariant> mData;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps a given name to a column index.
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
nsDataHashtable<nsCStringHashKey, uint32_t> mNameHashtable;
|
2008-07-11 12:47:28 -07:00
|
|
|
};
|
|
|
|
|
2009-05-08 17:29:56 -07:00
|
|
|
} // namespace storage
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2010-06-01 05:38:00 -07:00
|
|
|
#endif // mozStorageRow_h
|