xref: /aoo41x/main/sal/osl/w32/path_helper.h (revision 9eab2a37)
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 _PATH_HELPER_H_
25 #define _PATH_HELPER_H_
26 
27 #include <sal/types.h>
28 #include <rtl/ustring.h>
29 #include <osl/file.h>
30 
31 #ifdef __cplusplus
32 extern "C"
33 {
34 #endif
35 
36 /*******************************************************************
37  osl_systemPathEnsureSeparator
38  Adds a trailing path separator to the given system path if not
39  already there and if the path is not the root path or a logical
40  drive alone
41  ******************************************************************/
42 
43 void osl_systemPathEnsureSeparator(/*inout*/ rtl_uString** ppustrPath);
44 
45 /*******************************************************************
46  osl_systemPathRemoveSeparator
47  Removes the last separator from the given system path if any and
48  if the path is not the root path '\'
49  ******************************************************************/
50 
51 void SAL_CALL osl_systemPathRemoveSeparator(/*inout*/ rtl_uString** ppustrPath);
52 
53 /*******************************************************************
54  osl_is_logical_drive_pattern
55  Returns whether a given path is only a logical drive pattern or not.
56  A logical drive pattern is something like "a:\", "c:\".
57  No logical drive pattern is something like "c:\test"
58  ******************************************************************/
59 
60 sal_Int32 osl_systemPathIsLogicalDrivePattern(/*in*/ const rtl_uString* pustrPath);
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif
67