Bug 492139 - Expose the Variant publicly so consumers can also use it

Actually makes this usable to things outside of the storage module.
r=bsmedberg

--HG--
rename : storage/src/Variant.cpp => storage/src/Variant_inl.h
This commit is contained in:
Shawn Wilsher 2009-06-11 13:18:58 -07:00
parent 3af60d783b
commit e175c575c5
3 changed files with 45 additions and 7 deletions

View File

@ -63,7 +63,10 @@ REQUIRES = xpcom \
EXPORTS_NAMESPACES = mozilla/storage
EXPORTS_mozilla/storage = Variant.h
EXPORTS_mozilla/storage = \
Variant.h \
Variant_inl.h \
$(NULL)
CPPSRCS = \
mozStorageService.cpp \
@ -80,7 +83,6 @@ CPPSRCS = \
mozStorageAsyncStatementExecution.cpp \
mozStorageStatementJSHelper.cpp \
mozStoragePrivateHelpers.cpp \
Variant.cpp \
$(NULL)
LOCAL_INCLUDES = \

View File

@ -37,8 +37,8 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef __mozStorageVariant_h__
#define __mozStorageVariant_h__
#ifndef mozilla_storage_Variant_h__
#define mozilla_storage_Variant_h__
#include <utility>
@ -366,4 +366,6 @@ typedef Variant_base NullVariant;
} // namespace storage
} // namespace mozilla
#endif // __mozStorageVariant_h__
#include "Variant_inl.h"
#endif // mozilla_storage_Variant_h__

View File

@ -37,7 +37,13 @@
*
* ***** END LICENSE BLOCK ***** */
#include "Variant.h"
/**
* Note: This file is included by Variant.h.
*/
#ifndef mozilla_storage_Variant_h__
#error "Do not include this file directly!"
#endif
namespace mozilla {
namespace storage {
@ -45,7 +51,9 @@ namespace storage {
////////////////////////////////////////////////////////////////////////////////
//// Variant_base
NS_IMPL_THREADSAFE_ISUPPORTS1(
inline NS_IMPL_THREADSAFE_ADDREF(Variant_base)
inline NS_IMPL_THREADSAFE_RELEASE(Variant_base)
inline NS_IMPL_THREADSAFE_QUERY_INTERFACE1(
Variant_base,
nsIVariant
)
@ -53,6 +61,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(
////////////////////////////////////////////////////////////////////////////////
//// nsIVariant
inline
NS_IMETHODIMP
Variant_base::GetDataType(PRUint16 *_type)
{
@ -60,36 +69,42 @@ Variant_base::GetDataType(PRUint16 *_type)
return NS_OK;
}
inline
NS_IMETHODIMP
Variant_base::GetAsInt32(PRInt32 *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsInt64(PRInt64 *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsDouble(double *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsAUTF8String(nsACString &)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsAString(nsAString &)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsArray(PRUint16 *,
nsIID *,
@ -99,96 +114,112 @@ Variant_base::GetAsArray(PRUint16 *,
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsInt8(PRUint8 *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsInt16(PRInt16 *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsUint8(PRUint8 *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsUint16(PRUint16 *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsUint32(PRUint32 *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsUint64(PRUint64 *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsFloat(float *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsBool(PRBool *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsChar(char *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsWChar(PRUnichar *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsID(nsID *)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsDOMString(nsAString &)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsString(char **)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsWString(PRUnichar **)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsISupports(nsISupports **)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsInterface(nsIID **,
void **)
@ -196,12 +227,14 @@ Variant_base::GetAsInterface(nsIID **,
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsACString(nsACString &)
{
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsStringWithSize(PRUint32 *,
char **)
@ -209,6 +242,7 @@ Variant_base::GetAsStringWithSize(PRUint32 *,
return NS_ERROR_CANNOT_CONVERT_DATA;
}
inline
NS_IMETHODIMP
Variant_base::GetAsWStringWithSize(PRUint32 *,
PRUnichar **)