1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <sal/config.h>
23 #include <string_view>
25 #include <rtl/ustring.hxx>
26 #include <osl/file.hxx>
27 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
30 namespace fileaccess
{
34 /******************************************************************************/
36 /* Helper functions */
38 /******************************************************************************/
41 // Returns true if dstUnqPath is a child from srcUnqPath or both are equal
43 extern bool isChild( std::u16string_view srcUnqPath
,
44 std::u16string_view dstUnqPath
);
47 // Changes the prefix in name
48 extern OUString
newName( std::u16string_view aNewPrefix
,
49 std::u16string_view aOldPrefix
,
50 std::u16string_view old_Name
);
52 // returns the last part of the given url as title
53 extern std::u16string_view
getTitle( std::u16string_view aPath
);
55 // returns the url without last part as parentname
56 // In case aFileName is root ( file:/// ) root is returned
58 extern OUString
getParentName( std::u16string_view aFileName
);
62 * On test = true, the implementation determines whether the
63 * destination exists and returns the appropriate errorcode E_EXIST.
64 * osl::File::copy copies unchecked.
67 extern osl::FileBase::RC
osl_File_copy( const OUString
& strPath
,
68 const OUString
& strDestPath
,
73 * On test = true, the implementation determines whether the
74 * destination exists and returns the appropriate errorcode E_EXIST.
75 * osl::File::move moves unchecked
78 extern osl::FileBase::RC
osl_File_move( const OUString
& strPath
,
79 const OUString
& strDestPath
,
82 // This function implements the global exception handler of the file_ucp;
85 extern void throw_handler( sal_Int32 errorCode
,
87 const css::uno::Reference
< css::ucb::XCommandEnvironment
>& xEnv
,
88 const OUString
& aUncPath
,
89 BaseContent
* pContent
,
91 // the physical URL of the object
93 } // end namespace fileaccess
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */