Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit 3dfdf1c

Browse files
author
wqyfavor
committed
[Core] Separate weex api result type from WeexApiHeader
1 parent ff7b42b commit 3dfdf1c

File tree

4 files changed

+67
-42
lines changed

4 files changed

+67
-42
lines changed

ios/sdk/WeexSDK.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@
314314
775BEE4E1C16F993008D1629 /* WXDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 775BEE4D1C16F993008D1629 /* WXDefine.h */; settings = {ATTRIBUTES = (Public, ); }; };
315315
775BEE6E1C1BD8F4008D1629 /* WXImgLoaderProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 775BEE6C1C1BD8F4008D1629 /* WXImgLoaderProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
316316
775BEE711C1BD977008D1629 /* WXModuleProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 775BEE701C1BD977008D1629 /* WXModuleProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
317+
77A3D66E222F9F5B0078A6F5 /* WeexApiValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 77A3D66D222F9F5B0078A6F5 /* WeexApiValue.h */; };
318+
77A3D66F222F9F5B0078A6F5 /* WeexApiValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 77A3D66D222F9F5B0078A6F5 /* WeexApiValue.h */; };
317319
77CF6A5621E6E47E00BA8634 /* core_constants.h in Headers */ = {isa = PBXBuildFile; fileRef = 77CF6A5421E6E47D00BA8634 /* core_constants.h */; };
318320
77CF6A5721E6E47E00BA8634 /* core_constants.h in Headers */ = {isa = PBXBuildFile; fileRef = 77CF6A5421E6E47D00BA8634 /* core_constants.h */; };
319321
77CF6A5821E6E47E00BA8634 /* log_defines.h in Headers */ = {isa = PBXBuildFile; fileRef = 77CF6A5521E6E47D00BA8634 /* log_defines.h */; };
@@ -1281,6 +1283,7 @@
12811283
775BEE4D1C16F993008D1629 /* WXDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDefine.h; sourceTree = "<group>"; };
12821284
775BEE6C1C1BD8F4008D1629 /* WXImgLoaderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXImgLoaderProtocol.h; sourceTree = "<group>"; };
12831285
775BEE701C1BD977008D1629 /* WXModuleProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXModuleProtocol.h; sourceTree = "<group>"; };
1286+
77A3D66D222F9F5B0078A6F5 /* WeexApiValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeexApiValue.h; sourceTree = "<group>"; };
12841287
77CF6A5421E6E47D00BA8634 /* core_constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = core_constants.h; sourceTree = "<group>"; };
12851288
77CF6A5521E6E47D00BA8634 /* log_defines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = log_defines.h; sourceTree = "<group>"; };
12861289
77D160FD1C02DBE70010B15B /* WeexSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WeexSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -2576,6 +2579,7 @@
25762579
B8D66B7D2125572F003960BD /* include */ = {
25772580
isa = PBXGroup;
25782581
children = (
2582+
77A3D66D222F9F5B0078A6F5 /* WeexApiValue.h */,
25792583
B8D66B7E2125572F003960BD /* WeexApiHeader.h */,
25802584
);
25812585
name = include;
@@ -2797,6 +2801,7 @@
27972801
33CE19132153444900CF9670 /* WXJSFrameworkLoadProtocol.h in Headers */,
27982802
B8F2C7142133A8BC00635B37 /* vm_monitor.h in Headers */,
27992803
B8D66C012125572F003960BD /* constants_value.h in Headers */,
2804+
77A3D66E222F9F5B0078A6F5 /* WeexApiValue.h in Headers */,
28002805
74AD99841D5B0E59008F0336 /* WXPolyfillSet.h in Headers */,
28012806
74A4BA961CB365D100195969 /* WXAppConfiguration.h in Headers */,
28022807
B8D66C8721255730003960BD /* simple_render_factory.h in Headers */,
@@ -2946,6 +2951,7 @@
29462951
DCA445A31EFA570800D0CFA8 /* WXSDKManager.h in Headers */,
29472952
DCA445BE1EFA57BB00D0CFA8 /* WXComponentManager.h in Headers */,
29482953
DCA4459E1EFA56E500D0CFA8 /* WXUtility.h in Headers */,
2954+
77A3D66F222F9F5B0078A6F5 /* WeexApiValue.h in Headers */,
29492955
DCA445B91EFA579D00D0CFA8 /* WXErrorView.h in Headers */,
29502956
B8D66BE42125572F003960BD /* exec_state.h in Headers */,
29512957
B8D66C022125572F003960BD /* constants_value.h in Headers */,

ios/sdk/WeexSDK/Sources/Utility/WXVersion.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#import "WXVersion.h"
2121
#import "WXDefine.h"
2222

23-
static const char* WeexSDKBuildTime = "2019-01-10 02:29:08 UTC";
24-
static const unsigned long WeexSDKBuildTimestamp = 1547087348;
23+
static const char* WeexSDKBuildTime = "2019-03-06 06:27:55 UTC";
24+
static const unsigned long WeexSDKBuildTimestamp = 1551853675;
2525

2626
NSString* GetWeexSDKVersion(void)
2727
{

weex_core/Source/include/WeexApiHeader.h

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include <vector>
2727
#include <set>
2828
#include <map>
29+
#include "WeexApiValue.h"
30+
2931
#ifdef OS_ANDROID
3032
#include <jni.h>
3133
#include "third_party/IPC/IPCResult.h"
@@ -39,16 +41,6 @@ namespace WeexCore {
3941
} // namespace WeexCore
4042
using namespace WeexCore;
4143

42-
struct WeexString {
43-
uint32_t length;
44-
uint16_t content[1];
45-
};
46-
47-
struct WeexByteArray {
48-
uint32_t length;
49-
char content[1];
50-
};
51-
5244
class WeexJSResult{
5345
public:
5446
std::unique_ptr<char[]> data;
@@ -62,36 +54,6 @@ typedef struct InitFrameworkParams {
6254
WeexByteArray *value;
6355
} INIT_FRAMEWORK_PARAMS;
6456

65-
66-
enum class ParamsType {
67-
INT32 = 1,
68-
INT64,
69-
FLOAT,
70-
DOUBLE,
71-
JSONSTRING,
72-
STRING,
73-
BYTEARRAY, /* terminated with zero. */
74-
VOID,
75-
JSUNDEFINED,
76-
END,
77-
};
78-
79-
80-
typedef union ExecJsParamValue {
81-
int32_t int32Value;
82-
int64_t int64Value;
83-
float floatValue;
84-
double doubleValue;
85-
WeexString *string;
86-
WeexByteArray *byteArray;
87-
} EXEC_JS_PARAM_VALUE;
88-
89-
typedef struct ValueWithType {
90-
ParamsType type;
91-
EXEC_JS_PARAM_VALUE value;
92-
} VALUE_WITH_TYPE;
93-
94-
9557
#ifdef OS_ANDROID
9658

9759
typedef void (*FuncSetJSVersion)(const char *jsVersion);
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
#pragma once
21+
22+
struct WeexString {
23+
uint32_t length;
24+
uint16_t content[1];
25+
};
26+
27+
struct WeexByteArray {
28+
uint32_t length;
29+
char content[1];
30+
};
31+
32+
enum class ParamsType {
33+
INT32 = 1,
34+
INT64,
35+
FLOAT,
36+
DOUBLE,
37+
JSONSTRING,
38+
STRING,
39+
BYTEARRAY, /* terminated with zero. */
40+
VOID,
41+
JSUNDEFINED,
42+
END,
43+
};
44+
45+
typedef union ExecJsParamValue {
46+
int32_t int32Value;
47+
int64_t int64Value;
48+
float floatValue;
49+
double doubleValue;
50+
WeexString *string;
51+
WeexByteArray *byteArray;
52+
} EXEC_JS_PARAM_VALUE;
53+
54+
typedef struct ValueWithType {
55+
ParamsType type;
56+
EXEC_JS_PARAM_VALUE value;
57+
} VALUE_WITH_TYPE;

0 commit comments

Comments
 (0)