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