diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index 3702555082812b786f5ee21f0e08af931925c25a..8b4b5914d370b082410495c9c74cf5457ed27e20 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed 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 @@ -113,9 +113,14 @@ ohos_shared_library("fs") { sources = file_common_src sources += [ + "src/mod_fileio/class_file/file_n_exporter.cpp", + "src/mod_fileio/class_stat_v9/stat_n_exporter_v9.cpp", "src/mod_fileio/common_func.cpp", "src/mod_fileio/module_v9.cpp", + "src/mod_fileio/properties/open_v9.cpp", "src/mod_fileio/properties/prop_n_exporter_v9.cpp", + "src/mod_fileio/properties/stat_v9.cpp", + "src/mod_fileio/properties/truncate_v9.cpp", ] deps = [ "//foundation/arkui/napi:ace_napi" ] diff --git a/interfaces/kits/js/src/mod_fileio/module_v9.cpp b/interfaces/kits/js/src/mod_fileio/module_v9.cpp index fe757490e42f3fdeda10b2745a409dcd35bdc31a..7f2bb4bce468ec1817b2ba05ec2711e856698752 100644 --- a/interfaces/kits/js/src/mod_fileio/module_v9.cpp +++ b/interfaces/kits/js/src/mod_fileio/module_v9.cpp @@ -17,6 +17,8 @@ #include #include "../common/log.h" +#include "class_file/file_n_exporter.h" +#include "class_stat_v9/stat_n_exporter_v9.h" #include "properties/prop_n_exporter_v9.h" using namespace std; @@ -28,6 +30,8 @@ static napi_value Export(napi_env env, napi_value exports) { std::vector> products; products.emplace_back(make_unique(env, exports)); + products.emplace_back(make_unique(env, exports)); + products.emplace_back(make_unique(env, exports)); for (auto &&product : products) { if (!product->Export()) { diff --git a/interfaces/kits/js/src/mod_fileio/properties/prop_n_exporter_v9.cpp b/interfaces/kits/js/src/mod_fileio/properties/prop_n_exporter_v9.cpp index 6efa9e8dfb487abbe1554f5fb0172dc6f4a14941..37fde834801800e486a7a7b6f6d89230ce3a98f2 100644 --- a/interfaces/kits/js/src/mod_fileio/properties/prop_n_exporter_v9.cpp +++ b/interfaces/kits/js/src/mod_fileio/properties/prop_n_exporter_v9.cpp @@ -23,6 +23,9 @@ #include #include "../common_func.h" +#include "open_v9.h" +#include "stat_v9.h" +#include "truncate_v9.h" namespace OHOS { namespace DistributedFS { @@ -273,8 +276,14 @@ napi_value PropNExporterV9::WriteSync(napi_env env, napi_callback_info info) bool PropNExporterV9::Export() { return exports_.AddProp({ + NVal::DeclareNapiFunction("open", OpenV9::Async), + NVal::DeclareNapiFunction("openSync", OpenV9::Sync), NVal::DeclareNapiFunction("read", Read), NVal::DeclareNapiFunction("readSync", ReadSync), + NVal::DeclareNapiFunction("stat", StatV9::Async), + NVal::DeclareNapiFunction("statSync", StatV9::Sync), + NVal::DeclareNapiFunction("truncate", TruncateV9::Async), + NVal::DeclareNapiFunction("truncateSync", TruncateV9::Sync), NVal::DeclareNapiFunction("write", Write), NVal::DeclareNapiFunction("writeSync", WriteSync), });