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: svstdarr.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 ************************************************************************/
32 #include <bf_svtools/svarray.hxx>
36 #include <tools/string.hxx>
42 //#ifdef _SVSTDARR_BOOLS
43 #ifndef _SVSTDARR_BOOLS_DECL
44 SV_DECL_VARARR_VISIBILITY( SvBools
, BOOL
, 1, 1, )
45 #define _SVSTDARR_BOOLS_DECL
49 //#ifdef _SVSTDARR_BYTES
50 #ifndef _SVSTDARR_BYTES_DECL
51 SV_DECL_VARARR_VISIBILITY( SvBytes
, BYTE
, 1, 1, )
52 #define _SVSTDARR_BYTES_DECL
56 //#ifdef _SVSTDARR_ULONGS
57 #ifndef _SVSTDARR_ULONGS_DECL
58 SV_DECL_VARARR_VISIBILITY( SvULongs
, ULONG
, 1, 1, )
59 #define _SVSTDARR_ULONGS_DECL
63 //#ifdef _SVSTDARR_USHORTS
64 #ifndef _SVSTDARR_USHORTS_DECL
65 SV_DECL_VARARR_VISIBILITY( SvUShorts
, USHORT
, 1, 1, )
66 #define _SVSTDARR_USHORTS_DECL
70 //#ifdef _SVSTDARR_USHORTSSORT
71 #ifndef _SVSTDARR_USHORTSSORT_DECL
73 typedef BOOL (*FnForEach_SvUShortsSort
)( const USHORT
&, void* );
74 class SvUShortsSort
: __MWERKS__PRIVATE SvUShorts
77 SvUShortsSort(BYTE nSize
= 1, BYTE nG
= 1)
78 : SvUShorts(nSize
,nG
) {}
80 void Insert( const SvUShortsSort
*pI
, USHORT nS
=0, USHORT nE
=USHRT_MAX
);
81 BOOL
Insert( const USHORT aE
);
82 BOOL
Insert( const USHORT aE
, USHORT
& rP
);
83 void Insert( const USHORT
*pE
, USHORT nL
);
84 // remove ab dem Eintrag
85 void Remove( const USHORT nP
, USHORT nL
= 1 );
86 BOOL
Seek_Entry( const USHORT aE
, USHORT
* pP
= 0 ) const;
88 USHORT
Count() const { return SvUShorts::Count(); }
89 const USHORT
* GetData() const { return (const USHORT
*)pData
; }
91 const USHORT
& operator[](USHORT nP
) const {
92 return SvUShorts::operator[]( nP
);
94 const USHORT
& GetObject(USHORT nP
) const {
95 return SvUShorts::GetObject( nP
);
97 void ForEach( FnForEach_SvUShortsSort fnForEach
, void* pArgs
= 0 )
99 _ForEach( 0, nA
, (FnForEach_SvUShorts
)fnForEach
, pArgs
);
101 void ForEach( USHORT nS
, USHORT nE
,
102 FnForEach_SvUShortsSort fnForEach
, void* pArgs
= 0 )
104 _ForEach( nS
, nE
, (FnForEach_SvUShorts
)fnForEach
, pArgs
);
107 SvUShortsSort( const SvUShortsSort
& );
108 SvUShortsSort
& operator=( const SvUShortsSort
& );
111 #define _SVSTDARR_USHORTSSORT_DECL
115 //#ifdef _SVSTDARR_LONGS
116 #ifndef _SVSTDARR_LONGS_DECL
117 SV_DECL_VARARR_VISIBILITY( SvLongs
, long, 1, 1, )
118 #define _SVSTDARR_LONGS_DECL
122 //#ifdef _SVSTDARR_SHORTS
123 #ifndef _SVSTDARR_SHORTS_DECL
124 SV_DECL_VARARR_VISIBILITY( SvShorts
, short, 1, 1, )
125 #define _SVSTDARR_SHORTS_DECL
130 form here all Arrays for Strings, ByteString and then
131 len of a string (xub_StrLen)
132 #if (defined(_SVSTDARR_STRINGS) && !defined(_SVSTDARR_STRINGS_DECL)) || \
133 (defined(_SVSTDARR_STRINGSDTOR) && !defined(_SVSTDARR_STRINGSDTOR_DECL)) || \
134 (defined(_SVSTDARR_STRINGSSORT) && !defined(_SVSTDARR_STRINGSSORT_DECL)) || \
135 (defined(_SVSTDARR_STRINGSSORTDTOR) && !defined(_SVSTDARR_STRINGSSORTDTOR_DECL)) || \
136 (defined(_SVSTDARR_STRINGSISORT) && !defined(_SVSTDARR_STRINGSISORT_DECL)) || \
137 (defined(_SVSTDARR_STRINGSISORTDTOR) && !defined(_SVSTDARR_STRINGSISORTDTOR_DECL)) || \
138 (defined(_SVSTDARR_BYTESTRINGS) && !defined(_SVSTDARR_BYTESTRINGS_DECL)) || \
139 (defined(_SVSTDARR_BYTESTRINGSDTOR) && !defined(_SVSTDARR_BYTESTRINGSDTOR_DECL)) || \
140 (defined(_SVSTDARR_BYTESTRINGSSORT) && !defined(_SVSTDARR_BYTESTRINGSSORT_DECL)) || \
141 (defined(_SVSTDARR_BYTESTRINGSSORTDTOR) && !defined(_SVSTDARR_BYTESTRINGSSORTDTOR_DECL)) || \
142 (defined(_SVSTDARR_BYTESTRINGSISORT) && !defined(_SVSTDARR_BYTESTRINGSISORT_DECL)) || \
143 (defined(_SVSTDARR_BYTESTRINGSISORTDTOR) && !defined(_SVSTDARR_BYTESTRINGSISORTDTOR_DECL)) || \
144 (defined(_SVSTDARR_XUB_STRLEN) && !defined(_SVSTDARR_XUB_STRLEN_DECL))
148 typedef String
* StringPtr
;
149 typedef ByteString
* ByteStringPtr
;
153 //#ifdef _SVSTDARR_STRINGS
154 #ifndef _SVSTDARR_STRINGS_DECL
155 SV_DECL_PTRARR_VISIBILITY( SvStrings
, StringPtr
, 1, 1, )
156 #define _SVSTDARR_STRINGS_DECL
160 //#ifdef _SVSTDARR_STRINGSDTOR
161 #ifndef _SVSTDARR_STRINGSDTOR_DECL
162 SV_DECL_PTRARR_DEL_VISIBILITY( SvStringsDtor
, StringPtr
, 1, 1, )
163 #define _SVSTDARR_STRINGSDTOR_DECL
167 //#ifdef _SVSTDARR_STRINGSSORT
168 #ifndef _SVSTDARR_STRINGSSORT_DECL
169 SV_DECL_PTRARR_SORT_VISIBILITY( SvStringsSort
, StringPtr
, 1, 1, )
170 #define _SVSTDARR_STRINGSSORT_DECL
174 //#ifdef _SVSTDARR_STRINGSSORTDTOR
175 #ifndef _SVSTDARR_STRINGSSORTDTOR_DECL
176 SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvStringsSortDtor
, StringPtr
, 1, 1, )
177 #define _SVSTDARR_STRINGSSORTDTOR_DECL
181 //#ifdef _SVSTDARR_STRINGSISORT
182 #ifndef _SVSTDARR_STRINGSISORT_DECL
183 SV_DECL_PTRARR_SORT_VISIBILITY( SvStringsISort
, StringPtr
, 1, 1, )
184 #define _SVSTDARR_STRINGSISORT_DECL
188 //#ifdef _SVSTDARR_STRINGSISORTDTOR
189 #ifndef _SVSTDARR_STRINGSISORTDTOR_DECL
190 SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvStringsISortDtor
, StringPtr
, 1, 1, )
191 #define _SVSTDARR_STRINGSISORTDTOR_DECL
195 //#ifdef _SVSTDARR_BYTESTRINGS
196 #ifndef _SVSTDARR_BYTESTRINGS_DECL
197 SV_DECL_PTRARR_VISIBILITY( SvByteStrings
, ByteStringPtr
, 1, 1, )
198 #define _SVSTDARR_BYTESTRINGS_DECL
202 //#ifdef _SVSTDARR_BYTESTRINGSDTOR
203 #ifndef _SVSTDARR_BYTESTRINGSDTOR_DECL
204 SV_DECL_PTRARR_DEL_VISIBILITY( SvByteStringsDtor
, ByteStringPtr
, 1, 1, )
205 #define _SVSTDARR_BYTESTRINGSDTOR_DECL
209 //#ifdef _SVSTDARR_BYTESTRINGSSORT
210 #ifndef _SVSTDARR_BYTESTRINGSSORT_DECL
211 SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsSort
, ByteStringPtr
, 1, 1, )
212 #define _SVSTDARR_BYTESTRINGSSORT_DECL
216 //#ifdef _SVSTDARR_BYTESTRINGSSORTDTOR
217 #ifndef _SVSTDARR_BYTESTRINGSSORTDTOR_DECL
218 SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsSortDtor
, ByteStringPtr
, 1, 1, )
219 #define _SVSTDARR_BYTESTRINGSSORTDTOR_DECL
223 //#ifdef _SVSTDARR_BYTESTRINGSISORT
224 #ifndef _SVSTDARR_BYTESTRINGSISORT_DECL
225 SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsISort
, ByteStringPtr
, 1, 1, )
226 #define _SVSTDARR_BYTESTRINGSISORT_DECL
230 //#ifdef _SVSTDARR_BYTESTRINGSISORTDTOR
231 #ifndef _SVSTDARR_BYTESTRINGSISORTDTOR_DECL
232 SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsISortDtor
, ByteStringPtr
, 1, 1, )
233 #define _SVSTDARR_BYTESTRINGSISORTDTOR_DECL
237 //#ifdef _SVSTDARR_XUB_STRLEN
238 #ifndef _SVSTDARR_XUB_STRLEN_DECL
239 SV_DECL_VARARR_VISIBILITY( SvXub_StrLens
, xub_StrLen
, 1, 1, )
240 #define _SVSTDARR_XUB_STRLEN_DECL