Kaydet (Commit) 9a038e5e authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fold uunxapi.h into uunxapi.hxx

Change-Id: Ic16758e436da13684320e7e3bf07b80d8d8c7c5d
üst 7b778239
......@@ -35,7 +35,7 @@
#include "file_error_transl.hxx"
#include "file_impl.hxx"
#include "file_url.hxx"
#include "uunxapi.h"
#include "uunxapi.hxx"
#include <algorithm>
#include <limits>
......
......@@ -33,7 +33,7 @@
#include "file_path_helper.h"
#include "uunxapi.h"
#include "uunxapi.hxx"
#include "getexecutablefile.hxx"
#include "nlsupport.hxx"
......
......@@ -19,7 +19,7 @@
#include <config_features.h>
#include "uunxapi.h"
#include "uunxapi.hxx"
#include "system.h"
#include <limits.h>
#include <rtl/ustring.hxx>
......@@ -186,19 +186,19 @@ int access_u(const rtl_uString* pustrPath, int mode)
return result;
}
sal_Bool realpath_u(const rtl_uString* pustrFileName, rtl_uString** ppustrResolvedName)
bool realpath_u(const rtl_uString* pustrFileName, rtl_uString** ppustrResolvedName)
{
rtl::OString fn = OUStringToOString(pustrFileName);
#ifdef ANDROID
if (fn == "/assets" || fn.startsWith("/assets/"))
{
if (access_u(pustrFileName, F_OK) == -1)
return sal_False;
return false;
rtl_uString silly(*pustrFileName);
rtl_uString_assign(ppustrResolvedName, &silly);
return sal_True;
return true;
}
#endif
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SAL_OSL_UNX_UUNXAPI_H
#define INCLUDED_SAL_OSL_UNX_UUNXAPI_H
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <rtl/ustring.h>
#ifdef __cplusplus
extern "C"
{
#endif
int access_u(const rtl_uString* pustrPath, int mode);
/***********************************
@descr
The return value differs from the
realpath function
@returns sal_True on success else
sal_False
@see realpath
**********************************/
sal_Bool realpath_u(
const rtl_uString* pustrFileName,
rtl_uString** ppustrResolvedName);
int stat_c(const char *cpPath, struct stat* buf);
int lstat_c(const char *cpPath, struct stat* buf);
int lstat_u(const rtl_uString* pustrPath, struct stat* buf);
int mkdir_u(const rtl_uString* path, mode_t mode);
int open_c(const char *cpPath, int oflag, int mode);
int utime_c(const char *cpPath, struct utimbuf *times);
int ftruncate_with_name(int fd, sal_uInt64 uSize, rtl_String* path);
#ifdef __cplusplus
}
#endif
#endif // INCLUDED_SAL_OSL_UNX_UUNXAPI_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -20,10 +20,44 @@
#ifndef INCLUDED_SAL_OSL_UNX_UUNXAPI_HXX
#define INCLUDED_SAL_OSL_UNX_UUNXAPI_HXX
#include "uunxapi.h"
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
int access_u(const rtl_uString* pustrPath, int mode);
/***********************************
@descr
The return value differs from the
realpath function
@returns sal_True on success else
sal_False
@see realpath
**********************************/
bool realpath_u(
const rtl_uString* pustrFileName,
rtl_uString** ppustrResolvedName);
int stat_c(const char *cpPath, struct stat* buf);
int lstat_c(const char *cpPath, struct stat* buf);
int lstat_u(const rtl_uString* pustrPath, struct stat* buf);
int mkdir_u(const rtl_uString* path, mode_t mode);
int open_c(const char *cpPath, int oflag, int mode);
int utime_c(const char *cpPath, struct utimbuf *times);
int ftruncate_with_name(int fd, sal_uInt64 uSize, rtl_String* path);
namespace osl
{
inline int access(const rtl::OUString& ustrPath, int mode)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment