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 .
22 #include <rtl/ustring.hxx>
23 #include <osl/file.hxx>
24 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
27 namespace fileaccess
{
33 bool operator()( const rtl::OUString
& rKey1
, const rtl::OUString
& rKey2
) const
35 return !!( rKey1
== rKey2
);
42 size_t operator()( const rtl::OUString
& rName
) const
44 return rName
.hashCode();
49 /******************************************************************************/
51 /* Helper functions */
53 /******************************************************************************/
56 // Returns true if dstUnqPath is a child from srcUnqPath or both are equal
58 extern sal_Bool
isChild( const rtl::OUString
& srcUnqPath
,
59 const rtl::OUString
& dstUnqPath
);
62 // Changes the prefix in name
63 extern rtl::OUString
newName( const rtl::OUString
& aNewPrefix
,
64 const rtl::OUString
& aOldPrefix
,
65 const rtl::OUString
& old_Name
);
67 // returns the last part of the given url as title
68 extern rtl::OUString
getTitle( const rtl::OUString
& aPath
);
70 // returns the url without last part as parentname
71 // In case aFileName is root ( file:/// ) root is returned
73 extern rtl::OUString
getParentName( const rtl::OUString
& aFileName
);
77 * On test = true, the implementation determines whether the
78 * destination exists and returns the appropriate errorcode E_EXIST.
79 * osl::File::copy copies unchecked.
82 extern osl::FileBase::RC
osl_File_copy( const rtl::OUString
& strPath
,
83 const rtl::OUString
& strDestPath
,
84 sal_Bool test
= false );
88 * On test = true, the implementation determines whether the
89 * destination exists and returns the appropriate errorcode E_EXIST.
90 * osl::File::move moves unchecked
93 extern osl::FileBase::RC
osl_File_move( const rtl::OUString
& strPath
,
94 const rtl::OUString
& strDestPath
,
95 sal_Bool test
= false );
97 // This function implements the global exception handler of the file_ucp;
100 extern void throw_handler( sal_Int32 errorCode
,
102 const com::sun::star::uno::Reference
<
103 com::sun::star::ucb::XCommandEnvironment
>& xEnv
,
104 const rtl::OUString
& aUncPath
,
105 BaseContent
* pContent
,
106 bool isHandled
= false);
107 // the physical URL of the object
109 } // end namespace fileaccess
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */