25#include <osl/diagnose.h>
30#if !defined WIN32_LEAN_AND_MEAN
31# define WIN32_LEAN_AND_MEAN
36 m_vFilters( initSize ),
37 m_bIterInitialized( false )
44 const OUString& aName,
const OUString& aFilter,
bool bAllowDuplicates )
49 if ( !bAllowDuplicates )
105 OSL_PRECOND( !
m_vFilters.empty() ,
"Empty filter container" );
117 catch (std::out_of_range&)
119 OSL_FAIL(
"Filter index out of range");
134 catch( std::out_of_range& )
136 OSL_FAIL(
"Filter index out of range" );
155 [&
aName](
const FILTER_ENTRY_T& rFilter) { return rFilter.first.equalsIgnoreAsciiCase(aName); });
157 return std::distance(
m_vFilters.begin(), iter);
180 nextFilterEntry = *
m_iter++;
204 aFilterEntry.first.getLength( ) + 1 +
205 aFilterEntry.second.getLength( ) + 1 );
216 sal_uInt32 totalLength = 0;
220 return ( totalLength > 0 ) ? totalLength + 1 : totalLength;
242 auto pBuff = std::make_unique<sal_Unicode[]>(reqBuffSize);
245 ZeroMemory( pBuff.get(),
sizeof(
sal_Unicode ) * reqBuffSize );
247 OUString winFilterBuff;
249 sal_uInt32 memPos = 0;
256 pBuff.get() + memPos,
257 nextFilter.first.getStr( ),
258 nextFilter.first.getLength( ) );
260 memPos += nextFilter.first.getLength( ) + 1;
263 pBuff.get() + memPos,
264 nextFilter.second.getStr( ),
265 nextFilter.second.getLength( ) );
267 memPos += nextFilter.second.getLength( ) + 1 ;
270 winFilterBuff = OUString( pBuff.get(), reqBuffSize );
272 return winFilterBuff;
static sal_uInt32 getLengthFilter(CFilterContainer::FILTER_ENTRY_T aFilterEntry)
static sal_uInt32 getTotalFilterLength(CFilterContainer &aFilterContainer)
static void wcsmemcpy(sal_Unicode *pDest, const sal_Unicode *pSrc, sal_uInt32 nLength)
OUString makeWinFilterBuffer(CFilterContainer &aFilterContainer)
bool getFilterByIndex(sal_Int32 aIndex, OUString &theFilter) const
OUString m_sCurrentFilter
void setCurrentFilter(const OUString &aName)
std::pair< OUString, OUString > FILTER_ENTRY_T
bool getFilterByName(const OUString &aName, OUString &theFilter) const
CFilterContainer(sal_Int32 initSize=0)
sal_Int32 getFilterTagPos(const OUString &aName) const
OUString getCurrentFilter() const
FILTER_VECTOR_T m_vFilters
sal_Int32 getFilterPos(const OUString &aName) const
bool getFilterNameByIndex(sal_Int32 aIndex, OUString &theName) const
FILTER_VECTOR_T::const_iterator m_iter
bool getNextFilter(FILTER_ENTRY_T &nextFilterEntry)
bool addFilter(const OUString &aName, const OUString &aFilter, bool bAllowDuplicates=false)
bool delFilter(const OUString &aName)
std::deque< AttacherIndex_Impl > aIndex