1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "prop_n_exporter.h"
17 
18 #include <cstring>
19 #include <iostream>
20 #include <memory>
21 #include <sstream>
22 #include <unistd.h>
23 
24 #include "common/common_func.h"
25 #include "create_checksum.h"
26 #include "create_zip.h"
27 #include "create_gzip.h"
28 
29 namespace OHOS {
30 namespace AppExecFwk {
31 namespace LIBZIP {
32 using namespace std;
33 
Export()34 bool PropNExporter::Export()
35 {
36     return exports_.AddProp({
37         NapiValue::DeclareNapiFunction("createChecksum", CreateChecksum::Async),
38         NapiValue::DeclareNapiFunction("createChecksumSync", CreateChecksum::Sync),
39         NapiValue::DeclareNapiFunction("createZip", CreateZip::Async),
40         NapiValue::DeclareNapiFunction("createZipSync", CreateZip::Sync),
41         NapiValue::DeclareNapiFunction("createGZip", CreateGZip::Async),
42         NapiValue::DeclareNapiFunction("createGZipSync", CreateGZip::Sync),
43     });
44 }
45 
GetClassName()46 string PropNExporter::GetClassName()
47 {
48     return PropNExporter::className_;
49 }
50 
PropNExporter(napi_env env,napi_value exports)51 PropNExporter::PropNExporter(napi_env env, napi_value exports) : NapiExporter(env, exports) {}
52 } // namespace LIBZIP
53 } // namespace AppExecFwk
54 } // namespace OHOS