Bug 492139 - Expose the Variant publicly so consumers can also use it
authorShawn Wilsher <sdwilsh@shawnwilsher.com>
Tue, 12 May 2009 17:08:49 -0400
changeset 28257 9afc23efcbba83d9fec156ec5ca10d8927d098ff
parent 28256 c77fa4f8082532ad9135b70d7ee5a855ec132480
child 28258 bb496ad42439848e392fa38f7fe56f653c52ef3c
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs492139
milestone1.9.2a1pre
Bug 492139 - Expose the Variant publicly so consumers can also use it This exposes the templated nsIVariant implementation that storage uses internally so that consumers can use it as well. r=bsmedberg
storage/public/Makefile.in
storage/public/mozStorageHelper.h
storage/public/storage.h
storage/src/Makefile.in
storage/src/Variant.cpp
storage/src/Variant.h
storage/src/mozStorageRow.cpp
storage/src/mozStorageVariant.cpp
storage/src/mozStorageVariant.h
--- a/storage/public/Makefile.in
+++ b/storage/public/Makefile.in
@@ -64,9 +64,13 @@ XPIDLSRCS = \
   mozIStoragePendingStatement.idl \
 	$(NULL)
 
 EXPORTS = \
 	mozStorageHelper.h \
 	mozStorage.h \
 	$(NULL)
 
+# TODO temp hack until build system handles this
+export:: storage.h
+	$(INSTALL) $^ $(DIST)/include/mozilla/storage
+
 include $(topsrcdir)/config/rules.mk
--- a/storage/public/mozStorageHelper.h
+++ b/storage/public/mozStorageHelper.h
@@ -34,16 +34,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef _MOZSTORAGEHELPER_H_
 #define _MOZSTORAGEHELPER_H_
 
+#include "nsAutoPtr.h"
+
 #include "mozIStorageConnection.h"
 #include "mozIStorageStatement.h"
 #include "mozStorage.h"
 
 
 /**
  * This class wraps a transaction inside a given C++ scope, guaranteeing that
  * the transaction will be completed even if you have an exception or
new file mode 100644
--- /dev/null
+++ b/storage/public/storage.h
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Storage code.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Shawn Wilsher <me@shawnwilsher.com> (Original Author)
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef mozilla_storage_h_
+#define mozilla_storage_h_
+
+////////////////////////////////////////////////////////////////////////////////
+//// Public Interfaces
+
+#include "mozIStorageAggregateFunction.h"
+#include "mozIStorageConnection.h"
+#include "mozIStorageError.h"
+#include "mozIStorageFunction.h"
+#include "mozIStoragePendingStatement.h"
+#include "mozIStorageProgressHandler.h"
+#include "mozIStorageResultSet.h"
+#include "mozIStorageRow.h"
+#include "mozIStorageService.h"
+#include "mozIStorageStatement.h"
+#include "mozIStorageStatementCallback.h"
+
+////////////////////////////////////////////////////////////////////////////////
+//// Native Language Helpers
+
+#include "mozStorageHelper.h"
+#include "mozStorageCID.h"
+
+#endif // mozilla_storage_h_
--- a/storage/src/Makefile.in
+++ b/storage/src/Makefile.in
@@ -71,19 +71,23 @@ CPPSRCS = \
   mozStorageArgValueArray.cpp \
   mozStorageSQLFunctions.cpp \
   mozStorageRow.cpp \
   mozStorageResultSet.cpp \
   mozStorageError.cpp \
   mozStorageAsyncStatementExecution.cpp \
   mozStorageStatementJSHelper.cpp \
   mozStoragePrivateHelpers.cpp \
-  mozStorageVariant.cpp \
+  Variant.cpp \
   $(NULL)
 
 LOCAL_INCLUDES = \
 	$(SQLITE_CFLAGS)
 
 # This is the default value.  If we ever change it when compiling sqlite, we
 # will need to change it here as well.
 DEFINES += -DSQLITE_MAX_LIKE_PATTERN_LENGTH=50000
 
+# TODO temp hack until build system handles this
+export:: Variant.h
+	$(INSTALL) $^ $(DIST)/include/mozilla/storage
+
 include $(topsrcdir)/config/rules.mk
rename from storage/src/mozStorageVariant.cpp
rename to storage/src/Variant.cpp
--- a/storage/src/mozStorageVariant.cpp
+++ b/storage/src/Variant.cpp
@@ -32,17 +32,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include "mozStorageVariant.h"
+#include "Variant.h"
 
 namespace mozilla {
 namespace storage {
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Variant_base
 
 NS_IMPL_THREADSAFE_ISUPPORTS1(
rename from storage/src/mozStorageVariant.h
rename to storage/src/Variant.h
--- a/storage/src/mozStorageRow.cpp
+++ b/storage/src/mozStorageRow.cpp
@@ -36,17 +36,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsString.h"
 
 #include "sqlite3.h"
 #include "mozStoragePrivateHelpers.h"
-#include "mozStorageVariant.h"
+#include "Variant.h"
 #include "mozStorageRow.h"
 
 namespace mozilla {
 namespace storage {
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Row