xref: /aoo41x/main/sal/osl/os2/path_helper.hxx (revision 565d668c)
1*565d668cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*565d668cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*565d668cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*565d668cSAndrew Rist  * distributed with this work for additional information
6*565d668cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*565d668cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*565d668cSAndrew Rist  * "License"); you may not use this file except in compliance
9*565d668cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*565d668cSAndrew Rist  *
11*565d668cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*565d668cSAndrew Rist  *
13*565d668cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*565d668cSAndrew Rist  * software distributed under the License is distributed on an
15*565d668cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*565d668cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*565d668cSAndrew Rist  * specific language governing permissions and limitations
18*565d668cSAndrew Rist  * under the License.
19*565d668cSAndrew Rist  *
20*565d668cSAndrew Rist  *************************************************************/
21*565d668cSAndrew Rist 
22*565d668cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // YD #pragma warning (disable : 4800)
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef _PATH_HELPER_HXX_
27cdf0e10cSrcweir #define _PATH_HELPER_HXX_
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include "path_helper.h"
30cdf0e10cSrcweir #include <rtl/ustring.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir namespace osl
33cdf0e10cSrcweir {
34cdf0e10cSrcweir 
35cdf0e10cSrcweir /*******************************************************************
36cdf0e10cSrcweir  osl_systemPathEnsureSeparator
37cdf0e10cSrcweir  Adds a trailing path separator to the given system path if not
38cdf0e10cSrcweir  already there and if the path is not the root path or a logical
39cdf0e10cSrcweir  drive alone
40cdf0e10cSrcweir  ******************************************************************/
41cdf0e10cSrcweir 
systemPathEnsureSeparator(rtl::OUString & Path)42cdf0e10cSrcweir inline void systemPathEnsureSeparator(/*inout*/ rtl::OUString& Path)
43cdf0e10cSrcweir {
44cdf0e10cSrcweir     osl_systemPathEnsureSeparator(&Path.pData);
45cdf0e10cSrcweir }
46cdf0e10cSrcweir 
47cdf0e10cSrcweir /*******************************************************************
48cdf0e10cSrcweir  osl_systemPathRemoveSeparator
49cdf0e10cSrcweir  Removes the last separator from the given system path if any and
50cdf0e10cSrcweir  if the path is not the root path '\'
51cdf0e10cSrcweir  ******************************************************************/
52cdf0e10cSrcweir 
systemPathRemoveSeparator(rtl::OUString & Path)53cdf0e10cSrcweir inline void systemPathRemoveSeparator(/*inout*/ rtl::OUString& Path)
54cdf0e10cSrcweir {
55cdf0e10cSrcweir     osl_systemPathRemoveSeparator(&Path.pData);
56cdf0e10cSrcweir }
57cdf0e10cSrcweir 
58cdf0e10cSrcweir /*******************************************************************
59cdf0e10cSrcweir  osl_systemPathIsLogicalDrivePattern
60cdf0e10cSrcweir  ******************************************************************/
61cdf0e10cSrcweir 
systemPathIsLogicalDrivePattern(const rtl::OUString & path)62cdf0e10cSrcweir inline bool systemPathIsLogicalDrivePattern(/*in*/ const rtl::OUString& path)
63cdf0e10cSrcweir {
64cdf0e10cSrcweir     return osl_systemPathIsLogicalDrivePattern(path.pData);
65cdf0e10cSrcweir }
66cdf0e10cSrcweir 
67cdf0e10cSrcweir } // end namespace osl
68cdf0e10cSrcweir 
69cdf0e10cSrcweir #endif
70