LibreOffice Module connectivity (master) 1
Aolevariant.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include <sal/types.h>
22#include <rtl/ustring.hxx>
23#include <com/sun/star/uno/Sequence.hxx>
24
25#include <oaidl.h>
26
28{
29 struct Date;
30 struct Time;
31 struct DateTime;
32}
33
34namespace connectivity::ado
35{
36 class OLEVariant : public ::tagVARIANT
37 {
38 public:
39 OLEVariant();
40 OLEVariant(const VARIANT& varSrc);
41 OLEVariant(const OLEVariant& varSrc) ;
42 OLEVariant(bool x) ;
45 OLEVariant(sal_Int16 n) ;
46 OLEVariant(sal_Int32 n) ;
47 OLEVariant(sal_Int64 x) ;
48
49 OLEVariant(std::u16string_view us);
50 OLEVariant(const OUString& us)
51 : OLEVariant(std::u16string_view(us))
52 {
53 }
54 ~OLEVariant() ;
55 OLEVariant(const css::util::Date& x );
56 OLEVariant(const css::util::Time& x );
57 OLEVariant(const css::util::DateTime& x );
58 OLEVariant(float x);
59 OLEVariant(const double &x);
60 OLEVariant(IDispatch* pDispInterface);
61 OLEVariant(const css::uno::Sequence< sal_Int8 >& x);
62 OLEVariant& operator=(const OLEVariant& varSrc);
63 // Assign a const VARIANT& (::VariantCopy handles everything)
64
65 OLEVariant& operator=(const tagVARIANT& varSrc);
66 // Assign a const VARIANT* (::VariantCopy handles everything)
67
68 OLEVariant& operator=(const VARIANT* pSrc);
69 void setByte(sal_uInt8 n) ;
70 void setInt16(sal_Int16 n) ;
71 void setInt32(sal_Int32 n) ;
72 void setFloat(float f) ;
73 void setDouble(double d) ;
74 void setDate(DATE d) ;
75 void setChar(unsigned char a) ;
76 void setCurrency(double aCur) ;
77 void setBool(bool b) ;
78 void setString(std::u16string_view us);
79 void setNoArg() ;
80
81 void setIDispatch(IDispatch* pDispInterface);
82 void setNull() ;
83 void setEmpty() ;
84
85 void setUI1SAFEARRAYPtr(SAFEARRAY* pSafeAr);
86 void setArray(SAFEARRAY* pSafeArray, VARTYPE vtType);
87 bool isNull() const ;
88 bool isEmpty() const ;
89
90 VARTYPE getType() const ;
91 void ChangeType(VARTYPE vartype, const OLEVariant* pSrc);
92
93 OUString getString() const;
94 bool getBool() const;
95 IUnknown* getIUnknown() const;
96 IDispatch* getIDispatch() const;
97 sal_uInt8 getByte() const;
98 sal_Int16 getInt16() const;
99 sal_Int8 getInt8() const;
100 sal_Int32 getInt32() const;
101 sal_uInt32 getUInt32() const;
102 float getFloat() const;
103 double getDouble() const;
104 double getDateAsDouble() const;
105 CY getCurrency() const;
106 css::util::Date getDate() const;
107 css::util::Time getTime() const;
108 css::util::DateTime getDateTime() const;
109 css::uno::Sequence<sal_Int8> getByteSequence() const;
110 SAFEARRAY* getUI1SAFEARRAYPtr() const;
111 css::uno::Any makeAny() const;
112
113 static VARIANT_BOOL VariantBool(bool bEinBoolean);
114
115 private:
116 void CHS();
117
118 void set(double n);
119
120 };
121}
122
123/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OLEVariant(const OUString &us)
Definition: Aolevariant.hxx:50
css::uno::Any makeAny() const
css::util::Date getDate() const
css::util::DateTime getDateTime() const
void setChar(unsigned char a)
void setCurrency(double aCur)
OLEVariant & operator=(const OLEVariant &varSrc)
void setString(std::u16string_view us)
css::util::Time getTime() const
SAFEARRAY * getUI1SAFEARRAYPtr() const
sal_uInt32 getUInt32() const
css::uno::Sequence< sal_Int8 > getByteSequence() const
void setArray(SAFEARRAY *pSafeArray, VARTYPE vtType)
static VARIANT_BOOL VariantBool(bool bEinBoolean)
void setUI1SAFEARRAYPtr(SAFEARRAY *pSafeAr)
void ChangeType(VARTYPE vartype, const OLEVariant *pSrc)
IDispatch * getIDispatch() const
IUnknown * getIUnknown() const
void setIDispatch(IDispatch *pDispInterface)
float x
unsigned char sal_uInt8
unsigned char sal_Bool
signed char sal_Int8