1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sbxconv.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
39 extern void ImpCvtNum( double nNum
, short nPrec
, String
& rRes
, BOOL bCoreString
=FALSE
);
40 extern SbxError ImpScan
41 ( const String
& rSrc
, double& nVal
, SbxDataType
& rType
, USHORT
* pLen
,
42 BOOL bAllowIntntl
=FALSE
, BOOL bOnlyIntntl
=FALSE
);
44 // mit erweiterter Auswertung (International, "TRUE"/"FALSE")
45 extern BOOL
ImpConvStringExt( String
& rSrc
, SbxDataType eTargetType
);
49 double ImpRound( double );
50 INT16
ImpGetInteger( const SbxValues
* );
51 void ImpPutInteger( SbxValues
*, INT16
);
52 sal_Int64
ImpGetInt64( const SbxValues
* );
53 void ImpPutInt64( SbxValues
*, sal_Int64
);
54 sal_uInt64
ImpGetUInt64( const SbxValues
* );
55 void ImpPutUInt64( SbxValues
*, sal_uInt64
);
57 sal_Int64
ImpDoubleToSalInt64( double d
);
58 sal_uInt64
ImpDoubleToSalUInt64( double d
);
59 double ImpSalUInt64ToDouble( sal_uInt64 n
);
63 INT32
ImpGetLong( const SbxValues
* );
64 void ImpPutLong( SbxValues
*, INT32
);
68 float ImpGetSingle( const SbxValues
* );
69 void ImpPutSingle( SbxValues
*, float );
73 double ImpGetDouble( const SbxValues
* );
74 void ImpPutDouble( SbxValues
*, double, BOOL bCoreString
=FALSE
);
79 SbxINT64
ImpGetINT64( const SbxValues
* );
80 void ImpPutINT64( SbxValues
*, const SbxINT64
& );
81 SbxUINT64
ImpGetUINT64( const SbxValues
* );
82 void ImpPutUINT64( SbxValues
*, const SbxUINT64
& );
87 SbxUINT64
ImpDoubleToUINT64( double );
88 double ImpUINT64ToDouble( const SbxUINT64
& );
89 SbxINT64
ImpDoubleToINT64( double );
90 double ImpINT64ToDouble( const SbxINT64
& );
93 INT32
ImpGetCurrLong( const SbxValues
* );
94 void ImpPutCurrLong( SbxValues
*, INT32
);
95 INT32
ImpDoubleToCurrLong( double );
96 double ImpCurrLongToDouble( INT32
);
99 SbxINT64
ImpGetCurrency( const SbxValues
* );
100 void ImpPutCurrency( SbxValues
*, const SbxINT64
& );
102 SbxINT64
ImpDoubleToCurrency( double d
)
103 { return ImpDoubleToINT64( d
* CURRENCY_FACTOR
); }
105 double ImpCurrencyToDouble( const SbxINT64
&r
)
106 { return ImpINT64ToDouble( r
) / CURRENCY_FACTOR
; }
111 SbxDecimal
* ImpCreateDecimal( SbxValues
* p
);
112 SbxDecimal
* ImpGetDecimal( const SbxValues
* p
);
113 void ImpPutDecimal( SbxValues
* p
, SbxDecimal
* pDec
);
117 double ImpGetDate( const SbxValues
* );
118 void ImpPutDate( SbxValues
*, double );
122 String
ImpGetString( const SbxValues
* );
123 String
ImpGetCoreString( const SbxValues
* );
124 void ImpPutString( SbxValues
*, const String
* );
128 sal_Unicode
ImpGetChar( const SbxValues
* );
129 void ImpPutChar( SbxValues
*, sal_Unicode
);
132 BYTE
ImpGetByte( const SbxValues
* );
133 void ImpPutByte( SbxValues
*, BYTE
);
137 UINT16
ImpGetUShort( const SbxValues
* );
138 void ImpPutUShort( SbxValues
*, UINT16
);
142 UINT32
ImpGetULong( const SbxValues
* );
143 void ImpPutULong( SbxValues
*, UINT32
);
147 enum SbxBOOL
ImpGetBool( const SbxValues
* );
148 void ImpPutBool( SbxValues
*, INT16
);
150 // ByteArry <--> String
151 SbxArray
* StringToByteArray(const String
& rStr
);
152 String
ByteArrayToString(SbxArray
* pArr
);