1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is mozilla.org code.
18 * The Initial Developer of the Original Code is
20 * Portions created by the Initial Developer are Copyright (C) 2008
21 * the Initial Developer. All Rights Reserved.
24 * Shawn Wilsher <me@shawnwilsher.com> (Original Author)
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
41 * Note: This file is included by Variant.h.
44 #ifndef mozilla_storage_Variant_h__
45 #error "Do not include this file directly!"
51 ////////////////////////////////////////////////////////////////////////////////
54 inline NS_IMPL_THREADSAFE_ADDREF(Variant_base
)
55 inline NS_IMPL_THREADSAFE_RELEASE(Variant_base
)
56 inline NS_IMPL_THREADSAFE_QUERY_INTERFACE1(
61 ////////////////////////////////////////////////////////////////////////////////
66 Variant_base::GetDataType(PRUint16
*_type
)
68 NS_ENSURE_ARG_POINTER(_type
);
69 *_type
= nsIDataType::VTYPE_VOID
;
75 Variant_base::GetAsInt32(PRInt32
*)
77 return NS_ERROR_CANNOT_CONVERT_DATA
;
82 Variant_base::GetAsInt64(PRInt64
*)
84 return NS_ERROR_CANNOT_CONVERT_DATA
;
89 Variant_base::GetAsDouble(double *)
91 return NS_ERROR_CANNOT_CONVERT_DATA
;
96 Variant_base::GetAsAUTF8String(nsACString
&)
98 return NS_ERROR_CANNOT_CONVERT_DATA
;
103 Variant_base::GetAsAString(nsAString
&)
105 return NS_ERROR_CANNOT_CONVERT_DATA
;
110 Variant_base::GetAsArray(PRUint16
*,
115 return NS_ERROR_CANNOT_CONVERT_DATA
;
120 Variant_base::GetAsInt8(PRUint8
*)
122 return NS_ERROR_CANNOT_CONVERT_DATA
;
127 Variant_base::GetAsInt16(PRInt16
*)
129 return NS_ERROR_CANNOT_CONVERT_DATA
;
134 Variant_base::GetAsUint8(PRUint8
*)
136 return NS_ERROR_CANNOT_CONVERT_DATA
;
141 Variant_base::GetAsUint16(PRUint16
*)
143 return NS_ERROR_CANNOT_CONVERT_DATA
;
148 Variant_base::GetAsUint32(PRUint32
*)
150 return NS_ERROR_CANNOT_CONVERT_DATA
;
155 Variant_base::GetAsUint64(PRUint64
*)
157 return NS_ERROR_CANNOT_CONVERT_DATA
;
162 Variant_base::GetAsFloat(float *)
164 return NS_ERROR_CANNOT_CONVERT_DATA
;
169 Variant_base::GetAsBool(PRBool
*)
171 return NS_ERROR_CANNOT_CONVERT_DATA
;
176 Variant_base::GetAsChar(char *)
178 return NS_ERROR_CANNOT_CONVERT_DATA
;
183 Variant_base::GetAsWChar(PRUnichar
*)
185 return NS_ERROR_CANNOT_CONVERT_DATA
;
190 Variant_base::GetAsID(nsID
*)
192 return NS_ERROR_CANNOT_CONVERT_DATA
;
197 Variant_base::GetAsDOMString(nsAString
&)
199 return NS_ERROR_CANNOT_CONVERT_DATA
;
204 Variant_base::GetAsString(char **)
206 return NS_ERROR_CANNOT_CONVERT_DATA
;
211 Variant_base::GetAsWString(PRUnichar
**)
213 return NS_ERROR_CANNOT_CONVERT_DATA
;
218 Variant_base::GetAsISupports(nsISupports
**)
220 return NS_ERROR_CANNOT_CONVERT_DATA
;
225 Variant_base::GetAsInterface(nsIID
**,
228 return NS_ERROR_CANNOT_CONVERT_DATA
;
233 Variant_base::GetAsACString(nsACString
&)
235 return NS_ERROR_CANNOT_CONVERT_DATA
;
240 Variant_base::GetAsStringWithSize(PRUint32
*,
243 return NS_ERROR_CANNOT_CONVERT_DATA
;
248 Variant_base::GetAsWStringWithSize(PRUint32
*,
251 return NS_ERROR_CANNOT_CONVERT_DATA
;
256 Variant_base::GetAsJSVal(jsval
*)
258 return NS_ERROR_CANNOT_CONVERT_DATA
;
261 } // namespace storage
262 } // namespace mozilla