Home
last modified time | relevance | path

Searched refs:name (Results 1 – 25 of 52) sorted by relevance

123

/napi_generator/src/gen/generate/
Dinterface.js47 function getHDefineOfVariable(name, type, variable) { argument
49 unionTypeString(name, type, variable)
50 } else if (type == "string") variable.hDefine += "\n std::string %s;".format(name)
51 else if (InterfaceList.getValue(type)) variable.hDefine += "\n %s %s;".format(type, name)
52 else if (EnumList.getValue(type)) variable.hDefine += "\n %s %s;".format(type, name)
56 variable.hDefine += "\n std::string %s_type; \n std::any %s;".format(name,name)
59 variable.hDefine += "\n std::vector<%s> %s;".format(cType, name)
62 variable.hDefine += "\n bool %s;".format(name)
66 variable.hDefine += "\n std::string %s_type; \n std::any %s;".format(name,name)
69 variable.hDefine += "\n std::vector<%s> %s;".format(cType, name)
[all …]
Dclass.js45 function generateVariable(name, type, variable, className) { argument
46 if (type == "string") variable.hDefine += "\n std::string %s;".format(name)
47 … if (type.substring(0, 12) == "NUMBER_TYPE_") variable.hDefine += "\n %s %s;".format(type, name)
48 else if (InterfaceList.getValue(type)) variable.hDefine += "\n %s %s;".format(type, name)
53 variable.hDefine += "\n std::vector<%s> %s;".format(type2, name)
55 variable.hDefine += "\n bool %s;".format(name)
57 variable.hDefine += "\n std::vector<%s> %s;".format(type, name)
62 `.format(name, type));
69 `.format(name, className, className) + cToJs("p->" + name, type, "result") + `
77 `.format(name, className, className) + jsToC("p->" + name, "pxt->GetArgv(0)", type) + `
[all …]
Denum.js18 function generateEnum(name, data) { argument
24 implH = `\nclass %s {\npublic:\n`.format(name, implH)
26 implH = `\nenum %s {\n`.format(name, implH)
34 midInitEnum += ' std::map<const char *, std::any> enumMap%s;\n'.format(name)
38 implH += ` static const std::string %s;\n`.format(v.name)
39 … implCpp += `\nconst std::string %s::%s = "%s";\n`.format(name, v.name, v.value)
40 midInitEnum += ' enumMap%s["%s"] = "%s";\n'.format(name, v.name, v.value)
45 implH += ` %s = %s,\n`.format(v.name, v.value)
46 midInitEnum += ' enumMap%s["%s"] = %s;\n'.format(name, v.name, v.value)
49 midInitEnum += ' pxt->CreateEnumObject("%s", enumMap%s);\n'.format(name, name)
Dnamespace.js28 if (parentName == data.interface[i].name) {
34 if (parentName == data.class[i].name) {
53 …NapiLog.logError("Failed to find %s's parent by name [%s]".format(currentObj.body.name, parentName…
98 function generateNamespace(name, data, inNamespace = "") { argument
106 namespaceResult.middleInit += formatMiddleInit(inNamespace, name)
116 let result = generateInterface(ii.name, ii.body, inNamespace + name + "::")
122 let result = generateClass(ii.name, ii.body, inNamespace + name + "::", ii.functiontType)
132 … .format(func.name, inNamespace, name, func.name, inNamespace.length > 0 ? ", " + name : "")
136 let result = generateNamespace(ns.name, ns.body, inNamespace + name + "::")
144 …return generateResult(name, namespaceResult.implH, namespaceResult.implCpp, namespaceResult.middle…
[all …]
Dparam_generate.js31 function getValueProperty(napiVn, name) { argument
32 return 'pxt->GetValueProperty(%s, "%s")'.format(napiVn, name)
54 let name2 = ifl[i].name
284 let name = funcValue.name
292 return paramGenerateAnyArray(p, name, type, param)
299 : "", arrayType, modifiers, name)
310 return paramGenerateAnyArray(p, name, type, param)
327 : "", arrayType, modifiers, name)
329 …NapiLog.logError("The current version do not support to this param to generate :", name, "type :",…
333 function paramGenerateAny(p, name, type, param) { argument
[all …]
Dreturn_generate.js45 let name2 = ifl[i].name
234 … napi_value tnv_%s = nullptr;\n`.format(interfaceValue[i].name, interfaceValue[i].name)
237 ….format(interfaceValue[i].name, interfaceValue[i].name, interfaceValue[i].name, interfaceValue[i].
239 .format(interfaceValue[i].name, interfaceValue[i].name, interfaceValue[i].name)
243 … napi_value tnv_%s = nullptr;\n`.format(interfaceValue[i].name, interfaceValue[i].name)
246 ….format(interfaceValue[i].name, interfaceValue[i].name, interfaceValue[i].name, interfaceValue[i].
248 .format(interfaceValue[i].name, interfaceValue[i].name, interfaceValue[i].name)
252 … napi_value tnv_%s = nullptr;\n`.format(interfaceValue[i].name, interfaceValue[i].name)
255 ….format(interfaceValue[i].name, interfaceValue[i].name, interfaceValue[i].name, interfaceValue[i].
257 .format(interfaceValue[i].name, interfaceValue[i].name, interfaceValue[i].name)
Dfunction_async.js112 let middleFunc = replaceAll(funcAsyncTemplete, "[funcName]", func.name)
137 …s_execute, vio, %s_complete, pxt->GetArgc() == %s ? pxt->GetArgv(%d) : nullptr);`.format(func.name,
138 func.name, parseInt(param.callback.offset) + 1, param.callback.offset))// 注册异步调用
139 …let callFunc = "%s%s(%s);".format(className == null ? "" : "pInstance->", func.name, param.valueFi…
150 prefixArr[0], prefixArr[1], prefixArr[2], func.name, param.valueDefine)
151 …implCpp = cppTemplate.format(className == null ? "" : className + "::", func.name, param.valueDefi…
Dfunction_onoff.js114 codeContext.middleFunc = replaceAll(funcOnOffTemplete, "[funcName]", func.name)
127 let registLine = func.name == 'on' ? "pxt->RegistAsyncFunc(vio->eventName, pxt->GetArgv(1));"
131 codeContext.implH += "\nbool %s(%s);".format(func.name, param.valueDefine)
137 `.format(className == null ? "" : className + "::", func.name, param.valueDefine)
139 addOnOffFunc(data, func.name)
187 if (!isOnOffFuncExist(data, func.name)) {
192 if (func.name == 'on') {
Dfunction_direct.js66 let middleFunc = replaceAll(funcDirectTemplete, "[funcName]", func.name)
98 …let callFunc = "%s%s(%s);".format(className == null ? "" : "pInstance->", func.name, param.valueFi…
108 prefixArr[0], prefixArr[1], prefixArr[2], func.name, param.valueDefine)
109 …implCpp = cppTemplate.format(className == null ? "" : className + "::", func.name, param.valueDefi…
Dfunction_sync.js81 let middleFunc = replaceAll(funcSyncTemplete, "[funcName]", func.name)
109 …let callFunc = "%s%s(%s);".format(className == null ? "" : "pInstance->", func.name, param.valueFi…
123 prefixArr[0], prefixArr[1], prefixArr[2], func.name, param.valueDefine)
124 …implCpp = cppTemplate.format(className == null ? "" : className + "::", func.name, param.valueDefi…
/napi_generator/docs/
DROADMAP_ZH.md9 <a name="table143385853320"></a>
10 … width="25%" id="mcps1.2.3.1.1"><p id="p20331858193317"><a name="p20331858193317"></a><a name="p20…
12 …p" width="45%" id="mcps1.2.3.1.2"><p id="p1133115820331"><a name="p1133115820331"></a><a name="p11…
16 …th="25%" headers="mcps1.2.3.1.1 "><p id="p2142111345714"><a name="p2142111345714"></a><a name="p21…
18 …border" valign="top" width="45%" headers="mcps1.2.3.1.2 "><a name="ul9264132010"></a><a name="ul92…
21 …="25.77%" headers="mcps1.2.3.1.1 "><p id="p382391145710"><a name="p382391145710"></a><a name="p382…
23 …top" width="74.22999999999999%" headers="mcps1.2.3.1.2 "><a name="ul334485413318"></a><a name="ul3…
25 …="25.77%" headers="mcps1.2.3.1.1 "><p id="p919862210573"><a name="p919862210573"></a><a name="p919…
27 …top" width="74.22999999999999%" headers="mcps1.2.3.1.2 "><a name="ul12374158862"></a><a name="ul12…
31 …"25.77%" headers="mcps1.2.3.1.1 "><p id="p1818191195713"><a name="p1818191195713"></a><a name="p18…
[all …]
/napi_generator/hdc/service-gen/src/gen/
Dgenerate.js54 paramStr += params[i].type + " " + params[i].name;
121 proxyFunc = replaceAll(proxyFunc, "[funcName]", funcInfo.name);
132 writeDataStr += genWriteString(param.name, "data", param.type);
150 innerFunc = replaceAll(innerFunc, "[funcName]", funcInfo.name);
158 let innerParamName = param.name + "Val";
166 readDataStr += "\n" + tab + genReadString("data", param.name + "Val", param.type);
174 … writeReplyStr += "%s(%s); // call business implementation".format(funcInfo.name, innerParamStr);
178 funcInfo.retType, funcInfo.name, innerParamStr);
189 serviceFunc = replaceAll(serviceFunc, "[funcName]", funcInfo.name);
222 files.buildGn = replaceAll(files.buildGn, "[stubCppFile]", fileContent.stubCppFile.name);
[all …]
Danalyze.js54 param.name = parseParamInfo.name;
71 funcInfo.name = parseFuncInfo.name;
103 classInfo.name = parseClassInfo.name;
124 let filePath = re.pathJoin(destDir, fileInfo.name);
/napi_generator/release-notes/
Dnapi_generator-1.0.md3 ## 版本概述<a name="section249611124916"></a>
7 ## 版本特性<a name="section249611124917"></a>
10 <a name="table143385853320"></a>
11 …dth="25.77%" id="mcps1.2.3.1.1"><p id="p20331858193317"><a name="p20331858193317"></a><a name="p20…
13 …999999999999%" id="mcps1.2.3.1.2"><p id="p1133115820331"><a name="p1133115820331"></a><a name="p11…
17 …"25.77%" headers="mcps1.2.3.1.1 "><p id="p2142111345714"><a name="p2142111345714"></a><a name="p21…
19 …"top" width="74.22999999999999%" headers="mcps1.2.3.1.2 "><a name="ul9264132010"></a><a name="ul92…
22 …="25.77%" headers="mcps1.2.3.1.1 "><p id="p382391145710"><a name="p382391145710"></a><a name="p382…
24 …top" width="74.22999999999999%" headers="mcps1.2.3.1.2 "><a name="ul334485413318"></a><a name="ul3…
27 …"25.77%" headers="mcps1.2.3.1.1 "><p id="p1818191195713"><a name="p1818191195713"></a><a name="p18…
[all …]
/napi_generator/test/storytest/test_optional/
Dtest.js150 assert.notEqual(ret.name, undefined)
156 ret = test.fun51({ name: 'n1', age: 20 }); property
158 ret = test.fun51({ name: 'n1', age: 20 }, { name: 'n2', age: 30 }); property
160 ret = test.fun51({ name: 'n1', age: 20 }, property
161 { name: 'n2', age: 30 }, { name: 'n3', age: 40 }); property
164 ret = test.fun52({ name: 'n1', age: 20 }); property
166 ret = test.fun52({ name: 'n1', age: 20 }, property
167 [{ name: 'm1', age: 121 }, { name: 'm2', age: 123 }]); property
170 ret = test.fun53({ name: 'n1', age: 20 }); property
171 ret = test.fun53({ name: 'n1', age: 20 }, cb4); property
[all …]
/napi_generator/napi_vs_plugin/src/
Dextension.js49 function executor(name, genDir, mode, importIsCheck) { argument
51 exec(genCommand(name, genDir, mode, importIsCheck), function (error, stdout, stderr) {
61 function genCommand(name, genDir, mode, importIsCheck) { argument
64 return exeFilePath + genFileMode + name;
66 return exeFilePath + genFileMode + name + " -o " + genDir + " -i " + importIsCheck;
96 let name = message.fileNames;
99 checkMode(name, genDir, mode, importIsCheck);
151 function checkMode(name, genDir, mode, importIsCheck) { argument
152 name = re.replaceAll(name, " ", "");
153 if ("" == name) {
[all …]
/napi_generator/src/gen/
Dgenerate.js144 let result = generateNamespace(ns0.name, ns0.body)
155 middleCpp = replaceAll(middleCpp, "[implName]", ns0.name);
157 writeFile(re.pathJoin(destDir, "%s_middle.cpp".format(ns0.name)),
160 let implH = replaceAll(implHTemplete, "[impl_name_upper]", ns0.name.toUpperCase())
168 …writeFile(re.pathJoin(destDir, "%s.h".format(ns0.name)), null != license ? (license + "\n" + implH…
170 let implCpp = implCppTemplete.replaceAll("[implName]", ns0.name)
172 …writeFile(re.pathJoin(destDir, "%s.cpp".format(ns0.name)), null != license ? (license + "\n" + imp…
175 generateGYP(destDir, ns0.name, license)//生成ubuntu下测试的编译脚本
176 generateGN(destDir, ns0.name, license, partName)//生成BUILD.gn for ohos
/napi_generator/src/tsGen/
DtsMain.js49 nameSpaceInfo.name = parseNameSpaceInfo
118 param.name = parseParamInfo.name
132 funcInfo.name = parseFuncInfo.name
154 if (namespaces[i].name === funcInfo.namespace) {
159 …Error('The namespace [%s] of function %s is not found.'.format(funcInfo.namespace, funcInfo.name));
180 property.name = parseProperties[i].name
205 classInfo.name = parseClassInfo.name
215 if (namespaces[i].name === classInfo.namespace) {
220 …gError('The namespace [%s] of class %s is not found.'.format(classInfo.namespace, classInfo.name));
252 funcParams += func.params[i].name + ": " + func.params[i].type
[all …]
/napi_generator/hdc/gn-gen/src/
Dgenerate_gn.js47 function checkoutLibName(name) {//比如/home/libabc.so,返回["dynamic",abc] argument
48 let pn = path.parse(name);
121 staticTargets.push(t.path + ":" + t.name);
125 dynamicTargets.push(t.path + ":" + t.name);
129 executableTargets.push(t.path + ":" + t.name);
245 name: targetName[1] property
265 static genDetail(name, detail) { argument
275 `.format(name, ss)
283 static searchLib(name, genList) { argument
287 if (gen.target == name) {
[all …]
/napi_generator/test/storytest/test_extends/
Dtest.js37 assert.strictEqual(farther.name, '');
61 assert.strictEqual(bob.name, '');
70 assert.strictEqual(juliya.name, '');
83 assert.strictEqual(ret.name, '');
96 assert.strictEqual(juliya.name, '');
111 assert.strictEqual(juliya.name, '');
127 name: 'tom1', property
135 name: 'tom2', property
145 assert.strictEqual(retTom.name, '');
D@ohos.test.d.ts19 name: string; property
55 name: string;
78 name: string;
/napi_generator/test/unittest/
Dgenerate.test.js54 element: [{ name: "STATUS0", value: "0", type: "NUMBER_TYPE_1" }], property
103 let valueFi = { name: 'v1', type: 'string' }; property
104 let value1Se = { name: 'cb', type: 'AsyncCallback<string>' }; property
105 let funParam = { name: 'if_async', type: 4, value: [valueFi, value1Se], ret: 'string' } property
111 function: [{ name: 'if_async', type: 4, value: [valueFi, value1Se], ret: 'string' }], property
123 let valueFi = { name: 'v1', type: 'string' }; property
124 let funParam = { name: 'if_direct', type: 1, value: [valueFi], ret: 'string' }; property
130 function: [{ name: 'if_direct', type: 1, value: [valueFi], ret: 'string' }], property
141 let valueFi = { name: 'v1', type: 'string' }; property
142 let value1Se = { name: 'cb', type: 'Callback<string>' }; property
[all …]
/napi_generator/src/gen/analyze/
Dfunction.js50 name: valueName, property
104 name: interfaceName, property
144 name: interfaceName, property
155 function analyzeFunction(data, isStatic, name, values, ret) { argument
160 tmp = analyzeParams(name, res.values)
171 values.push({name: "promise", optional: false, type: paramType}) property
183 name: name, property
Denum.js51 name: elementName, property
60 name: elementName, property
70 name: elementName, property
79 name: elementName, property
/napi_generator/src/gen/tools/
Dcommon.js73 InterfaceList.getValue = function (name) { argument
76 if (ifs[i].name == name) {
91 EnumList.getValue = function (name) { argument
94 if (ifs[i].name == name) {
162 if (type == enumm.name) {
176 if (type == enumm.name) {

123