/napi_generator/src/cli/h2dtscpp/src/src/napiGen/ |
H A D | functionDirectTest.js | 71 funcInfoParamReplace = replaceAll(funcInfoParamReplace, '[paramType]', funcInfo.params[i].type); 73 let testType = getTestType(funcInfo.params[i].type); 119 if (objValue[j].type === 'number') { 121 } else if (objValue[j].type === 'string') { 123 } else if (objValue[j].type === 'boolean') { 125 } else if (InterfaceList.getBody(objValue[j].type)) { 127 } else if (objValue[j].type.indexOf('=>') >= 0) { // 成员方法 128 let interfaceFunc = objValue[j].type; 166 function getTestType(type) { 168 type [all...] |
/napi_generator/src/cli/dts2cpp/src/gen/generate/ |
H A D | return_generate.js | 38 function cToJsForType(value, type, dest, deep) { 41 let ifl = TypeList.getValue(type); 45 let type2 = ifl[i].type; 71 function cToJsForInterface(value, type, dest, deep) { 74 let ifl = InterfaceList.getValue(type); 77 let type2 = ifl[i].type; 102 function c2JsForEnum(deep, type, value, dest, propertyName) { 105 let ifl = EnumList.getValue(type); 108 type2 = ifl[0].type; 117 std::underlying_type<%s>::type enumTyp [all...] |
H A D | type.js | 21 function getHDefineOfType(data, name, type, variable, inNamespace, nameSpaceName, toolNamespace) { 22 if (typeof (type) === 'object') { 29 } else if (type.indexOf('|') >= 0) { 31 } else if (type === 'string') { 34 else if (type === 'boolean') { 37 else if (type.substring(0, 12) === 'NUMBER_TYPE_') { 38 variable.hDefine += '\n typedef %s %s;'.format(type, name); 43 `.format(name, type)); 74 function getHDefineOfVariable(name, type, variable, optional) { 75 if (type [all...] |
H A D | param_generate.js | 35 function getCType(type) { 36 if (type === 'boolean') { 38 } else if (type === 'string') { 40 } else if (type.substring(0, 6) === 'Array<' || type.substring(type.length - 2) === '[]') { 41 return 'std::vector<%s>'.format(getArrayTypeTemplete(type)); 42 } else if (type.substring(0, 4) === 'Map<' || type.indexOf('{[key:') === 0) { 43 return getMapCType(type); [all...] |
H A D | interface.js | 73 function getHDefineOfVariable(name, type, variable, optional) { 74 if (type.indexOf('|') >= 0) { 75 unionTypeString(name, type, variable, optional); 76 } else if (type === 'string') { 78 } else if (InterfaceList.getValue(type)) { 79 variableTypeInterface(optional, variable, type, name); 80 } else if (EnumList.getValue(type)) { 82 variableTypeEnum(type, variable, name); 83 } else if (type.indexOf('Array<') === 0) { 84 typeArrFunctionOne(type, variabl [all...] |
H A D | class.js | 43 function generateVariable(name, type, variable, className) { 44 if (type === 'string') { 46 } else if (type.substring(0, 12) === 'NUMBER_TYPE_') { 47 variable.hDefine += '\n %s %s;'.format(type, name); 48 } else if (InterfaceList.getValue(type)) { 49 variable.hDefine += '\n %s %s;'.format(type, name); 50 } else if (type.indexOf('Array<') === 0) { 51 let type2 = getArrayType(type); 59 } else if (type === 'boolean') { 61 } else if (type [all...] |
H A D | function_sync.js | 143 NapiLog.logInfo('returnProcRetC2Js void type do nothing!'); 156 function fillCbRetValueStruct(type, param, outName) { 157 if (type === null || param === null || param.valueOut === null || param.valueDefine === null) { 162 if (type === 'void') { 163 NapiLog.logInfo("The current void type don't need generate"); 164 } else if (type === 'string') { 166 } else if (type === 'boolean') { 168 } else if (type.substring(0, 12) === 'NUMBER_TYPE_') { 169 param.cbRetvalueDefine += '%s%s& %s'.format(param.cbRetvalueDefine.length > 0 ? ', ' : '', type, outName); 170 } else if (type [all...] |
/napi_generator/src/cli/dts2cpp/src/gen/tools/ |
H A D | common.js | 45 FuncType.ToString = function (type) { 46 if (type === FuncType.DIRECT) { 48 } else if (type === FuncType.SYNC) { 50 } else if (type === FuncType.ASYNC) { 52 } else if (type === FuncType.PROMISE) { 183 function getArrayType(type) { 184 let tt = re.match('Array<([a-zA-Z_0-9]+)>', type); 186 return re.getReg(type, tt.regs[1]); 189 tt = re.match('Array<{([[a-z:]+)([a-z:]]+)([a-zA-Z_1-9:]+)', type); 194 let regs1 = re.getReg(type, t [all...] |
/napi_generator/src/cli/dts2ets/appCodeGen/src/tools/ |
H A D | common.js | 45 FuncType.ToString = function (type) { 46 if (type === FuncType.DIRECT) { 48 } else if (type === FuncType.ASYNC) { 50 } else if (type === FuncType.PROMISE) { 182 function getArrayType(type) { 183 let tt = re.match('Array<([a-zA-Z_0-9]+)>', type); 185 return re.getReg(type, tt.regs[1]); 188 tt = re.match('Array<{([[a-z:]+)([a-z:]]+)([a-zA-Z_1-9:]+)', type); 193 let regs1 = re.getReg(type, tt.regs[i]); 199 tt = re.match('Array<map<string', type); [all...] |
/napi_generator/src/cli/dts2cpp/src/gen/analyze/ |
H A D | function.js | 62 type: valueType, 67 let arrayType = re.match('(Async)*Callback<(Array<([a-zA-Z_0-9]+)>)>', v.type); 68 let parameter = v.type; 70 parameter = re.getReg(v.type, arrayType.regs[2]); 75 v.type = v.type.replace(parameter, 'NUMBER_TYPE_' + NumberIncrease.getAndIncrease()); 77 v.type = v.type.replace(parameter, 'string'); 79 NapiLog.logError('analyzeFunction getFuncParaType is not support this type %s.' 88 v.type [all...] |
H A D | params.js | 20 function isSyncFuncType(type, funcType) { 22 if (funcType === FuncType.DIRECT && type.indexOf('Callback') >= 0 && type.indexOf('AsyncCallback') < 0 || 23 isFuncType(type) || isArrowFunc(type)) { 52 let hasProperty = Object.prototype.hasOwnProperty.call(bodyRes[i], 'type'); 53 if (hasProperty && bodyRes[i].type === 'number') { 54 bodyRes[i].type = 'NUMBER_TYPE_' + NumberIncrease.getAndIncrease(); 87 let type = re.getReg(v, matchs.regs[3]); 88 if (type [all...] |
H A D | enum.js | 53 type: 'string', 62 type: 'string', 72 type: 'NUMBER_TYPE_' + NumberIncrease.getAndIncrease(), 81 type: 'NUMBER_TYPE_' + NumberIncrease.getAndIncrease(),
|
H A D | namespace.js | 21 const { analyzeType, analyzeType2, analyzeType2Result } = require('./type'); 44 type: [], 135 if (v.type === enumm.name) { 137 v.type = 'NUMBER_TYPE_' + NumberIncrease.getAndIncrease(); 139 v.type = 'string'; 141 NapiLog.logError('parseEnumType for interface function value is not support this type %s.' 145 result.interface[i].body.function[j].value[k].type = v.type; 216 if (!isValidValue(result) || !isValidValue(result.type)) { 217 NapiLog.logError('getTypeInfo: result or result.type i [all...] |
/napi_generator/src/cli/dts2ets/appCodeGen/src/analyze/ |
H A D | function.js | 62 type: valueType, 67 let arrayType = re.match('(Async)*Callback<(Array<([a-zA-Z_0-9]+)>)>', v.type); 68 let parameter = v.type; 70 parameter = re.getReg(v.type, arrayType.regs[2]); 75 v.type = v.type.replace(parameter, 'NUMBER_TYPE_' + NumberIncrease.getAndIncrease()); 77 v.type = v.type.replace(parameter, 'string'); 79 NapiLog.logError('analyzeFunction getFuncParaType is not support this type %s.' 88 v.type [all...] |
H A D | params.js | 20 function isSyncFuncType(type, funcType) { 22 if (funcType === FuncType.DIRECT && type.indexOf('Callback') >= 0 && type.indexOf('AsyncCallback') < 0 || 23 isFuncType(type) || isArrowFunc(type)) { 52 let hasProperty = Object.prototype.hasOwnProperty.call(bodyRes[i], 'type'); 53 if (hasProperty && bodyRes[i].type === 'number') { 54 bodyRes[i].type = 'NUMBER_TYPE_' + NumberIncrease.getAndIncrease(); 87 let type = re.getReg(v, matchs.regs[3]); 88 if (type [all...] |
H A D | enum.js | 53 type: 'string', 62 type: 'string', 72 type: 'NUMBER_TYPE_' + NumberIncrease.getAndIncrease(), 81 type: 'NUMBER_TYPE_' + NumberIncrease.getAndIncrease(),
|
H A D | namespace.js | 21 const { analyzeType, analyzeType2, analyzeType2Result } = require('./type'); 44 type: [], 135 if (v.type === enumm.name) { 137 v.type = 'NUMBER_TYPE_' + NumberIncrease.getAndIncrease(); 139 v.type = 'string'; 141 NapiLog.logError('parseEnumType for interface function value is not support this type %s.' 145 result.interface[i].body.function[j].value[k].type = v.type; 216 if (!isValidValue(result) || !isValidValue(result.type)) { 217 NapiLog.logError('getTypeInfo: result or result.type i [all...] |
/napi_generator/test/unittest/ |
H A D | analyze.test.js | 22 const { analyzeType, analyzeType2 } = require(genDir + 'analyze/type');
89 let element = retJson.search('\'name\':\'DENIED\',\'value\':\'-1\',\'type\':\'string\'');
98 let element = retJson.search('\'name\':\'FAULT\',\'value\':\'1\',\'type\':\'NUMBER_TYPE_');
106 element: [{ name: 'STATUS0', value: '0', type: 'string' }],
117 element: [{ name: 'STATUS1', value: '0', type: 'NUMBER_TYPE_1' }],
135 type: [],
152 type: [],
166 let v = { name: 'v1', type: 'string' };
168 assert.strictEqual(retJson, '{\'name\':\'v1\',\'type\':\'string\'}');
178 let retNum = retJson.search('{\'name\':\'num1\',\'type\' [all...] |
H A D | generate.test.js | 114 let valueFi = { name: 'v1', type: 'string' };
115 let value1Se = { name: 'cb', type: 'AsyncCallback<string>' };
116 let funParam = { name: 'if_async', type: 4, value: [valueFi, value1Se], ret: 'string' }
122 function: [{ name: 'if_async', type: 4, value: [valueFi, value1Se], ret: 'string' }],
125 type: [],
133 let valueFi = [{ name: 'v1', type: 'string', optional: false }, {name: 'v2', type: 'boolean', optional: true}];
134 let funParam = { name: 'if_direct', type: 1, value: valueFi, ret: 'string', isStatic: false };
140 function: [{ name: 'if_direct', type: 1, value: [valueFi], ret: 'string', isStatic: false }],
143 type [all...] |
/napi_generator/src/intellij_plugin/h2dtscpp/native_IntelliJ_plugin/src/com/sk/na/utils/ |
H A D | GenNotification.java | 46 * @param type 提示类型 Error,Waring,info 51 NotificationType type) { in notifyMessage() 55 Notification notification = notificationGroup.createNotification(content, type); in notifyMessage() 59 if (NotificationType.ERROR.equals(type)) { in notifyMessage() 61 } else if (NotificationType.WARNING.equals(type)) { in notifyMessage() 48 notifyMessage(@avax.annotation.Nullable Project project, String content, String title, NotificationType type) notifyMessage() argument
|
/napi_generator/src/intellij_plugin/cmake2gn/gn_IntelliJ_plugin/src/com/sk/gn/utils/ |
H A D | GenNotification.java | 50 * @param type 提示类型 Error,Waring,info 53 NotificationType type) { in notifyMessage() 54 notifyMessage(project, content, title, type, false); in notifyMessage() 63 * @param type 提示类型 Error,Waring,info 67 NotificationType type, boolean addAct) { in notifyMessage() 69 Notification notification = new Notification("Generate.Result.Group", "Notes Message", content, type); in notifyMessage() 73 if (NotificationType.ERROR.equals(type)) { in notifyMessage() 75 } else if (NotificationType.WARNING.equals(type)) { in notifyMessage() 52 notifyMessage(@avax.annotation.Nullable Project project, String content, String title, NotificationType type) notifyMessage() argument 66 notifyMessage(@avax.annotation.Nullable Project project, String content, String title, NotificationType type, boolean addAct) notifyMessage() argument
|
/napi_generator/src/intellij_plugin/dts2cpp/napi_IntelliJ_plugin/src/com/sk/utils/ |
H A D | GenNotification.java | 52 * @param type 提示类型 Error,Waring,info 57 NotificationType type) { in notifyMessage() 61 Notification notification = notificationGroup.createNotification(content, type); in notifyMessage() 65 if (NotificationType.ERROR.equals(type)) { in notifyMessage() 67 } else if (NotificationType.WARNING.equals(type)) { in notifyMessage() 82 * @param type 提示类型 Error,Waring,info 85 String title, NotificationType type) { in notifyGenResult() 88 Notification notification = notificationGroup.createNotification("", type); in notifyGenResult() 54 notifyMessage(@avax.annotation.Nullable Project project, String content, String title, NotificationType type) notifyMessage() argument 84 notifyGenResult(@avax.annotation.Nullable Project project, List<FileInfo> newFileList, String title, NotificationType type) notifyGenResult() argument
|
/napi_generator/src/intellij_plugin/h2dts/ts_IntelliJ_plugin/src/com/sk/ts/utils/ |
H A D | GenNotification.java | 53 * @param type 提示类型 Error,Waring,info 58 NotificationType type) { in notifyMessage() 62 Notification notification = notificationGroup.createNotification(content, type); in notifyMessage() 66 if (NotificationType.ERROR.equals(type)) { in notifyMessage() 68 } else if (NotificationType.WARNING.equals(type)) { in notifyMessage() 83 * @param type 提示类型 Error,Waring,info 86 String title, NotificationType type) { in notifyGenResult() 89 Notification notification = notificationGroup.createNotification("", type); in notifyGenResult() 55 notifyMessage(@avax.annotation.Nullable Project project, String content, String title, NotificationType type) notifyMessage() argument 85 notifyGenResult(@avax.annotation.Nullable Project project, List<FileInfo> newFileList, String title, NotificationType type) notifyGenResult() argument
|
/napi_generator/src/intellij_plugin/h2sa/service_IntelliJ_plugin/src/com/sk/service/utils/ |
H A D | GenNotification.java | 50 * @param type 提示类型 Error,Waring,info 53 NotificationType type) { in notifyMessage() 54 notifyMessage(project, content, title, type, false); in notifyMessage() 63 * @param type 提示类型 Error,Waring,info 67 NotificationType type, boolean addAct) { in notifyMessage() 69 Notification notification = new Notification("Generate.Result.Group", "Notes Message", content, type); in notifyMessage() 73 if (NotificationType.ERROR.equals(type)) { in notifyMessage() 75 } else if (NotificationType.WARNING.equals(type)) { in notifyMessage() 52 notifyMessage(@avax.annotation.Nullable Project project, String content, String title, NotificationType type) notifyMessage() argument 66 notifyMessage(@avax.annotation.Nullable Project project, String content, String title, NotificationType type, boolean addAct) notifyMessage() argument
|
/napi_generator/src/tool/api/api_scan_IntelliJ_plugin/src/com/kh/scan/utils/ |
H A D | GenNotification.java | 53 * @param type 提示类型 Error,Waring,info 56 NotificationType type) { in notifyMessage() 57 Notification notification = new Notification("Generate.Result.Group", "Notes Message", content, type); in notifyMessage() 61 if (NotificationType.ERROR.equals(type)) { in notifyMessage() 63 } else if (NotificationType.WARNING.equals(type)) { in notifyMessage() 79 * @param type 提示类型 Error,Waring,info 82 String title, NotificationType type) { in notifyGenResult() 85 Notification notification = notificationGroup.createNotification("", type); in notifyGenResult() 55 notifyMessage(@avax.annotation.Nullable Project project, String content, String title, NotificationType type) notifyMessage() argument 81 notifyGenResult(@avax.annotation.Nullable Project project, List<FileInfo> newFileList, String title, NotificationType type) notifyGenResult() argument
|