开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (7)
标签 (4)
master
gh-pages
dependabot/npm_and_yarn/projects/JavaScript/elliptic-6.5.3
dependabot/npm_and_yarn/projects/JavaScript/npm-6.14.6
dependabot/npm_and_yarn/projects/JavaScript/acorn-7.3.1
feature-Swift
feature-CSharp7
1.3.0.0
1.2.0.0
1.1.0.0
1.0.0.0
master
分支 (7)
标签 (4)
master
gh-pages
dependabot/npm_and_yarn/projects/JavaScript/elliptic-6.5.3
dependabot/npm_and_yarn/projects/JavaScript/npm-6.14.6
dependabot/npm_and_yarn/projects/JavaScript/acorn-7.3.1
feature-Swift
feature-CSharp7
1.3.0.0
1.2.0.0
1.1.0.0
1.0.0.0
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (7)
标签 (4)
master
gh-pages
dependabot/npm_and_yarn/projects/JavaScript/elliptic-6.5.3
dependabot/npm_and_yarn/projects/JavaScript/npm-6.14.6
dependabot/npm_and_yarn/projects/JavaScript/acorn-7.3.1
feature-Swift
feature-CSharp7
1.3.0.0
1.2.0.0
1.1.0.0
1.0.0.0
print.js 7.51 KB
一键复制 编辑 原始数据 按行查看 历史
Ivan Shynkarenka 提交于 2019年07月29日 08:51 +08:00 . Fixed JavaScript generator
/* eslint-disable prefer-const */
'use strict'
const prototest = require('../proto/test')
console.log(new prototest.StructSimple() + '\n')
console.log(new prototest.StructOptional() + '\n')
console.log(new prototest.StructNested() + '\n')
// Print bytes struct
let structBytes = new prototest.StructBytes()
// noinspection JSUnresolvedFunction
structBytes.f1 = Uint8Array.from('ABC', x => x.charCodeAt(0))
// noinspection JSUnresolvedFunction
structBytes.f2 = Uint8Array.from('test', x => x.charCodeAt(0))
console.log(structBytes + '\n')
// Print array struct
let structArray = new prototest.StructArray()
structArray.f1[0] = 48
structArray.f1[1] = 65
structArray.f2[0] = 97
structArray.f2[1] = undefined
structArray.f3[0] = Array.from('000', x => x.charCodeAt(0))
structArray.f3[1] = Array.from('AAA', x => x.charCodeAt(0))
structArray.f4[0] = Array.from('aaa', x => x.charCodeAt(0))
structArray.f4[1] = undefined
structArray.f5[0] = prototest.EnumSimple.ENUM_VALUE_1
structArray.f5[1] = prototest.EnumSimple.ENUM_VALUE_2
structArray.f6[0] = prototest.EnumSimple.ENUM_VALUE_1
structArray.f6[1] = undefined
structArray.f7[0] = prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2)
structArray.f7[1] = prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2 | prototest.FlagsSimple.FLAG_VALUE_3)
structArray.f8[0] = prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2)
structArray.f8[1] = undefined
structArray.f9[0] = new prototest.StructSimple()
structArray.f9[1] = new prototest.StructSimple()
structArray.f10[0] = new prototest.StructSimple()
structArray.f10[1] = undefined
console.log(structArray + '\n')
// Print vector struct
let structVector = new prototest.StructVector()
structVector.f1[0] = 48
structVector.f1[1] = 65
structVector.f2[0] = 97
structVector.f2[1] = undefined
structVector.f3[0] = Array.from('000', x => x.charCodeAt(0))
structVector.f3[1] = Array.from('AAA', x => x.charCodeAt(0))
structVector.f4[0] = Array.from('aaa', x => x.charCodeAt(0))
structVector.f4[1] = undefined
structVector.f5[0] = prototest.EnumSimple.ENUM_VALUE_1
structVector.f5[1] = prototest.EnumSimple.ENUM_VALUE_2
structVector.f6[0] = prototest.EnumSimple.ENUM_VALUE_1
structVector.f6[1] = undefined
structVector.f7[0] = prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2)
structVector.f7[1] = prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2 | prototest.FlagsSimple.FLAG_VALUE_3)
structVector.f8[0] = prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2)
structVector.f8[1] = undefined
structVector.f9[0] = new prototest.StructSimple()
structVector.f9[1] = new prototest.StructSimple()
structVector.f10[0] = new prototest.StructSimple()
structVector.f10[1] = undefined
console.log(structVector + '\n')
// Print list struct
let structList = new prototest.StructList()
structList.f1[0] = 48
structList.f1[1] = 65
structList.f2[0] = 97
structList.f2[1] = undefined
structList.f3[0] = Array.from('000', x => x.charCodeAt(0))
structList.f3[1] = Array.from('AAA', x => x.charCodeAt(0))
structList.f4[0] = Array.from('aaa', x => x.charCodeAt(0))
structList.f4[1] = undefined
structList.f5[0] = prototest.EnumSimple.ENUM_VALUE_1
structList.f5[1] = prototest.EnumSimple.ENUM_VALUE_2
structList.f6[0] = prototest.EnumSimple.ENUM_VALUE_1
structList.f6[1] = undefined
structList.f7[0] = prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2)
structList.f7[1] = prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2 | prototest.FlagsSimple.FLAG_VALUE_3)
structList.f8[0] = prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2)
structList.f8[1] = undefined
structList.f9[0] = new prototest.StructSimple()
structList.f9[1] = new prototest.StructSimple()
structList.f10[0] = new prototest.StructSimple()
structList.f10[1] = undefined
console.log(structList + '\n')
// Print set struct
let structSet = new prototest.StructSet()
structSet.f1.add(48)
structSet.f1.add(65)
structSet.f1.add(97)
structSet.f2.add(prototest.EnumSimple.ENUM_VALUE_1)
structSet.f2.add(prototest.EnumSimple.ENUM_VALUE_2)
structSet.f3.add(prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2))
structSet.f3.add(prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2 | prototest.FlagsSimple.FLAG_VALUE_3))
let s1 = new prototest.StructSimple()
s1.id = 48
structSet.f4.add(s1)
let s2 = new prototest.StructSimple()
s2.id = 65
structSet.f4.add(s2)
console.log(structSet + '\n')
// Print map struct
let structMap = new prototest.StructMap()
structMap.f1.set(10, 48)
structMap.f1.set(20, 65)
structMap.f2.set(10, 97)
structMap.f2.set(20, undefined)
structMap.f3.set(10, Array.from('000', x => x.charCodeAt(0)))
structMap.f3.set(20, Array.from('AAA', x => x.charCodeAt(0)))
structMap.f4.set(10, Array.from('aaa', x => x.charCodeAt(0)))
structMap.f4.set(20, undefined)
structMap.f5.set(10, prototest.EnumSimple.ENUM_VALUE_1)
structMap.f5.set(20, prototest.EnumSimple.ENUM_VALUE_2)
structMap.f6.set(10, prototest.EnumSimple.ENUM_VALUE_1)
structMap.f6.set(20, undefined)
structMap.f7.set(10, prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2))
structMap.f7.set(20, prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2 | prototest.FlagsSimple.FLAG_VALUE_3))
structMap.f8.set(10, prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2))
structMap.f8.set(20, undefined)
s1.id = 48
structMap.f9.set(10, s1)
s2.id = 65
structMap.f9.set(20, s2)
structMap.f10.set(10, s1)
structMap.f10.set(20, undefined)
console.log(structMap + '\n')
// Print hash struct
let structHash = new prototest.StructHash()
structHash.f1.set('10', 48)
structHash.f1.set('20', 65)
structHash.f2.set('10', 97)
structHash.f2.set('20', undefined)
structHash.f3.set('10', Array.from('000', x => x.charCodeAt(0)))
structHash.f3.set('20', Array.from('AAA', x => x.charCodeAt(0)))
structHash.f4.set('10', Array.from('aaa', x => x.charCodeAt(0)))
structHash.f4.set('20', undefined)
structHash.f5.set('10', prototest.EnumSimple.ENUM_VALUE_1)
structHash.f5.set('20', prototest.EnumSimple.ENUM_VALUE_2)
structHash.f6.set('10', prototest.EnumSimple.ENUM_VALUE_1)
structHash.f6.set('20', undefined)
structHash.f7.set('10', prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2))
structHash.f7.set('20', prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2 | prototest.FlagsSimple.FLAG_VALUE_3))
structHash.f8.set('10', prototest.FlagsSimple.fromFlags(prototest.FlagsSimple.FLAG_VALUE_1 | prototest.FlagsSimple.FLAG_VALUE_2))
structHash.f8.set('20', undefined)
s1.id = 48
structHash.f9.set('10', s1)
s2.id = 65
structHash.f9.set('20', s2)
structHash.f10.set('10', s1)
structHash.f10.set('20', undefined)
console.log(structHash + '\n')
// Print extended hash struct
let structHashEx = new prototest.StructHashEx()
s1.id = 48
structHashEx.f1.set(s1, new prototest.StructNested())
s2.id = 65
structHashEx.f1.set(s2, new prototest.StructNested())
structHashEx.f2.set(s1, new prototest.StructNested())
structHashEx.f2.set(s2, undefined)
console.log(structHashEx + '\n')
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

暂无描述
暂无标签
MIT
使用 MIT 开源许可协议
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/damone/FastBinaryEncoding.git
git@gitee.com:damone/FastBinaryEncoding.git
damone
FastBinaryEncoding
FastBinaryEncoding
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /