Bump for 3.6-28
[LibreOffice.git] / ucb / source / ucp / file / filglob.hxx
blob783a802a9af23db0aa2a54cd35b33226b6d38838
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _FILGLOB_HXX_
29 #define _FILGLOB_HXX_
31 #include <rtl/ustring.hxx>
32 #include <osl/file.hxx>
33 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
36 namespace fileaccess {
38 class BaseContent;
40 struct equalOUString
42 bool operator()( const rtl::OUString& rKey1, const rtl::OUString& rKey2 ) const
44 return !!( rKey1 == rKey2 );
49 struct hashOUString
51 size_t operator()( const rtl::OUString& rName ) const
53 return rName.hashCode();
58 /******************************************************************************/
59 /* */
60 /* Helper functions */
61 /* */
62 /******************************************************************************/
65 // Returns true if dstUnqPath is a child from srcUnqPath or both are equal
67 extern sal_Bool isChild( const rtl::OUString& srcUnqPath,
68 const rtl::OUString& dstUnqPath );
71 // Changes the prefix in name
72 extern rtl::OUString newName( const rtl::OUString& aNewPrefix,
73 const rtl::OUString& aOldPrefix,
74 const rtl::OUString& old_Name );
76 // returns the last part of the given url as title
77 extern rtl::OUString getTitle( const rtl::OUString& aPath );
79 // returns the url without last part as parentname
80 // In case aFileName is root ( file:/// ) root is returned
82 extern rtl::OUString getParentName( const rtl::OUString& aFileName );
84 /**
85 * special copy:
86 * On test = true, the implementation determines whether the
87 * destination exists and returns the appropriate errorcode E_EXIST.
88 * osl::File::copy copies unchecked.
91 extern osl::FileBase::RC osl_File_copy( const rtl::OUString& strPath,
92 const rtl::OUString& strDestPath,
93 sal_Bool test = false );
95 /**
96 * special move:
97 * On test = true, the implementation determines whether the
98 * destination exists and returns the appropriate errorcode E_EXIST.
99 * osl::File::move moves unchecked
102 extern osl::FileBase::RC osl_File_move( const rtl::OUString& strPath,
103 const rtl::OUString& strDestPath,
104 sal_Bool test = false );
106 // This function implements the global exception handler of the file_ucp;
107 // It never returns;
109 extern void throw_handler( sal_Int32 errorCode,
110 sal_Int32 minorCode,
111 const com::sun::star::uno::Reference<
112 com::sun::star::ucb::XCommandEnvironment >& xEnv,
113 const rtl::OUString& aUncPath,
114 BaseContent* pContent,
115 bool isHandled = false);
116 // the physical URL of the object
118 } // end namespace fileaccess
120 #endif
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */