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