LibreOffice Module ucb (master) 1
filglob.hxx
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#pragma once
20
21#include <sal/config.h>
22
23#include <string_view>
24
25#include <rtl/ustring.hxx>
26#include <osl/file.hxx>
27#include <com/sun/star/ucb/XCommandEnvironment.hpp>
28
29
30namespace fileaccess {
31
32 class BaseContent;
33
34 /******************************************************************************/
35 /* */
36 /* Helper functions */
37 /* */
38 /******************************************************************************/
39
40
41 // Returns true if dstUnqPath is a child from srcUnqPath or both are equal
42
43 extern bool isChild( std::u16string_view srcUnqPath,
44 std::u16string_view dstUnqPath );
45
46
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 );
51
52 // returns the last part of the given url as title
53 extern std::u16string_view getTitle( std::u16string_view aPath );
54
55 // returns the url without last part as parentname
56 // In case aFileName is root ( file:/// ) root is returned
57
58 extern OUString getParentName( std::u16string_view aFileName );
59
67 extern osl::FileBase::RC osl_File_copy( const OUString& strPath,
68 const OUString& strDestPath,
69 bool test );
70
78 extern osl::FileBase::RC osl_File_move( const OUString& strPath,
79 const OUString& strDestPath,
80 bool test = false );
81
82 // This function implements the global exception handler of the file_ucp;
83 // It never returns;
84
85 extern void throw_handler( sal_Int32 errorCode,
86 sal_Int32 minorCode,
87 const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv,
88 const OUString& aUncPath,
89 BaseContent* pContent,
90 bool isHandled);
91 // the physical URL of the object
92
93} // end namespace fileaccess
94
95/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString getParentName(std::u16string_view aFileName)
Definition: filglob.cxx:194
osl::FileBase::RC osl_File_move(const OUString &strPath, const OUString &strDestPath, bool test)
special move: On test = true, the implementation determines whether the destination exists and return...
Definition: filglob.cxx:224
osl::FileBase::RC osl_File_copy(const OUString &strPath, const OUString &strDestPath, bool test)
special copy: On test = true, the implementation determines whether the destination exists and return...
Definition: filglob.cxx:209
void throw_handler(sal_Int32 errorCode, sal_Int32 minorCode, const Reference< XCommandEnvironment > &xEnv, const OUString &aUncPath, BaseContent *pContent, bool isHandled)
Definition: filglob.cxx:238
OUString newName(std::u16string_view aNewPrefix, std::u16string_view aOldPrefix, std::u16string_view old_Name)
Definition: filglob.cxx:176
bool isChild(std::u16string_view srcUnqPath, std::u16string_view dstUnqPath)
Definition: filglob.cxx:156
std::u16string_view getTitle(std::u16string_view aPath)
Definition: filglob.cxx:187