sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svtools / svstdarr.hxx
blobd3ba78bfbf1a74dc2e30d1fdd55f28541071e871
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: svstdarr.hxx,v $
10 * $Revision: 1.4 $
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 _SVARRAY_HXX
32 #include <bf_svtools/svarray.hxx>
33 #endif
35 #ifndef _STRING_HXX
36 #include <tools/string.hxx>
37 #endif
39 namespace binfilter
42 //#ifdef _SVSTDARR_BOOLS
43 #ifndef _SVSTDARR_BOOLS_DECL
44 SV_DECL_VARARR_VISIBILITY( SvBools, BOOL, 1, 1, )
45 #define _SVSTDARR_BOOLS_DECL
46 #endif
47 //#endif
49 //#ifdef _SVSTDARR_BYTES
50 #ifndef _SVSTDARR_BYTES_DECL
51 SV_DECL_VARARR_VISIBILITY( SvBytes, BYTE, 1, 1, )
52 #define _SVSTDARR_BYTES_DECL
53 #endif
54 //#endif
56 //#ifdef _SVSTDARR_ULONGS
57 #ifndef _SVSTDARR_ULONGS_DECL
58 SV_DECL_VARARR_VISIBILITY( SvULongs, ULONG, 1, 1, )
59 #define _SVSTDARR_ULONGS_DECL
60 #endif
61 //#endif
63 //#ifdef _SVSTDARR_USHORTS
64 #ifndef _SVSTDARR_USHORTS_DECL
65 SV_DECL_VARARR_VISIBILITY( SvUShorts, USHORT, 1, 1, )
66 #define _SVSTDARR_USHORTS_DECL
67 #endif
68 //#endif
70 //#ifdef _SVSTDARR_USHORTSSORT
71 #ifndef _SVSTDARR_USHORTSSORT_DECL
73 typedef BOOL (*FnForEach_SvUShortsSort)( const USHORT&, void* );
74 class SvUShortsSort : __MWERKS__PRIVATE SvUShorts
76 public:
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 );
106 private:
107 SvUShortsSort( const SvUShortsSort& );
108 SvUShortsSort& operator=( const SvUShortsSort& );
111 #define _SVSTDARR_USHORTSSORT_DECL
112 #endif
113 //#endif
115 //#ifdef _SVSTDARR_LONGS
116 #ifndef _SVSTDARR_LONGS_DECL
117 SV_DECL_VARARR_VISIBILITY( SvLongs, long, 1, 1, )
118 #define _SVSTDARR_LONGS_DECL
119 #endif
120 //#endif
122 //#ifdef _SVSTDARR_SHORTS
123 #ifndef _SVSTDARR_SHORTS_DECL
124 SV_DECL_VARARR_VISIBILITY( SvShorts, short, 1, 1, )
125 #define _SVSTDARR_SHORTS_DECL
126 #endif
127 //#endif
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;
151 //#endif
153 //#ifdef _SVSTDARR_STRINGS
154 #ifndef _SVSTDARR_STRINGS_DECL
155 SV_DECL_PTRARR_VISIBILITY( SvStrings, StringPtr, 1, 1, )
156 #define _SVSTDARR_STRINGS_DECL
157 #endif
158 //#endif
160 //#ifdef _SVSTDARR_STRINGSDTOR
161 #ifndef _SVSTDARR_STRINGSDTOR_DECL
162 SV_DECL_PTRARR_DEL_VISIBILITY( SvStringsDtor, StringPtr, 1, 1, )
163 #define _SVSTDARR_STRINGSDTOR_DECL
164 #endif
165 //#endif
167 //#ifdef _SVSTDARR_STRINGSSORT
168 #ifndef _SVSTDARR_STRINGSSORT_DECL
169 SV_DECL_PTRARR_SORT_VISIBILITY( SvStringsSort, StringPtr, 1, 1, )
170 #define _SVSTDARR_STRINGSSORT_DECL
171 #endif
172 //#endif
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
178 #endif
179 //#endif
181 //#ifdef _SVSTDARR_STRINGSISORT
182 #ifndef _SVSTDARR_STRINGSISORT_DECL
183 SV_DECL_PTRARR_SORT_VISIBILITY( SvStringsISort, StringPtr, 1, 1, )
184 #define _SVSTDARR_STRINGSISORT_DECL
185 #endif
186 //#endif
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
192 #endif
193 //#endif
195 //#ifdef _SVSTDARR_BYTESTRINGS
196 #ifndef _SVSTDARR_BYTESTRINGS_DECL
197 SV_DECL_PTRARR_VISIBILITY( SvByteStrings, ByteStringPtr, 1, 1, )
198 #define _SVSTDARR_BYTESTRINGS_DECL
199 #endif
200 //#endif
202 //#ifdef _SVSTDARR_BYTESTRINGSDTOR
203 #ifndef _SVSTDARR_BYTESTRINGSDTOR_DECL
204 SV_DECL_PTRARR_DEL_VISIBILITY( SvByteStringsDtor, ByteStringPtr, 1, 1, )
205 #define _SVSTDARR_BYTESTRINGSDTOR_DECL
206 #endif
207 //#endif
209 //#ifdef _SVSTDARR_BYTESTRINGSSORT
210 #ifndef _SVSTDARR_BYTESTRINGSSORT_DECL
211 SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsSort, ByteStringPtr, 1, 1, )
212 #define _SVSTDARR_BYTESTRINGSSORT_DECL
213 #endif
214 //#endif
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
220 #endif
221 //#endif
223 //#ifdef _SVSTDARR_BYTESTRINGSISORT
224 #ifndef _SVSTDARR_BYTESTRINGSISORT_DECL
225 SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsISort, ByteStringPtr, 1, 1, )
226 #define _SVSTDARR_BYTESTRINGSISORT_DECL
227 #endif
228 //#endif
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
234 #endif
235 //#endif
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
241 #endif
242 //#endif