Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 :
6 : #ifndef nsXULTemplateQueryProcessorStorage_h__
7 : #define nsXULTemplateQueryProcessorStorage_h__
8 :
9 : #include "nsIXULTemplateBuilder.h"
10 : #include "nsIXULTemplateQueryProcessor.h"
11 :
12 : #include "nsISimpleEnumerator.h"
13 : #include "nsCOMArray.h"
14 : #include "nsIVariant.h"
15 :
16 : #include "mozIStorageValueArray.h"
17 : #include "mozIStorageStatement.h"
18 : #include "mozIStorageConnection.h"
19 : #include "mozilla/Attributes.h"
20 :
21 : class nsXULTemplateQueryProcessorStorage;
22 :
23 : class nsXULTemplateResultSetStorage final : public nsISimpleEnumerator
24 : {
25 : private:
26 :
27 : nsCOMPtr<mozIStorageStatement> mStatement;
28 :
29 : nsCOMArray<nsIAtom> mColumnNames;
30 :
31 0 : ~nsXULTemplateResultSetStorage() {}
32 :
33 : public:
34 :
35 : // nsISupports interface
36 : NS_DECL_ISUPPORTS
37 :
38 : // nsISimpleEnumerator interface
39 : NS_DECL_NSISIMPLEENUMERATOR
40 :
41 : explicit nsXULTemplateResultSetStorage(mozIStorageStatement* aStatement);
42 :
43 : int32_t GetColumnIndex(nsIAtom* aColumnName);
44 :
45 : void FillColumnValues(nsCOMArray<nsIVariant>& aArray);
46 :
47 : };
48 :
49 : class nsXULTemplateQueryProcessorStorage final : public nsIXULTemplateQueryProcessor
50 : {
51 : public:
52 :
53 : nsXULTemplateQueryProcessorStorage();
54 :
55 : // nsISupports interface
56 : NS_DECL_ISUPPORTS
57 :
58 : // nsIXULTemplateQueryProcessor interface
59 : NS_DECL_NSIXULTEMPLATEQUERYPROCESSOR
60 :
61 : private:
62 :
63 0 : ~nsXULTemplateQueryProcessorStorage() {}
64 :
65 : nsCOMPtr<mozIStorageConnection> mStorageConnection;
66 : bool mGenerationStarted;
67 : };
68 :
69 : #endif // nsXULTemplateQueryProcessorStorage_h__
|