1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #if 0 29 *********************************************************************** 30 * 31 * Die vordefinierte Arrays werden ueber POSITIV-Defines aktiviert: 32 * (die defines setzen sich aus "_SVSTDARR_" und dem Namen des Array 33 * ohne "Sv" zusammen) 34 * 35 * VarArr: SvBools, SvULongs, SvUShorts, SvLongs, SvShorts 36 * PtrArr: SvStrings, SvStringsDtor 37 * SortArr: SvStringsSort, SvStringsSortDtor, 38 * SvStringsISort, SvStringsISortDtor, 39 * SvUShortsSort 40 *********************************************************************** 41 #endif 42 43 #include "svl/svldllapi.h" 44 #include <svl/svarray.hxx> 45 #include <deque> 46 47 typedef std::deque< sal_Bool > SvBools; 48 49 typedef std::deque< sal_uInt8 > SvBytes; 50 51 //#ifdef _SVSTDARR_ULONGS 52 #ifndef _SVSTDARR_ULONGS_DECL 53 SV_DECL_VARARR_VISIBILITY( SvULongs, sal_uLong, 1, 1, SVL_DLLPUBLIC ) 54 #define _SVSTDARR_ULONGS_DECL 55 #endif 56 //#endif 57 58 //#ifdef _SVSTDARR_ULONGSSORT 59 #ifndef _SVSTDARR_ULONGSSORT_DECL 60 SV_DECL_VARARR_SORT_VISIBILITY( SvULongsSort, sal_uLong, 1, 1, SVL_DLLPUBLIC ) 61 #define _SVSTDARR_ULONGSSORT_DECL 62 #endif 63 //#endif 64 65 //#ifdef _SVSTDARR_USHORTS 66 #ifndef _SVSTDARR_USHORTS_DECL 67 SV_DECL_VARARR_VISIBILITY( SvUShorts, sal_uInt16, 1, 1, SVL_DLLPUBLIC ) 68 #define _SVSTDARR_USHORTS_DECL 69 #endif 70 //#endif 71 72 //#ifdef _SVSTDARR_USHORTSSORT 73 #ifndef _SVSTDARR_USHORTSSORT_DECL 74 75 typedef sal_Bool (*FnForEach_SvUShortsSort)( const sal_uInt16&, void* ); 76 class SVL_DLLPUBLIC SvUShortsSort : __MWERKS__PRIVATE SvUShorts 77 { 78 public: 79 SvUShortsSort(sal_uInt8 nSize = 1, sal_uInt8 nG = 1) 80 : SvUShorts(nSize,nG) {} 81 82 void Insert( const SvUShortsSort *pI, sal_uInt16 nS=0, sal_uInt16 nE=USHRT_MAX ); 83 sal_Bool Insert( const sal_uInt16 aE ); 84 sal_Bool Insert( const sal_uInt16 aE, sal_uInt16& rP ); 85 void Insert( const sal_uInt16 *pE, sal_uInt16 nL ); 86 // remove ab Pos 87 void RemoveAt( const sal_uInt16 nP, sal_uInt16 nL = 1 ); 88 // remove ab dem Eintrag 89 void Remove( const sal_uInt16 nP, sal_uInt16 nL = 1 ); 90 sal_Bool Seek_Entry( const sal_uInt16 aE, sal_uInt16* pP = 0 ) const; 91 92 sal_uInt16 Count() const { return SvUShorts::Count(); } 93 const sal_uInt16* GetData() const { return (const sal_uInt16*)pData; } 94 95 const sal_uInt16& operator[](sal_uInt16 nP) const { 96 return SvUShorts::operator[]( nP ); 97 } 98 const sal_uInt16& GetObject(sal_uInt16 nP) const { 99 return SvUShorts::GetObject( nP ); 100 } 101 void ForEach( FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 ) 102 { 103 _ForEach( 0, nA, (FnForEach_SvUShorts)fnForEach, pArgs ); 104 } 105 void ForEach( sal_uInt16 nS, sal_uInt16 nE, 106 FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 ) 107 { 108 _ForEach( nS, nE, (FnForEach_SvUShorts)fnForEach, pArgs ); 109 } 110 private: 111 SvUShortsSort( const SvUShortsSort& ); 112 SvUShortsSort& operator=( const SvUShortsSort& ); 113 }; 114 115 #define _SVSTDARR_USHORTSSORT_DECL 116 #endif 117 //#endif 118 119 //#ifdef _SVSTDARR_LONGS 120 #ifndef _SVSTDARR_LONGS_DECL 121 SV_DECL_VARARR_VISIBILITY( SvLongs, long, 1, 1, SVL_DLLPUBLIC ) 122 #define _SVSTDARR_LONGS_DECL 123 #endif 124 //#endif 125 126 //#ifdef _SVSTDARR_LONGSSORT 127 #ifndef _SVSTDARR_LONGSSORT_DECL 128 SV_DECL_VARARR_SORT_VISIBILITY( SvLongsSort, long, 1, 1, SVL_DLLPUBLIC ) 129 #define _SVSTDARR_LONGSSORT_DECL 130 #endif 131 //#endif 132 133 typedef std::deque< short > SvShorts; 134 135 /* 136 form here all Arrays for Strings, ByteString and then 137 len of a string (xub_StrLen) 138 #if (defined(_SVSTDARR_STRINGS) && !defined(_SVSTDARR_STRINGS_DECL)) || \ 139 (defined(_SVSTDARR_STRINGSDTOR) && !defined(_SVSTDARR_STRINGSDTOR_DECL)) || \ 140 (defined(_SVSTDARR_STRINGSSORT) && !defined(_SVSTDARR_STRINGSSORT_DECL)) || \ 141 (defined(_SVSTDARR_STRINGSSORTDTOR) && !defined(_SVSTDARR_STRINGSSORTDTOR_DECL)) || \ 142 (defined(_SVSTDARR_STRINGSISORT) && !defined(_SVSTDARR_STRINGSISORT_DECL)) || \ 143 (defined(_SVSTDARR_STRINGSISORTDTOR) && !defined(_SVSTDARR_STRINGSISORTDTOR_DECL)) || \ 144 (defined(_SVSTDARR_BYTESTRINGS) && !defined(_SVSTDARR_BYTESTRINGS_DECL)) || \ 145 (defined(_SVSTDARR_BYTESTRINGSDTOR) && !defined(_SVSTDARR_BYTESTRINGSDTOR_DECL)) || \ 146 (defined(_SVSTDARR_BYTESTRINGSSORT) && !defined(_SVSTDARR_BYTESTRINGSSORT_DECL)) || \ 147 (defined(_SVSTDARR_BYTESTRINGSSORTDTOR) && !defined(_SVSTDARR_BYTESTRINGSSORTDTOR_DECL)) || \ 148 (defined(_SVSTDARR_BYTESTRINGSISORT) && !defined(_SVSTDARR_BYTESTRINGSISORT_DECL)) || \ 149 (defined(_SVSTDARR_BYTESTRINGSISORTDTOR) && !defined(_SVSTDARR_BYTESTRINGSISORTDTOR_DECL)) || \ 150 (defined(_SVSTDARR_XUB_STRLEN) && !defined(_SVSTDARR_XUB_STRLEN_DECL)) ||\ 151 (defined(_SVSTDARR_XUB_STRLENSORT) && !defined(_SVSTDARR_XUB_STRLENSORT_DECL)) 152 */ 153 #include <tools/string.hxx> 154 155 typedef String* StringPtr; 156 typedef ByteString* ByteStringPtr; 157 158 //#endif 159 160 //#ifdef _SVSTDARR_STRINGS 161 #ifndef _SVSTDARR_STRINGS_DECL 162 SV_DECL_PTRARR_VISIBILITY( SvStrings, StringPtr, 1, 1, SVL_DLLPUBLIC ) 163 #define _SVSTDARR_STRINGS_DECL 164 #endif 165 //#endif 166 167 //#ifdef _SVSTDARR_STRINGSDTOR 168 #ifndef _SVSTDARR_STRINGSDTOR_DECL 169 SV_DECL_PTRARR_DEL_VISIBILITY( SvStringsDtor, StringPtr, 1, 1, SVL_DLLPUBLIC ) 170 #define _SVSTDARR_STRINGSDTOR_DECL 171 #endif 172 //#endif 173 174 //#ifdef _SVSTDARR_STRINGSSORT 175 #ifndef _SVSTDARR_STRINGSSORT_DECL 176 SV_DECL_PTRARR_SORT_VISIBILITY( SvStringsSort, StringPtr, 1, 1, SVL_DLLPUBLIC ) 177 #define _SVSTDARR_STRINGSSORT_DECL 178 #endif 179 //#endif 180 181 //#ifdef _SVSTDARR_STRINGSSORTDTOR 182 #ifndef _SVSTDARR_STRINGSSORTDTOR_DECL 183 SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvStringsSortDtor, StringPtr, 1, 1, SVL_DLLPUBLIC ) 184 #define _SVSTDARR_STRINGSSORTDTOR_DECL 185 #endif 186 //#endif 187 188 //#ifdef _SVSTDARR_STRINGSISORT 189 #ifndef _SVSTDARR_STRINGSISORT_DECL 190 SV_DECL_PTRARR_SORT_VISIBILITY( SvStringsISort, StringPtr, 1, 1, SVL_DLLPUBLIC ) 191 #define _SVSTDARR_STRINGSISORT_DECL 192 #endif 193 //#endif 194 195 //#ifdef _SVSTDARR_STRINGSISORTDTOR 196 #ifndef _SVSTDARR_STRINGSISORTDTOR_DECL 197 SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvStringsISortDtor, StringPtr, 1, 1, SVL_DLLPUBLIC ) 198 #define _SVSTDARR_STRINGSISORTDTOR_DECL 199 #endif 200 //#endif 201 202 //#ifdef _SVSTDARR_BYTESTRINGS 203 #ifndef _SVSTDARR_BYTESTRINGS_DECL 204 SV_DECL_PTRARR_VISIBILITY( SvByteStrings, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) 205 #define _SVSTDARR_BYTESTRINGS_DECL 206 #endif 207 //#endif 208 209 //#ifdef _SVSTDARR_BYTESTRINGSDTOR 210 #ifndef _SVSTDARR_BYTESTRINGSDTOR_DECL 211 SV_DECL_PTRARR_DEL_VISIBILITY( SvByteStringsDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) 212 #define _SVSTDARR_BYTESTRINGSDTOR_DECL 213 #endif 214 //#endif 215 216 //#ifdef _SVSTDARR_BYTESTRINGSSORT 217 #ifndef _SVSTDARR_BYTESTRINGSSORT_DECL 218 SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsSort, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) 219 #define _SVSTDARR_BYTESTRINGSSORT_DECL 220 #endif 221 //#endif 222 223 //#ifdef _SVSTDARR_BYTESTRINGSSORTDTOR 224 #ifndef _SVSTDARR_BYTESTRINGSSORTDTOR_DECL 225 SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsSortDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) 226 #define _SVSTDARR_BYTESTRINGSSORTDTOR_DECL 227 #endif 228 //#endif 229 230 //#ifdef _SVSTDARR_BYTESTRINGSISORT 231 #ifndef _SVSTDARR_BYTESTRINGSISORT_DECL 232 SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsISort, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) 233 #define _SVSTDARR_BYTESTRINGSISORT_DECL 234 #endif 235 //#endif 236 237 //#ifdef _SVSTDARR_BYTESTRINGSISORTDTOR 238 #ifndef _SVSTDARR_BYTESTRINGSISORTDTOR_DECL 239 SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsISortDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) 240 #define _SVSTDARR_BYTESTRINGSISORTDTOR_DECL 241 #endif 242 //#endif 243 244 typedef std::deque< xub_StrLen > SvXub_StrLens; 245 246