Update ooo320-m1
[ooovba.git] / basic / source / sbx / sbxconv.hxx
blob2429839be23ed8c1ebadba193c9487dfa9ac4fcb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sbxconv.hxx,v $
10 * $Revision: 1.6 $
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 ************************************************************************/
31 #ifndef _SBXCONV_HXX
32 #define _SBXCONV_HXX
34 #include "sbxdec.hxx"
36 class SbxArray;
38 // SBXSCAN.CXX
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 );
47 // SBXINT.CXX
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 );
61 // SBXLNG.CXX
63 INT32 ImpGetLong( const SbxValues* );
64 void ImpPutLong( SbxValues*, INT32 );
66 // SBXSNG.CXX
68 float ImpGetSingle( const SbxValues* );
69 void ImpPutSingle( SbxValues*, float );
71 // SBXDBL.CXX
73 double ImpGetDouble( const SbxValues* );
74 void ImpPutDouble( SbxValues*, double, BOOL bCoreString=FALSE );
76 #if FALSE
77 // SBX64.CXX
79 SbxINT64 ImpGetINT64( const SbxValues* );
80 void ImpPutINT64( SbxValues*, const SbxINT64& );
81 SbxUINT64 ImpGetUINT64( const SbxValues* );
82 void ImpPutUINT64( SbxValues*, const SbxUINT64& );
83 #endif
85 // SBXCURR.CXX
87 SbxUINT64 ImpDoubleToUINT64( double );
88 double ImpUINT64ToDouble( const SbxUINT64& );
89 SbxINT64 ImpDoubleToINT64( double );
90 double ImpINT64ToDouble( const SbxINT64& );
92 #if TRUE
93 INT32 ImpGetCurrLong( const SbxValues* );
94 void ImpPutCurrLong( SbxValues*, INT32 );
95 INT32 ImpDoubleToCurrLong( double );
96 double ImpCurrLongToDouble( INT32 );
97 #endif
99 SbxINT64 ImpGetCurrency( const SbxValues* );
100 void ImpPutCurrency( SbxValues*, const SbxINT64& );
101 inline
102 SbxINT64 ImpDoubleToCurrency( double d )
103 { return ImpDoubleToINT64( d * CURRENCY_FACTOR ); }
104 inline
105 double ImpCurrencyToDouble( const SbxINT64 &r )
106 { return ImpINT64ToDouble( r ) / CURRENCY_FACTOR; }
109 // SBXDEC.CXX
111 SbxDecimal* ImpCreateDecimal( SbxValues* p );
112 SbxDecimal* ImpGetDecimal( const SbxValues* p );
113 void ImpPutDecimal( SbxValues* p, SbxDecimal* pDec );
115 // SBXDATE.CXX
117 double ImpGetDate( const SbxValues* );
118 void ImpPutDate( SbxValues*, double );
120 // SBXSTR.CXX
122 String ImpGetString( const SbxValues* );
123 String ImpGetCoreString( const SbxValues* );
124 void ImpPutString( SbxValues*, const String* );
126 // SBXCHAR.CXX
128 sal_Unicode ImpGetChar( const SbxValues* );
129 void ImpPutChar( SbxValues*, sal_Unicode );
131 // SBXBYTE.CXX
132 BYTE ImpGetByte( const SbxValues* );
133 void ImpPutByte( SbxValues*, BYTE );
135 // SBXUINT.CXX
137 UINT16 ImpGetUShort( const SbxValues* );
138 void ImpPutUShort( SbxValues*, UINT16 );
140 // SBXULNG.CXX
142 UINT32 ImpGetULong( const SbxValues* );
143 void ImpPutULong( SbxValues*, UINT32 );
145 // SBXBOOL.CXX
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);
154 #endif