xref: /aoo41x/main/sal/osl/w32/file_url.h (revision 9eab2a37)
1*9eab2a37SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9eab2a37SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9eab2a37SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9eab2a37SAndrew Rist  * distributed with this work for additional information
6*9eab2a37SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9eab2a37SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9eab2a37SAndrew Rist  * "License"); you may not use this file except in compliance
9*9eab2a37SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9eab2a37SAndrew Rist  *
11*9eab2a37SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9eab2a37SAndrew Rist  *
13*9eab2a37SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9eab2a37SAndrew Rist  * software distributed under the License is distributed on an
15*9eab2a37SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9eab2a37SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9eab2a37SAndrew Rist  * specific language governing permissions and limitations
18*9eab2a37SAndrew Rist  * under the License.
19*9eab2a37SAndrew Rist  *
20*9eab2a37SAndrew Rist  *************************************************************/
21*9eab2a37SAndrew Rist 
22*9eab2a37SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_OSL_FILE_URL_H
25cdf0e10cSrcweir #define INCLUDED_OSL_FILE_URL_H
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "sal/types.h"
28cdf0e10cSrcweir #include "rtl/ustring.h"
29cdf0e10cSrcweir #include "osl/file.h"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #ifdef _MSC_VER
32cdf0e10cSrcweir #pragma warning(push,1)
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #define WINDOWS_LEAN_AND_MEAN
36cdf0e10cSrcweir #include <windows.h>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #ifdef _MSC_VER
39cdf0e10cSrcweir #pragma warning(pop)
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir 
42cdf0e10cSrcweir #ifdef __cplusplus
43cdf0e10cSrcweir extern "C" {
44cdf0e10cSrcweir #endif
45cdf0e10cSrcweir 
46cdf0e10cSrcweir #define PATHTYPE_ERROR						0
47cdf0e10cSrcweir #define PATHTYPE_RELATIVE					1
48cdf0e10cSrcweir #define PATHTYPE_ABSOLUTE_UNC				2
49cdf0e10cSrcweir #define PATHTYPE_ABSOLUTE_LOCAL				3
50cdf0e10cSrcweir #define PATHTYPE_MASK_TYPE					0xFF
51cdf0e10cSrcweir #define PATHTYPE_IS_VOLUME					0x0100
52cdf0e10cSrcweir #define PATHTYPE_IS_SERVER					0x0200
53cdf0e10cSrcweir #define PATHTYPE_IS_LONGPATH				0x0400
54cdf0e10cSrcweir 
55cdf0e10cSrcweir #define VALIDATEPATH_NORMAL					0x0000
56cdf0e10cSrcweir #define VALIDATEPATH_ALLOW_WILDCARDS		0x0001
57cdf0e10cSrcweir #define VALIDATEPATH_ALLOW_ELLIPSE			0x0002
58cdf0e10cSrcweir #define VALIDATEPATH_ALLOW_RELATIVE			0x0004
59cdf0e10cSrcweir #define VALIDATEPATH_ALLOW_UNC				0x0008
60cdf0e10cSrcweir 
61cdf0e10cSrcweir #define MAX_LONG_PATH 32767
62cdf0e10cSrcweir 
63cdf0e10cSrcweir DWORD IsValidFilePath (
64cdf0e10cSrcweir     rtl_uString *  path,
65cdf0e10cSrcweir     LPCTSTR *      lppError,
66cdf0e10cSrcweir     DWORD          dwFlags,
67cdf0e10cSrcweir     rtl_uString ** corrected
68cdf0e10cSrcweir );
69cdf0e10cSrcweir 
70cdf0e10cSrcweir DWORD GetCaseCorrectPathName (
71cdf0e10cSrcweir     LPCTSTR	lpszShortPath,	// file name
72cdf0e10cSrcweir     LPTSTR	lpszLongPath,	// path buffer
73cdf0e10cSrcweir     DWORD	cchBuffer,		// size of path buffer
74cdf0e10cSrcweir     BOOL bCheckExistence
75cdf0e10cSrcweir );
76cdf0e10cSrcweir 
77cdf0e10cSrcweir oslFileError _osl_getSystemPathFromFileURL (
78cdf0e10cSrcweir     rtl_uString *  strURL,
79cdf0e10cSrcweir     rtl_uString ** pustrPath,
80cdf0e10cSrcweir     sal_Bool       bAllowRelative
81cdf0e10cSrcweir );
82cdf0e10cSrcweir 
83cdf0e10cSrcweir oslFileError _osl_getFileURLFromSystemPath (
84cdf0e10cSrcweir     rtl_uString *  strPath,
85cdf0e10cSrcweir     rtl_uString ** pstrURL
86cdf0e10cSrcweir );
87cdf0e10cSrcweir 
88cdf0e10cSrcweir #ifdef __cplusplus
89cdf0e10cSrcweir }
90cdf0e10cSrcweir #endif
91cdf0e10cSrcweir 
92cdf0e10cSrcweir #endif /* INCLUDED_OSL_FILE_URL_H */
93