xref: /trunk/main/sal/osl/os2/uunxapi.hxx (revision 565d668c)
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 _OSL_UUNXAPI_HXX_
25  #define _OSL_UUNXAPI_HXX_
26 
27  #ifndef _OSL_UUNXAPI_H_
28  #include "uunxapi.h"
29  #endif
30 
31  #ifndef _RTL_USTRING_HXX_
32  #include <rtl/ustring.hxx>
33  #endif
34 
35  //###########################
OUStringToOString(const rtl_uString * s)36  inline rtl::OString OUStringToOString(const rtl_uString* s)
37  {
38     return rtl::OUStringToOString(
39         rtl::OUString(const_cast<rtl_uString*>(s)),
40         osl_getThreadTextEncoding());
41  }
42 
43  namespace osl
44  {
45 
46 	 /***********************************
47 	  osl::access
48 
49 	  @see access
50 	  **********************************/
51 
access(const rtl::OUString & ustrPath,int mode)52 	 inline int access(const rtl::OUString& ustrPath, int mode)
53  	 {
54  		return access_u(ustrPath.pData, mode);
55   	 }
56 
57 	 /***********************************
58 	  osl::realpath
59 
60 	  @descr
61 	  The return value differs from the
62 	  realpath function
63 
64 	  @returns sal_True on success else
65 	  sal_False
66 
67 	  @see realpath
68 	  **********************************/
69 
realpath(const rtl::OUString & ustrFileName,rtl::OUString & ustrResolvedName)70 	 inline sal_Bool realpath(
71  		const rtl::OUString& ustrFileName,
72 		rtl::OUString& ustrResolvedName)
73 	 {
74  		return realpath_u(ustrFileName.pData, &ustrResolvedName.pData);
75  	 }
76 
77 
78 	 /***********************************
79 	  osl::lstat
80 
81 	  @see lstat
82 	  **********************************/
83 
lstat(const rtl::OUString & ustrPath,struct stat & buf)84 	  inline int lstat(const rtl::OUString& ustrPath, struct stat& buf)
85 	  {
86 	  	 return lstat_u(ustrPath.pData, &buf);
87 	  }
88 
89     /***********************************
90           osl::mkdir
91           @see mkdir
92           **********************************/
mkdir(const rtl::OUString & aPath,mode_t aMode)93     inline int mkdir(const rtl::OUString& aPath, mode_t aMode)
94     {
95         return mkdir_u(aPath.pData, aMode);
96     }
97 
98  } // end namespace osl
99 
100 
101  #endif /* _OSL_UUNXAPI_HXX_ */
102 
103