1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AOLEVARIANT_HXX
20 #define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AOLEVARIANT_HXX
22 #include <sal/types.h>
26 #include <rtl/ustring.hxx>
27 #include <com/sun/star/uno/Sequence.hxx>
29 #include "ado_pre_sys_include.h"
31 #include "ado_post_sys_include.h"
48 namespace connectivity
57 OLEString(const BSTR
& _sBStr
);
58 OLEString(const OUString
& _sBStr
);
59 OLEString(const OLEString
& _rRh
)
61 OLEString::operator=(_rRh
);
64 OLEString
& operator=(const OUString
& _rSrc
);
65 OLEString
& operator=(const BSTR
& _rSrc
);
66 OLEString
& operator=(const OLEString
& _rSrc
);
67 operator OUString() const;
68 operator BSTR() const;
70 sal_Int32
length() const;
73 class OLEVariant
: public ::tagVARIANT
77 OLEVariant(const VARIANT
& varSrc
);
78 OLEVariant(const OLEVariant
& varSrc
) ;
80 OLEVariant(sal_Bool
) SAL_DELETED_FUNCTION
;
81 OLEVariant(sal_Int8 n
) ;
82 OLEVariant(sal_Int16 n
) ;
83 OLEVariant(sal_Int32 n
) ;
84 OLEVariant(sal_Int64 x
) ;
86 OLEVariant(const OUString
& us
) ;
88 OLEVariant(const ::com::sun::star::util::Date
& x
);
89 OLEVariant(const ::com::sun::star::util::Time
& x
);
90 OLEVariant(const ::com::sun::star::util::DateTime
& x
);
91 OLEVariant(const float &x
);
92 OLEVariant(const double &x
);
93 OLEVariant(IDispatch
* pDispInterface
);
94 OLEVariant(const ::com::sun::star::uno::Sequence
< sal_Int8
>& x
);
95 OLEVariant
& operator=(const OLEVariant
& varSrc
);
96 // Assign a const VARIANT& (::VariantCopy handles everything)
98 OLEVariant
& operator=(const tagVARIANT
& varSrc
);
99 // Assign a const VARIANT* (::VariantCopy handles everything)
101 OLEVariant
& operator=(const VARIANT
* pSrc
);
102 void setByte(sal_uInt8 n
) ;
103 void setInt16(sal_Int16 n
) ;
104 void setInt32(sal_Int32 n
) ;
105 void setFloat(float f
) ;
106 void setDouble(double d
) ;
107 void setDate(DATE d
) ;
108 void setChar(unsigned char a
) ;
109 void setCurrency(double aCur
) ;
110 void setBool(sal_Bool b
) ;
111 void setString(const OUString
& us
) ;
114 void setIDispatch(IDispatch
* pDispInterface
);
118 void setUI1SAFEARRAYPtr(SAFEARRAY
* pSafeAr
);
119 void setArray(SAFEARRAY
* pSafeArray
, VARTYPE vtType
);
120 sal_Bool
isNull() const ;
121 sal_Bool
isEmpty() const ;
123 VARTYPE
getType() const ;
124 void ChangeType(VARTYPE vartype
, const OLEVariant
* pSrc
);
127 operator OUString() const;
129 operator bool() const { return getBool() == 1; }
130 operator sal_Bool() const { return getBool(); }
131 operator sal_Int8() const { return getInt8(); }
132 operator sal_Int16() const { return getInt16(); }
133 operator sal_Int32() const { return getInt32(); }
134 operator float() const { return getFloat(); }
135 operator double() const { return getDouble(); }
137 operator ::com::sun::star::uno::Sequence
< sal_Int8
>() const;
138 operator ::com::sun::star::util::Date() const ;
139 operator ::com::sun::star::util::Time() const ;
140 operator ::com::sun::star::util::DateTime()const ;
141 OUString
getString() const;
142 sal_Bool
getBool() const;
143 IUnknown
* getIUnknown() const;
144 IDispatch
* getIDispatch() const;
145 sal_uInt8
getByte() const;
146 sal_Int16
getInt16() const;
147 sal_Int8
getInt8() const;
148 sal_Int32
getInt32() const;
149 sal_uInt32
getUInt32() const;
150 float getFloat() const;
151 double getDouble() const;
152 double getDate() const;
153 CY
getCurrency() const;
154 SAFEARRAY
* getUI1SAFEARRAYPtr() const;
155 ::com::sun::star::uno::Any
makeAny() const;
157 static VARIANT_BOOL
VariantBool(sal_Bool bEinBoolean
);
168 #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AOLEVARIANT_HXX
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */