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: MColumnAlias.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 #ifndef _CONNECTIVITY_MAB_COLUMNALIAS_HXX_
33 #define _CONNECTIVITY_MAB_COLUMNALIAS_HXX_
35 #include <unotools/confignode.hxx>
37 #include <osl/mutex.hxx>
41 namespace connectivity
50 ::rtl::OString programmaticAsciiName
;
51 sal_Int32 columnPosition
;
54 :programmaticAsciiName()
58 AliasEntry( const sal_Char
* _programmaticAsciiName
, sal_Int32 _columnPosition
)
59 :programmaticAsciiName( _programmaticAsciiName
)
60 ,columnPosition( _columnPosition
)
64 typedef ::std::hash_map
< ::rtl::OUString
, AliasEntry
, ::rtl::OUStringHash
> AliasMap
;
70 OColumnAlias( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> & );
72 inline bool hasAlias( const ::rtl::OUString
& _rAlias
) const
74 return m_aAliasMap
.find( _rAlias
) != m_aAliasMap
.end();
76 ::rtl::OString
getProgrammaticNameOrFallbackToUTF8Alias( const ::rtl::OUString
& _rAlias
) const;
78 inline AliasMap::const_iterator
begin() const { return m_aAliasMap
.begin(); }
79 inline AliasMap::const_iterator
end() const { return m_aAliasMap
.end(); }
81 bool isColumnSearchable( const ::rtl::OUString _alias
) const;
84 void initialize( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
);
88 #endif // _CONNECTIVITY_MAB_COLUMNALIAS_HXX_