LibreOffice Module ucbhelper (master) 1
contentidentifier.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
21
22using namespace com::sun::star::uno;
23using namespace com::sun::star::lang;
24using namespace com::sun::star::ucb;
25
26
27namespace ucbhelper
28{
29
31{
32 OUString m_aContentId;
34
35 explicit ContentIdentifier_Impl( const OUString& rURL );
36};
37
38
39// ContentIdentifier_Impl Implementation.
40
41
43{
44 // Normalize URL scheme ( it's case insensitive ).
45
46 // The content provider scheme is the part before the first ':'
47 // within the content id.
48 sal_Int32 nPos = rURL.indexOf( ':' );
49 if ( nPos != -1 )
50 {
51 OUString aScheme( rURL.copy( 0, nPos ) );
52 m_aProviderScheme = aScheme.toAsciiLowerCase();
53 m_aContentId = rURL.replaceAt( 0, nPos, aScheme );
54 }
55}
56
57
58// ContentIdentifier Implementation.
59
60
62 : m_pImpl( new ContentIdentifier_Impl( rURL ) )
63{
64}
65
66
67// virtual
69{
70}
71
72
73// XContentIdentifier methods.
74
75
76// virtual
78{
79 return m_pImpl->m_aContentId;
80}
81
82
83// virtual
85{
86 return m_pImpl->m_aProviderScheme;
87}
88
89} /* namespace ucbhelper */
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
virtual OUString SAL_CALL getContentProviderScheme() override
virtual ~ContentIdentifier() override
ContentIdentifier(const OUString &rURL)
std::unique_ptr< ContentIdentifier_Impl > m_pImpl
virtual OUString SAL_CALL getContentIdentifier() override
sal_uInt16 nPos
ContentIdentifier_Impl(const OUString &rURL)