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: identify.cxx,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 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_ucb.hxx"
34 /**************************************************************************
36 **************************************************************************
38 *************************************************************************/
40 #include "identify.hxx"
43 using namespace com::sun::star::uno
;
44 using namespace com::sun::star::lang
;
45 using namespace com::sun::star::ucb
;
47 //=========================================================================
49 // ContentIdentifier Implementation.
51 //=========================================================================
53 ContentIdentifier::ContentIdentifier(
54 const Reference
< XMultiServiceFactory
>& rxSMgr
,
55 const OUString
& ContentId
)
57 m_aContentId( ContentId
)
61 //=========================================================================
63 ContentIdentifier::~ContentIdentifier()
67 //=========================================================================
69 // XInterface methods.
71 //=========================================================================
73 XINTERFACE_IMPL_2( ContentIdentifier
,
77 //=========================================================================
79 // XTypeProvider methods.
81 //=========================================================================
83 XTYPEPROVIDER_IMPL_2( ContentIdentifier
,
87 //=========================================================================
89 // XContentIdentifier methods.
91 //=========================================================================
94 OUString SAL_CALL
ContentIdentifier::getContentIdentifier()
95 throw( RuntimeException
)
100 //=========================================================================
102 OUString SAL_CALL
ContentIdentifier::getContentProviderScheme()
103 throw( RuntimeException
)
105 if ( !m_aProviderScheme
.getLength() && m_aContentId
.getLength() )
107 // The content provider scheme is the part before the first ':'
108 // within the content id.
109 sal_Int32 nPos
= m_aContentId
.indexOf( ':', 0 );
112 OUString
aScheme( m_aContentId
.copy( 0, nPos
) );
113 m_aProviderScheme
= aScheme
.toAsciiLowerCase();
117 return m_aProviderScheme
;