10e98b08fSopenharmony_ci/* 20e98b08fSopenharmony_ci * Copyright (c) 2020 Huawei Device Co., Ltd. 30e98b08fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 40e98b08fSopenharmony_ci * you may not use this file except in compliance with the License. 50e98b08fSopenharmony_ci * You may obtain a copy of the License at 60e98b08fSopenharmony_ci * 70e98b08fSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 80e98b08fSopenharmony_ci * 90e98b08fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 100e98b08fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 110e98b08fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 120e98b08fSopenharmony_ci * See the License for the specific language governing permissions and 130e98b08fSopenharmony_ci * limitations under the License. 140e98b08fSopenharmony_ci */ 150e98b08fSopenharmony_ci 160e98b08fSopenharmony_ci#ifndef JS_NATIVE_API_FS_H 170e98b08fSopenharmony_ci#define JS_NATIVE_API_FS_H 180e98b08fSopenharmony_ci 190e98b08fSopenharmony_ci#include "jsi/jsi.h" 200e98b08fSopenharmony_ci#include "nativeapi_config.h" 210e98b08fSopenharmony_ci 220e98b08fSopenharmony_cinamespace OHOS { 230e98b08fSopenharmony_cinamespace ACELite { 240e98b08fSopenharmony_ciclass NativeapiFs { 250e98b08fSopenharmony_cipublic: 260e98b08fSopenharmony_ci NativeapiFs() = default; 270e98b08fSopenharmony_ci ~NativeapiFs() = default; 280e98b08fSopenharmony_ci 290e98b08fSopenharmony_ci static JSIValue MoveFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 300e98b08fSopenharmony_ci static JSIValue CopyFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 310e98b08fSopenharmony_ci static JSIValue DeleteFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 320e98b08fSopenharmony_ci static JSIValue GetFileList(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 330e98b08fSopenharmony_ci static JSIValue GetFileInfo(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 340e98b08fSopenharmony_ci static JSIValue WriteTextFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 350e98b08fSopenharmony_ci static JSIValue ReadTextFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 360e98b08fSopenharmony_ci static JSIValue Access(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 370e98b08fSopenharmony_ci static JSIValue CreateDir(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 380e98b08fSopenharmony_ci static JSIValue RemoveDir(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 390e98b08fSopenharmony_ci 400e98b08fSopenharmony_ci#if (JS_FWK_TYPEDARRAY == NATIVE_FEATURE_ON) 410e98b08fSopenharmony_ci static JSIValue ReadArrayFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 420e98b08fSopenharmony_ci static JSIValue WriteArrayFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); 430e98b08fSopenharmony_ci#endif /* JS_FWK_TYPEDARRAY */ 440e98b08fSopenharmony_ci}; 450e98b08fSopenharmony_ci} // ACELite 460e98b08fSopenharmony_ci} // OHOS 470e98b08fSopenharmony_ci 480e98b08fSopenharmony_ci#endif /* JS_NATIVE_API_FS_H */ 49