├── READMe.md ├── nodeserver ├── README.md ├── package.json ├── server.js └── www │ ├── ByteBufferAB.min.js │ ├── Long.min.js │ ├── ProtoBuf.min.js │ ├── example.proto │ ├── index.html │ ├── qtprotobufreq.proto │ └── qtprotobufres.proto └── qtclient ├── Information.RequestMessage.pb.cc ├── Information.RequestMessage.pb.h ├── Information.ResponseMessage.pb.cc ├── Information.ResponseMessage.pb.h ├── WebSocketAndProto.pro ├── echoclient.cpp ├── echoclient.h ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui /READMe.md: -------------------------------------------------------------------------------- 1 | # (20160617-持续更新)基于nodejs后端框架与Qt前端框架使用protobuf 2 | 3 | ## 前后端框架模块 4 | * [后端nodejs框架](https://nodejs.org/en/) 5 | * [后端protobuf.js框架](https://github.com/dcodeIO/protobuf.js) 6 | * [前端Qt框架](https://download.qt.io/) 7 | * [谷歌protobuf库](https://github.com/google/protobuf) 8 | 9 | 10 | ### 客户端需求及编译配置 11 | * Qt5.3.1或以上 12 | * 谷歌protobuf3.0beta版本 13 | ``` 14 | 1 下载QtSDK进行安装即可 15 | 2 自行编译protobuf的C++库及其运行exe(protoc.exe) 16 | 3 Qt中使用protobuf的库 参考pro文件 17 | ``` 18 | 19 | ### 服务端需要及编译配置 20 | * nodejsv10.x框架 21 | * protobuf.js框架 22 | * websocket框架 23 | ``` 24 | 1 下载Nodejs进行安装即可 25 | 2 更新例子下面的package.json即可安装例子所依赖的第三方的包 26 | 3 npm install 即可安装服务端的依赖的包 27 | 4 node server.js 28 | 5 可以打开本地浏览器测试(暂时关闭测试,因为protobuf数据结构问题) 29 | ``` 30 | 31 | ## 憧憬 32 | 33 | * 实现nodejs后端与Qt前端使用protobuf的数据格式的传输 34 | * 让C++的框架与技术前沿的后端框架进行紧密结合 35 | * 兼容各个主流平台PC客户端的开发 36 | 37 | 38 | 39 | ## 贡献 40 | 41 | * [寒山-居士](https://github.com/toby20130333) 42 | * [toby520](http://www.heilqt.com) 43 | 44 | 45 | ## 注意事项 46 | * 后端需安装nodejs的sdk,并在命令行使用node -v输出版本查看是否安装正常 47 | * Qt版本必须为5.3.1及以上 48 | * 自己编译protobuf的C++库需要注意编译器的版本与Qt的编译器的版本一致 49 | * 熟练使用protobuf的message结构 50 | * pro文件16行注释说明 51 | ``` 52 | system(protoc -I=$$PWD --cpp_out=$$PWD $$PWD/*.proto) 53 | 表示系统环境变量的protoc指令 将项目当前目录下的proto后缀的文件转成cpp文件即可, 54 | 然后将转换后的cpp加入到Qt项目当中即可使用 55 | 如下加入: 56 | 57 | SOURCES += \ 58 | *.pb.cc 59 | 60 | HEADERS += \ 61 | *.pb.h 62 | 63 | ``` 64 | -------------------------------------------------------------------------------- /nodeserver/README.md: -------------------------------------------------------------------------------- 1 | ProtoBuf.js WebSocket example 2 | ============================= 3 | This example shows how to use binary websockets to transfer protocol buffers. 4 | 5 | Instructions 6 | ------------ 7 | 1. Set up dependencies: `npm install` 8 | 2. Run: `node server.js` 9 | 3. Open [http://localhost:8080/](http://localhost:8080/) in a recent browser 10 | -------------------------------------------------------------------------------- /nodeserver/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "protobufjs-websocket-example", 3 | "version": "1.1.0", 4 | "dependencies": { 5 | "protobufjs": "~3", 6 | "ws": "~0.4", 7 | "open": "0.0.3" 8 | }, 9 | "engines": { 10 | "node": ">=0.8" 11 | }, 12 | "scripts": { 13 | "run": "node server.js" 14 | }, 15 | "private": true 16 | } 17 | -------------------------------------------------------------------------------- /nodeserver/server.js: -------------------------------------------------------------------------------- 1 | // Set up: npm install 2 | var http = require("http"), 3 | fs = require("fs"), 4 | path = require("path"), 5 | ws = require("ws"), 6 | open = require("open"), 7 | ProtoBuf = require("protobufjs"); 8 | 9 | // Copy dependencies to "www/" (example specific, you usually don't have to care 10 | var deps = [ 11 | ["Long.min.js", "./node_modules//bytebuffer/node_modules/long/dist/Long.min.js"], 12 | ["ByteBufferAB.min.js", "./node_modules/bytebuffer/dist/ByteBufferAB.min.js"], 13 | ["ProtoBuf.min.js", "./node_modules/protobufjs/dist/ProtoBuf.min.js"] 14 | ]; 15 | for (var i=0, dep, data; i 3 | This version of ByteBuffer.js uses an ArrayBuffer as its backing buffer which is accessed through a DataView and is 4 | compatible with modern browsers. 5 | Released under the Apache License, Version 2.0 6 | see: https://github.com/dcodeIO/ByteBuffer.js for details 7 | */ 8 | (function(s){function u(k){function g(a,b,c){"undefined"===typeof a&&(a=g.DEFAULT_CAPACITY);"undefined"===typeof b&&(b=g.DEFAULT_ENDIAN);"undefined"===typeof c&&(c=g.DEFAULT_NOASSERT);if(!c){a|=0;if(0>a)throw RangeError("Illegal capacity");b=!!b;c=!!c}this.buffer=0===a?s:new ArrayBuffer(a);this.view=0===a?null:new DataView(this.buffer);this.offset=0;this.markedOffset=-1;this.limit=a;this.littleEndian="undefined"!==typeof b?!!b:!1;this.noAssert=!!c}function m(a){var b=0;return function(){return b< 9 | a.length?a.charCodeAt(b++):null}}function t(){var a=[],b=[];return function(){if(0===arguments.length)return b.join("")+u.apply(String,a);1024=e||(d.set((new Uint8Array(c.buffer)).subarray(c.offset,c.limit),b.offset),b.offset+=e);b.limit=b.offset;b.offset=0;return b};g.isByteBuffer=function(a){return!0===(a&&a instanceof 11 | g)};g.type=function(){return ArrayBuffer};g.wrap=function(a,b,c,d){"string"!==typeof b&&(d=c,c=b,b=void 0);if("string"===typeof a)switch("undefined"===typeof b&&(b="utf8"),b){case "base64":return g.fromBase64(a,c);case "hex":return g.fromHex(a,c);case "binary":return g.fromBinary(a,c);case "utf8":return g.fromUTF8(a,c);case "debug":return g.fromDebug(a,c);default:throw Error("Unsupported encoding: "+b);}if(null===a||"object"!==typeof a)throw TypeError("Illegal buffer");if(g.isByteBuffer(a))return b= 12 | e.clone.call(a),b.markedOffset=-1,b;if(a instanceof Uint8Array)b=new g(0,c,d),0>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}b+=1;var d=this.buffer.byteLength;b>d&&this.resize((d*= 14 | 2)>b?d:b);this.view.setInt8(b-1,a);c&&(this.offset+=1);return this};e.writeByte=e.writeInt8;e.readInt8=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+1) <= "+this.buffer.byteLength);}a=this.view.getInt8(a);b&&(this.offset+=1);return a};e.readByte=e.readInt8;e.writeUint8=function(a,b){var c= 15 | "undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal value: "+a+" (not an integer)");a>>>=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: "+b+" (not an integer)");b>>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}b+=1;var d=this.buffer.byteLength;b>d&&this.resize((d*=2)>b?d:b);this.view.setUint8(b-1,a);c&&(this.offset+=1);return this};e.readUint8= 16 | function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+1) <= "+this.buffer.byteLength);}a=this.view.getUint8(a);b&&(this.offset+=1);return a};e.writeInt16=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal value: "+ 17 | a+" (not an integer)");a|=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: "+b+" (not an integer)");b>>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}b+=2;var d=this.buffer.byteLength;b>d&&this.resize((d*=2)>b?d:b);this.view.setInt16(b-2,a,this.littleEndian);c&&(this.offset+=2);return this};e.writeShort=e.writeInt16;e.readInt16=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!== 18 | typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+2) <= "+this.buffer.byteLength);}a=this.view.getInt16(a,this.littleEndian);b&&(this.offset+=2);return a};e.readShort=e.readInt16;e.writeUint16=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal value: "+a+" (not an integer)");a>>>=0;if("number"!==typeof b|| 19 | 0!==b%1)throw TypeError("Illegal offset: "+b+" (not an integer)");b>>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}b+=2;var d=this.buffer.byteLength;b>d&&this.resize((d*=2)>b?d:b);this.view.setUint16(b-2,a,this.littleEndian);c&&(this.offset+=2);return this};e.readUint16=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)"); 20 | a>>>=0;if(0>a||a+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+2) <= "+this.buffer.byteLength);}a=this.view.getUint16(a,this.littleEndian);b&&(this.offset+=2);return a};e.writeInt32=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal value: "+a+" (not an integer)");a|=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: "+b+" (not an integer)");b>>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+ 21 | b+" (+0) <= "+this.buffer.byteLength);}b+=4;var d=this.buffer.byteLength;b>d&&this.resize((d*=2)>b?d:b);this.view.setInt32(b-4,a,this.littleEndian);c&&(this.offset+=4);return this};e.writeInt=e.writeInt32;e.readInt32=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+4) <= "+this.buffer.byteLength); 22 | }a=this.view.getInt32(a,this.littleEndian);b&&(this.offset+=4);return a};e.readInt=e.readInt32;e.writeUint32=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal value: "+a+" (not an integer)");a>>>=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: "+b+" (not an integer)");b>>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}b+= 23 | 4;var d=this.buffer.byteLength;b>d&&this.resize((d*=2)>b?d:b);this.view.setUint32(b-4,a,this.littleEndian);c&&(this.offset+=4);return this};e.readUint32=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+4) <= "+this.buffer.byteLength);}a=this.view.getUint32(a,this.littleEndian);b&&(this.offset+= 24 | 4);return a};k&&(e.writeInt64=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("number"===typeof a)a=k.fromNumber(a);else if("string"===typeof a)a=k.fromString(a);else if(!(a&&a instanceof k))throw TypeError("Illegal value: "+a+" (not an integer or Long)");if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: "+b+" (not an integer)");b>>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength); 25 | }"number"===typeof a?a=k.fromNumber(a):"string"===typeof a&&(a=k.fromString(a));b+=8;var d=this.buffer.byteLength;b>d&&this.resize((d*=2)>b?d:b);b-=8;this.littleEndian?(this.view.setInt32(b,a.low,!0),this.view.setInt32(b+4,a.high,!0)):(this.view.setInt32(b,a.high,!1),this.view.setInt32(b+4,a.low,!1));c&&(this.offset+=8);return this},e.writeLong=e.writeInt64,e.readInt64=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+ 26 | a+" (not an integer)");a>>>=0;if(0>a||a+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+8) <= "+this.buffer.byteLength);}a=this.littleEndian?new k(this.view.getInt32(a,!0),this.view.getInt32(a+4,!0),!1):new k(this.view.getInt32(a+4,!1),this.view.getInt32(a,!1),!1);b&&(this.offset+=8);return a},e.readLong=e.readInt64,e.writeUint64=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("number"===typeof a)a=k.fromNumber(a);else if("string"===typeof a)a= 27 | k.fromString(a);else if(!(a&&a instanceof k))throw TypeError("Illegal value: "+a+" (not an integer or Long)");if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: "+b+" (not an integer)");b>>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}"number"===typeof a?a=k.fromNumber(a):"string"===typeof a&&(a=k.fromString(a));b+=8;var d=this.buffer.byteLength;b>d&&this.resize((d*=2)>b?d:b);b-=8;this.littleEndian?(this.view.setInt32(b, 28 | a.low,!0),this.view.setInt32(b+4,a.high,!0)):(this.view.setInt32(b,a.high,!1),this.view.setInt32(b+4,a.low,!1));c&&(this.offset+=8);return this},e.readUint64=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+8) <= "+this.buffer.byteLength);}a=this.littleEndian?new k(this.view.getInt32(a,!0),this.view.getInt32(a+ 29 | 4,!0),!0):new k(this.view.getInt32(a+4,!1),this.view.getInt32(a,!1),!0);b&&(this.offset+=8);return a});e.writeFloat32=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("number"!==typeof a)throw TypeError("Illegal value: "+a+" (not a number)");if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: "+b+" (not an integer)");b>>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}b+=4;var d=this.buffer.byteLength; 30 | b>d&&this.resize((d*=2)>b?d:b);this.view.setFloat32(b-4,a,this.littleEndian);c&&(this.offset+=4);return this};e.writeFloat=e.writeFloat32;e.readFloat32=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+4) <= "+this.buffer.byteLength);}a=this.view.getFloat32(a,this.littleEndian);b&&(this.offset+= 31 | 4);return a};e.readFloat=e.readFloat32;e.writeFloat64=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("number"!==typeof a)throw TypeError("Illegal value: "+a+" (not a number)");if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: "+b+" (not an integer)");b>>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}b+=8;var d=this.buffer.byteLength;b>d&&this.resize((d*=2)>b?d:b);this.view.setFloat64(b- 32 | 8,a,this.littleEndian);c&&(this.offset+=8);return this};e.writeDouble=e.writeFloat64;e.readFloat64=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+8) <= "+this.buffer.byteLength);}a=this.view.getFloat64(a,this.littleEndian);b&&(this.offset+=8);return a};e.readDouble=e.readFloat64;g.MAX_VARINT32_BYTES= 33 | 5;g.calculateVarint32=function(a){a>>>=0;return 128>a?1:16384>a?2:2097152>a?3:268435456>a?4:5};g.zigZagEncode32=function(a){return((a|=0)<<1^a>>31)>>>0};g.zigZagDecode32=function(a){return a>>>1^-(a&1)|0};e.writeVarint32=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal value: "+a+" (not an integer)");a|=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: "+b+" (not an integer)");b>>>=0;if(0>b|| 34 | b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}var d=g.calculateVarint32(a);b+=d;var f=this.buffer.byteLength;b>f&&this.resize((f*=2)>b?f:b);b-=d;this.view.setUint8(b,d=a|128);a>>>=0;128<=a?(d=a>>7|128,this.view.setUint8(b+1,d),16384<=a?(d=a>>14|128,this.view.setUint8(b+2,d),2097152<=a?(d=a>>21|128,this.view.setUint8(b+3,d),268435456<=a?(this.view.setUint8(b+4,a>>28&15),d=5):(this.view.setUint8(b+3,d&127),d=4)):(this.view.setUint8(b+2,d& 35 | 127),d=3)):(this.view.setUint8(b+1,d&127),d=2)):(this.view.setUint8(b,d&127),d=1);return c?(this.offset+=d,this):d};e.writeVarint32ZigZag=function(a,b){return this.writeVarint32(g.zigZagEncode32(a),b)};e.readVarint32=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+1) <= "+this.buffer.byteLength); 36 | }var c=0,d=0,f;do{f=a+c;if(!this.noAssert&&f>this.limit)throw a=Error("Truncated"),a.truncated=!0,a;f=this.view.getUint8(f);5>c&&(d|=(f&127)<<7*c>>>0);++c}while(128===(f&128));d|=0;return b?(this.offset+=c,d):{value:d,length:c}};e.readVarint32ZigZag=function(a){a=this.readVarint32(a);"object"===typeof a?a.value=g.zigZagDecode32(a.value):a=g.zigZagDecode32(a);return a};k&&(g.MAX_VARINT64_BYTES=10,g.calculateVarint64=function(a){"number"===typeof a?a=k.fromNumber(a):"string"===typeof a&&(a=k.fromString(a)); 37 | var b=a.toInt()>>>0,c=a.shiftRightUnsigned(28).toInt()>>>0;a=a.shiftRightUnsigned(56).toInt()>>>0;return 0==a?0==c?16384>b?128>b?1:2:2097152>b?3:4:16384>c?128>c?5:6:2097152>c?7:8:128>a?9:10},g.zigZagEncode64=function(a){"number"===typeof a?a=k.fromNumber(a,!1):"string"===typeof a?a=k.fromString(a,!1):!1!==a.unsigned&&(a=a.toSigned());return a.shiftLeft(1).xor(a.shiftRight(63)).toUnsigned()},g.zigZagDecode64=function(a){"number"===typeof a?a=k.fromNumber(a,!1):"string"===typeof a?a=k.fromString(a, 38 | !1):!1!==a.unsigned&&(a=a.toSigned());return a.shiftRightUnsigned(1).xor(a.and(k.ONE).toSigned().negate()).toSigned()},e.writeVarint64=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("number"===typeof a)a=k.fromNumber(a);else if("string"===typeof a)a=k.fromString(a);else if(!(a&&a instanceof k))throw TypeError("Illegal value: "+a+" (not an integer or Long)");if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: "+b+" (not an integer)");b>>>=0;if(0>b|| 39 | b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}"number"===typeof a?a=k.fromNumber(a,!1):"string"===typeof a?a=k.fromString(a,!1):!1!==a.unsigned&&(a=a.toSigned());var d=g.calculateVarint64(a),f=a.toInt()>>>0,e=a.shiftRightUnsigned(28).toInt()>>>0,h=a.shiftRightUnsigned(56).toInt()>>>0;b+=d;var r=this.buffer.byteLength;b>r&&this.resize((r*=2)>b?r:b);b-=d;switch(d){case 10:this.view.setUint8(b+9,h>>>7&1);case 9:this.view.setUint8(b+8,9!==d? 40 | h|128:h&127);case 8:this.view.setUint8(b+7,8!==d?e>>>21|128:e>>>21&127);case 7:this.view.setUint8(b+6,7!==d?e>>>14|128:e>>>14&127);case 6:this.view.setUint8(b+5,6!==d?e>>>7|128:e>>>7&127);case 5:this.view.setUint8(b+4,5!==d?e|128:e&127);case 4:this.view.setUint8(b+3,4!==d?f>>>21|128:f>>>21&127);case 3:this.view.setUint8(b+2,3!==d?f>>>14|128:f>>>14&127);case 2:this.view.setUint8(b+1,2!==d?f>>>7|128:f>>>7&127);case 1:this.view.setUint8(b,1!==d?f|128:f&127)}return c?(this.offset+=d,this):d},e.writeVarint64ZigZag= 41 | function(a,b){return this.writeVarint64(g.zigZagEncode64(a),b)},e.readVarint64=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+1) <= "+this.buffer.byteLength);}var c=a,d=0,f=0,e=0,h=0,h=this.view.getUint8(a++),d=h&127;if(h&128&&(h=this.view.getUint8(a++),d|=(h&127)<<7,h&128&&(h=this.view.getUint8(a++), 42 | d|=(h&127)<<14,h&128&&(h=this.view.getUint8(a++),d|=(h&127)<<21,h&128&&(h=this.view.getUint8(a++),f=h&127,h&128&&(h=this.view.getUint8(a++),f|=(h&127)<<7,h&128&&(h=this.view.getUint8(a++),f|=(h&127)<<14,h&128&&(h=this.view.getUint8(a++),f|=(h&127)<<21,h&128&&(h=this.view.getUint8(a++),e=h&127,h&128&&(h=this.view.getUint8(a++),e|=(h&127)<<7,h&128))))))))))throw Error("Buffer overrun");d=k.fromBits(d|f<<28,f>>>4|e<<24,!1);return b?(this.offset=a,d):{value:d,length:a-c}},e.readVarint64ZigZag=function(a){(a= 43 | this.readVarint64(a))&&a.value instanceof k?a.value=g.zigZagDecode64(a.value):a=g.zigZagDecode64(a);return a});e.writeCString=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);var d,f=a.length;if(!this.noAssert){if("string"!==typeof a)throw TypeError("Illegal str: Not a string");for(d=0;d>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+ 44 | b+" (+0) <= "+this.buffer.byteLength);}f=l.a(m(a))[1];b+=f+1;d=this.buffer.byteLength;b>d&&this.resize((d*=2)>b?d:b);b-=f+1;l.c(m(a),function(a){this.view.setUint8(b++,a)}.bind(this));this.view.setUint8(b++,0);return c?(this.offset=b,this):f};e.readCString=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+ 45 | a+" (+1) <= "+this.buffer.byteLength);}var c=a,d,f=-1;l.b(function(){if(0===f)return null;if(a>=this.limit)throw RangeError("Illegal range: Truncated data, "+a+" < "+this.limit);return 0===(f=this.view.getUint8(a++))?null:f}.bind(this),d=t(),!0);return b?(this.offset=a,d()):{string:d(),length:a-c}};e.writeIString=function(a,b){var c="undefined"===typeof b;c&&(b=this.offset);if(!this.noAssert){if("string"!==typeof a)throw TypeError("Illegal str: Not a string");if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: "+ 46 | b+" (not an integer)");b>>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}var d=b,f;f=l.a(m(a),this.noAssert)[1];b+=4+f;var e=this.buffer.byteLength;b>e&&this.resize((e*=2)>b?e:b);b-=4+f;this.view.setUint32(b,f,this.littleEndian);b+=4;l.c(m(a),function(a){this.view.setUint8(b++,a)}.bind(this));if(b!==d+4+f)throw RangeError("Illegal range: Truncated data, "+b+" == "+(b+4+f));return c?(this.offset=b,this):b-d};e.readIString=function(a){var b= 47 | "undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+4) <= "+this.buffer.byteLength);}var c=0,d=a,c=this.view.getUint32(a,this.littleEndian);a+=4;var f=a+c;l.b(function(){return a>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}var d,f=b;d=l.a(m(a))[1];b+=d;var e=this.buffer.byteLength;b>e&&this.resize((e*=2)>b?e:b);b-=d;l.c(m(a),function(a){this.view.setUint8(b++,a)}.bind(this));return c?(this.offset= 49 | b,this):b-f};e.writeString=e.writeUTF8String;g.calculateUTF8Chars=function(a){return l.a(m(a))[0]};g.calculateUTF8Bytes=function(a){return l.a(m(a))[1]};e.readUTF8String=function(a,b,c){"number"===typeof b&&(c=b,b=void 0);var d="undefined"===typeof c;d&&(c=this.offset);"undefined"===typeof b&&(b=g.METRICS_CHARS);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal length: "+a+" (not an integer)");a|=0;if("number"!==typeof c||0!==c%1)throw TypeError("Illegal offset: "+c+" (not an integer)"); 50 | c>>>=0;if(0>c||c+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+0) <= "+this.buffer.byteLength);}var f=0,e=c,h;if(b===g.METRICS_CHARS){h=t();l.g(function(){return f>>=0;if(0>c||c+a>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+"+a+") <= "+this.buffer.byteLength);}var r=c+a;l.b(function(){return c>>=0;if(0>b||b+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+b+" (+0) <= "+this.buffer.byteLength);}var d=b,f,e;f=l.a(m(a),this.noAssert)[1];e=g.calculateVarint32(f);b+=e+f;var h=this.buffer.byteLength;b>h&&this.resize((h*=2)>b?h:b);b-=e+f;b+=this.writeVarint32(f,b);l.c(m(a),function(a){this.view.setUint8(b++, 53 | a)}.bind(this));if(b!==d+f+e)throw RangeError("Illegal range: Truncated data, "+b+" == "+(b+f+e));return c?(this.offset=b,this):b-d};e.readVString=function(a){var b="undefined"===typeof a;b&&(a=this.offset);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal offset: "+a+" (not an integer)");a>>>=0;if(0>a||a+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+1) <= "+this.buffer.byteLength);}var c=this.readVarint32(a),d=a;a+=c.length;var c=c.value,f=a+c, 54 | c=t();l.b(function(){return a>>=0;if(0>c||c+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+0) <= "+this.buffer.byteLength); 55 | }a instanceof g||(a=g.wrap(a,b));b=a.limit-a.offset;if(0>=b)return this;c+=b;var f=this.buffer.byteLength;c>f&&this.resize((f*=2)>c?f:c);(new Uint8Array(this.buffer,c-b)).set((new Uint8Array(a.buffer)).subarray(a.offset,a.limit));a.offset+=b;d&&(this.offset+=b);return this};e.appendTo=function(a,b){a.append(this,b);return this};e.assert=function(a){this.noAssert=!a;return this};e.capacity=function(){return this.buffer.byteLength};e.clear=function(){this.offset=0;this.limit=this.buffer.byteLength; 56 | this.markedOffset=-1;return this};e.clone=function(a){var b=new g(0,this.littleEndian,this.noAssert);a?(a=new ArrayBuffer(this.buffer.byteLength),(new Uint8Array(a)).set(this.buffer),b.buffer=a,b.view=new DataView(a)):(b.buffer=this.buffer,b.view=this.view);b.offset=this.offset;b.markedOffset=this.markedOffset;b.limit=this.limit;return b};e.compact=function(a,b){"undefined"===typeof a&&(a=this.offset);"undefined"===typeof b&&(b=this.limit);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal begin: Not an integer"); 57 | a>>>=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal end: Not an integer");b>>>=0;if(0>a||a>b||b>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+a+" <= "+b+" <= "+this.buffer.byteLength);}if(0===a&&b===this.buffer.byteLength)return this;var c=b-a;if(0===c)return this.buffer=s,this.view=null,0<=this.markedOffset&&(this.markedOffset-=a),this.limit=this.offset=0,this;var d=new ArrayBuffer(c);(new Uint8Array(d)).set((new Uint8Array(this.buffer)).subarray(a,b));this.buffer=d; 58 | this.view=new DataView(d);0<=this.markedOffset&&(this.markedOffset-=a);this.offset=0;this.limit=c;return this};e.copy=function(a,b){"undefined"===typeof a&&(a=this.offset);"undefined"===typeof b&&(b=this.limit);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal begin: Not an integer");a>>>=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal end: Not an integer");b>>>=0;if(0>a||a>b||b>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+a+" <= "+b+" <= "+this.buffer.byteLength); 59 | }if(a===b)return new g(0,this.littleEndian,this.noAssert);var c=b-a,d=new g(c,this.littleEndian,this.noAssert);d.offset=0;d.limit=c;0<=d.markedOffset&&(d.markedOffset-=a);this.copyTo(d,0,a,b);return d};e.copyTo=function(a,b,c,d){var f,e;if(!this.noAssert&&!g.isByteBuffer(a))throw TypeError("Illegal target: Not a ByteBuffer");b=(e="undefined"===typeof b)?a.offset:b|0;c=(f="undefined"===typeof c)?this.offset:c|0;d="undefined"===typeof d?this.limit:d|0;if(0>b||b>a.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+ 60 | b+" <= "+a.buffer.byteLength);if(0>c||d>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+c+" <= "+this.buffer.byteLength);var h=d-c;if(0===h)return a;a.ensureCapacity(b+h);(new Uint8Array(a.buffer)).set((new Uint8Array(this.buffer)).subarray(c,d),b);f&&(this.offset+=h);e&&(a.offset+=h);return this};e.ensureCapacity=function(a){var b=this.buffer.byteLength;return ba?b:a):this};e.fill=function(a,b,c){var d="undefined"===typeof b;d&&(b=this.offset);"string"=== 61 | typeof a&&0>>=0;if("number"!==typeof c||0!==c%1)throw TypeError("Illegal end: Not an integer");c>>>=0;if(0>b||b>c||c>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+b+" <= "+c+" <= "+ 62 | this.buffer.byteLength);}if(b>=c)return this;for(;b>>=0;if(0>a||a+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+a+" (+0) <= "+this.buffer.byteLength);}this.markedOffset=a;return this}; 63 | e.order=function(a){if(!this.noAssert&&"boolean"!==typeof a)throw TypeError("Illegal littleEndian: Not a boolean");this.littleEndian=!!a;return this};e.LE=function(a){this.littleEndian="undefined"!==typeof a?!!a:!0;return this};e.BE=function(a){this.littleEndian="undefined"!==typeof a?!a:!1;return this};e.prepend=function(a,b,c){if("number"===typeof b||"string"!==typeof b)c=b,b=void 0;var d="undefined"===typeof c;d&&(c=this.offset);if(!this.noAssert){if("number"!==typeof c||0!==c%1)throw TypeError("Illegal offset: "+ 64 | c+" (not an integer)");c>>>=0;if(0>c||c+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+0) <= "+this.buffer.byteLength);}a instanceof g||(a=g.wrap(a,b));b=a.limit-a.offset;if(0>=b)return this;var f=b-c,e;if(0a)throw RangeError("Illegal capacity: 0 <= "+a);}this.buffer.byteLength>>=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal end: Not an integer");b>>>=0;if(0>a||a>b||b>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+a+" <= "+b+" <= "+this.buffer.byteLength);}if(a===b)return this;Array.prototype.reverse.call((new Uint8Array(this.buffer)).subarray(a,b));this.view=new DataView(this.buffer);return this};e.skip=function(a){if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal length: "+ 68 | a+" (not an integer)");a|=0}var b=this.offset+a;if(!this.noAssert&&(0>b||b>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+a+" <= "+this.buffer.byteLength);this.offset=b;return this};e.slice=function(a,b){"undefined"===typeof a&&(a=this.offset);"undefined"===typeof b&&(b=this.limit);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal begin: Not an integer");a>>>=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal end: Not an integer"); 69 | b>>>=0;if(0>a||a>b||b>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+a+" <= "+b+" <= "+this.buffer.byteLength);}var c=this.clone();c.offset=a;c.limit=b;return c};e.toBuffer=function(a){var b=this.offset,c=this.limit;if(b>c)var d=b,b=c,c=d;if(!this.noAssert){if("number"!==typeof b||0!==b%1)throw TypeError("Illegal offset: Not an integer");b>>>=0;if("number"!==typeof c||0!==c%1)throw TypeError("Illegal limit: Not an integer");c>>>=0;if(0>b||b>c||c>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+ 70 | b+" <= "+c+" <= "+this.buffer.byteLength);}if(!a&&0===b&&c===this.buffer.byteLength)return this.buffer;if(b===c)return s;a=new ArrayBuffer(c-b);(new Uint8Array(a)).set((new Uint8Array(this.buffer)).subarray(b,c),0);return a};e.toArrayBuffer=e.toBuffer;e.toString=function(a,b,c){if("undefined"===typeof a)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";"number"===typeof a&&(c=b=a="utf8");switch(a){case "utf8":return this.toUTF8(b, 71 | c);case "base64":return this.toBase64(b,c);case "hex":return this.toHex(b,c);case "binary":return this.toBinary(b,c);case "debug":return this.toDebug();case "columns":return this.m();default:throw Error("Unsupported encoding: "+a);}};var v=function(){for(var a={},b=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],c=[],d=0,f=b.length;d< 72 | f;++d)c[b[d]]=d;a.i=function(a,c){for(var d,f;null!==(d=a());)c(b[d>>2&63]),f=(d&3)<<4,null!==(d=a())?(f|=d>>4&15,c(b[(f|d>>4&15)&63]),f=(d&15)<<2,null!==(d=a())?(c(b[(f|d>>6&3)&63]),c(b[d&63])):(c(b[f&63]),c(61))):(c(b[f&63]),c(61),c(61))};a.h=function(a,b){function d(a){throw Error("Illegal character code: "+a);}for(var f,e,g;null!==(f=a());)if(e=c[f],"undefined"===typeof e&&d(f),null!==(f=a())&&(g=c[f],"undefined"===typeof g&&d(f),b(e<<2>>>0|(g&48)>>4),null!==(f=a()))){e=c[f];if("undefined"=== 73 | typeof e)if(61===f)break;else d(f);b((g&15)<<4>>>0|(e&60)>>2);if(null!==(f=a())){g=c[f];if("undefined"===typeof g)if(61===f)break;else d(f);b((e&3)<<6>>>0|g)}}};a.test=function(a){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(a)};return a}();e.toBase64=function(a,b){"undefined"===typeof a&&(a=this.offset);"undefined"===typeof b&&(b=this.limit);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal begin: Not an integer");a>>>=0;if("number"!==typeof b|| 74 | 0!==b%1)throw TypeError("Illegal end: Not an integer");b>>>=0;if(0>a||a>b||b>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+a+" <= "+b+" <= "+this.buffer.byteLength);}var c;v.i(function(){return a>>=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal end: Not an integer");b>>>=0;if(0>a||a>b||b>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+ 76 | a+" <= "+b+" <= "+this.buffer.byteLength);}if(a===b)return"";for(var c=[],d=[];ad?f+("0"+d.toString(16).toUpperCase()):f+d.toString(16).toUpperCase(),a&&(e+=32d?String.fromCharCode(d):"."));++b;if(a&&0f.length;)f+=" ";g+=f+e+"\n";f=e=""}f=b===this.offset&&b===this.limit?f+(b===this.markedOffset?"!":"|"):b===this.offset?f+(b===this.markedOffset?"[":"<"):b===this.limit?f+(b===this.markedOffset?"]":">"):f+(b=== 78 | this.markedOffset?"'":a||0!==b&&b!==c?" ":"")}if(a&&" "!==f){for(;51>f.length;)f+=" ";g+=f+e+"\n"}return a?g:f};g.fromDebug=function(a,b,c){var d=a.length;b=new g((d+1)/3|0,b,c);for(var f=0,e=0,h,k=!1,l=!1,m=!1,q=!1,p=!1;f":if(!c){if(q){p=!0;break}q=!0}b.limit=e;k=!1;break;case "'":if(!c){if(m){p=!0;break}m=!0}b.markedOffset=e;k=!1;break;case " ":k=!1;break;default:if(!c&&k){p=!0;break}h=parseInt(h+a.charAt(f++),16);if(!c&&(isNaN(h)||0>h||255>>=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal end: Not an integer");b>>>=0;if(0>a||a>b||b>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+ 81 | a+" <= "+b+" <= "+this.buffer.byteLength);}for(var c=Array(b-a),d;ad?c.push("0",d.toString(16)):c.push(d.toString(16));return c.join("")};g.fromHex=function(a,b,c){if(!c){if("string"!==typeof a)throw TypeError("Illegal str: Not a string");if(0!==a.length%2)throw TypeError("Illegal str: Length not a multiple of 2");}var d=a.length;b=new g(d/2|0,b);for(var f,e=0,h=0;ef||255d?c(d&127):(2048>d?c(d>>6&31|192):(65536>d?c(d>>12&15|224):(c(d>>18&7|240),c(d>>12&63|128)),c(d>>6&63|128)),c(d&63|128)),d=null},g:function(a,c){function d(a){a=a.slice(0,a.indexOf(null));var b=Error(a.toString());b.name="TruncatedError";b.bytes=a;throw b;}for(var e,g,h,k;null!==(e=a());)if(0===(e&128))c(e); 83 | else if(192===(e&224))null===(g=a())&&d([e,g]),c((e&31)<<6|g&63);else if(224===(e&240))null!==(g=a())&&null!==(h=a())||d([e,g,h]),c((e&15)<<12|(g&63)<<6|h&63);else if(240===(e&248))null!==(g=a())&&null!==(h=a())&&null!==(k=a())||d([e,g,h,k]),c((e&7)<<18|(g&63)<<12|(h&63)<<6|k&63);else throw RangeError("Illegal starting byte: "+e);},d:function(a,c){for(var d,e=null;null!==(d=null!==e?e:a());)55296<=d&&57343>=d&&null!==(e=a())&&56320<=e&&57343>=e?(c(1024*(d-55296)+e-56320+65536),e=null):c(d);null!== 84 | e&&c(e)},e:function(a,c){var d=null;"number"===typeof a&&(d=a,a=function(){return null});for(;null!==d||null!==(d=a());)65535>=d?c(d):(d-=65536,c((d>>10)+55296),c(d%1024+56320)),d=null},c:function(b,c){a.d(b,function(b){a.j(b,c)})},b:function(b,c){a.g(b,function(b){a.e(b,c)})},f:function(a){return 128>a?1:2048>a?2:65536>a?3:4},l:function(b){for(var c,d=0;null!==(c=b());)d+=a.f(c);return d},a:function(b){var c=0,d=0;a.d(b,function(b){++c;d+=a.f(b)});return[c,d]}};return a}();e.toUTF8=function(a,b){"undefined"=== 85 | typeof a&&(a=this.offset);"undefined"===typeof b&&(b=this.limit);if(!this.noAssert){if("number"!==typeof a||0!==a%1)throw TypeError("Illegal begin: Not an integer");a>>>=0;if("number"!==typeof b||0!==b%1)throw TypeError("Illegal end: Not an integer");b>>>=0;if(0>a||a>b||b>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+a+" <= "+b+" <= "+this.buffer.byteLength);}var c;try{l.b(function(){return a 3 | Released under the Apache License, Version 2.0 4 | see: https://github.com/dcodeIO/Long.js for details 5 | */ 6 | function p(){function b(a,b,d){this.low=a|0;this.high=b|0;this.unsigned=!!d}Object.defineProperty(b.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});b.isLong=function(a){return!0===(a&&a.__isLong__)};var r={},s={};b.fromInt=function(a,c){var d;if(c){a>>>=0;if(0<=a&&256>a&&(d=s[a]))return d;d=new b(a,0>(a|0)?-1:0,!0);0<=a&&256>a&&(s[a]=d)}else{a|=0;if(-128<=a&&128>a&&(d=r[a]))return d;d=new b(a,0>a?-1:0,!1);-128<=a&&128>a&&(r[a]=d)}return d};b.fromNumber=function(a,c){c=!!c;return isNaN(a)|| 7 | !isFinite(a)?b.ZERO:!c&&a<=-t?b.MIN_VALUE:!c&&a+1>=t?b.MAX_VALUE:c&&a>=u?b.MAX_UNSIGNED_VALUE:0>a?b.fromNumber(-a,c).negate():new b(a%4294967296|0,a/4294967296|0,c)};b.fromBits=function(a,c,d){return new b(a,c,d)};b.fromString=function(a,c,d){if(0===a.length)throw Error("number format error: empty string");if("NaN"===a||"Infinity"===a||"+Infinity"===a||"-Infinity"===a)return b.ZERO;"number"===typeof c&&(d=c,c=!1);d=d||10;if(2>d||36k?(k=b.fromNumber(Math.pow(d,k)),f=f.multiply(k).add(b.fromNumber(l))):(f=f.multiply(e),f=f.add(b.fromNumber(l)))}f.unsigned=c;return f};b.fromValue=function(a){return a instanceof b?a:"number"===typeof a?b.fromNumber(a):"string"===typeof a?b.fromString(a):new b(a.low,a.high,a.unsigned)};var u=4294967296*4294967296, 9 | t=u/2,v=b.fromInt(16777216);b.ZERO=b.fromInt(0);b.UZERO=b.fromInt(0,!0);b.ONE=b.fromInt(1);b.UONE=b.fromInt(1,!0);b.NEG_ONE=b.fromInt(-1);b.MAX_VALUE=b.fromBits(-1,2147483647,!1);b.MAX_UNSIGNED_VALUE=b.fromBits(-1,-1,!0);b.MIN_VALUE=b.fromBits(0,-2147483648,!1);b.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low};b.prototype.toNumber=function(){return this.unsigned?4294967296*(this.high>>>0)+(this.low>>>0):4294967296*this.high+(this.low>>>0)};b.prototype.toString=function(a){a= 10 | a||10;if(2>a||36>>0).toString(a);c=f;if(c.isZero())return g+e;for(;6>g.length;)g="0"+g;e=""+g+e}};b.prototype.getHighBits= 11 | function(){return this.high};b.prototype.getHighBitsUnsigned=function(){return this.high>>>0};b.prototype.getLowBits=function(){return this.low};b.prototype.getLowBitsUnsigned=function(){return this.low>>>0};b.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(b.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var a=0!=this.high?this.high:this.low,c=31;0this.high};b.prototype.isPositive=function(){return this.unsigned||0<=this.high};b.prototype.isOdd=function(){return 1===(this.low&1)};b.prototype.isEven=function(){return 0===(this.low&1)};b.prototype.equals=function(a){b.isLong(a)||(a=b.fromValue(a));return this.unsigned!==a.unsigned&&1===this.high>>>31&&1===a.high>>>31?!1:this.high===a.high&&this.low===a.low};b.eq=b.prototype.equals;b.prototype.notEquals=function(a){return!this.equals(a)};b.neq=b.prototype.notEquals; 13 | b.prototype.lessThan=function(a){return 0>this.compare(a)};b.prototype.lt=b.prototype.lessThan;b.prototype.lessThanOrEqual=function(a){return 0>=this.compare(a)};b.prototype.lte=b.prototype.lessThanOrEqual;b.prototype.greaterThan=function(a){return 0>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.subtract(a).isNegative()?-1:1};b.prototype.negate=function(){return!this.unsigned&&this.equals(b.MIN_VALUE)?b.MIN_VALUE:this.not().add(b.ONE)};b.prototype.neg=b.prototype.negate;b.prototype.add=function(a){b.isLong(a)||(a=b.fromValue(a));var c=this.high>>>16,d=this.high&65535,e=this.low>>>16,f=a.high>>>16,g=a.high&65535,k=a.low>>>16,l;l=0+((this.low& 15 | 65535)+(a.low&65535));a=0+(l>>>16);a+=e+k;e=0+(a>>>16);e+=d+g;d=0+(e>>>16);d=d+(c+f)&65535;return b.fromBits((a&65535)<<16|l&65535,d<<16|e&65535,this.unsigned)};b.prototype.subtract=function(a){b.isLong(a)||(a=b.fromValue(a));return this.add(a.negate())};b.prototype.sub=b.prototype.subtract;b.prototype.multiply=function(a){if(this.isZero())return b.ZERO;b.isLong(a)||(a=b.fromValue(a));if(a.isZero())return b.ZERO;if(this.equals(b.MIN_VALUE))return a.isOdd()?b.MIN_VALUE:b.ZERO;if(a.equals(b.MIN_VALUE))return this.isOdd()? 16 | b.MIN_VALUE:b.ZERO;if(this.isNegative())return a.isNegative()?this.negate().multiply(a.negate()):this.negate().multiply(a).negate();if(a.isNegative())return this.multiply(a.negate()).negate();if(this.lessThan(v)&&a.lessThan(v))return b.fromNumber(this.toNumber()*a.toNumber(),this.unsigned);var c=this.high>>>16,d=this.high&65535,e=this.low>>>16,f=this.low&65535,g=a.high>>>16,k=a.high&65535,l=a.low>>>16;a=a.low&65535;var n,h,m,q;q=0+f*a;m=0+(q>>>16);m+=e*a;h=0+(m>>>16);m=(m&65535)+f*l;h+=m>>>16;m&= 17 | 65535;h+=d*a;n=0+(h>>>16);h=(h&65535)+e*l;n+=h>>>16;h&=65535;h+=f*k;n+=h>>>16;h&=65535;n=n+(c*a+d*l+e*k+f*g)&65535;return b.fromBits(m<<16|q&65535,n<<16|h,this.unsigned)};b.prototype.mul=b.prototype.multiply;b.prototype.divide=function(a){b.isLong(a)||(a=b.fromValue(a));if(a.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?b.UZERO:b.ZERO;var c,d,e;if(this.equals(b.MIN_VALUE)){if(a.equals(b.ONE)||a.equals(b.NEG_ONE))return b.MIN_VALUE;if(a.equals(b.MIN_VALUE))return b.ONE; 18 | c=this.shiftRight(1).divide(a).shiftLeft(1);if(c.equals(b.ZERO))return a.isNegative()?b.ONE:b.NEG_ONE;d=this.subtract(a.multiply(c));return e=c.add(d.divide(a))}if(a.equals(b.MIN_VALUE))return this.unsigned?b.UZERO:b.ZERO;if(this.isNegative())return a.isNegative()?this.negate().divide(a.negate()):this.negate().divide(a).negate();if(a.isNegative())return this.divide(a.negate()).negate();e=b.ZERO;for(d=this;d.greaterThanOrEqual(a);){c=Math.max(1,Math.floor(d.toNumber()/a.toNumber()));for(var f=Math.ceil(Math.log(c)/ 19 | Math.LN2),f=48>=f?1:Math.pow(2,f-48),g=b.fromNumber(c),k=g.multiply(a);k.isNegative()||k.greaterThan(d);)c-=f,g=b.fromNumber(c,this.unsigned),k=g.multiply(a);g.isZero()&&(g=b.ONE);e=e.add(g);d=d.subtract(k)}return e};b.prototype.div=b.prototype.divide;b.prototype.modulo=function(a){b.isLong(a)||(a=b.fromValue(a));return this.subtract(this.divide(a).multiply(a))};b.prototype.mod=b.prototype.modulo;b.prototype.not=function(){return b.fromBits(~this.low,~this.high,this.unsigned)};b.prototype.and=function(a){b.isLong(a)|| 20 | (a=b.fromValue(a));return b.fromBits(this.low&a.low,this.high&a.high,this.unsigned)};b.prototype.or=function(a){b.isLong(a)||(a=b.fromValue(a));return b.fromBits(this.low|a.low,this.high|a.high,this.unsigned)};b.prototype.xor=function(a){b.isLong(a)||(a=b.fromValue(a));return b.fromBits(this.low^a.low,this.high^a.high,this.unsigned)};b.prototype.shiftLeft=function(a){b.isLong(a)&&(a=a.toInt());return 0===(a&=63)?this:32>a?b.fromBits(this.low<>>32-a,this.unsigned):b.fromBits(0, 21 | this.low<a?b.fromBits(this.low>>>a|this.high<<32-a,this.high>>a,this.unsigned):b.fromBits(this.high>>a-32,0<=this.high?0:-1,this.unsigned)};b.prototype.shr=b.prototype.shiftRight;b.prototype.shiftRightUnsigned=function(a){b.isLong(a)&&(a=a.toInt());a&=63;if(0===a)return this;var c=this.high;return 32>a?b.fromBits(this.low>>>a|c<<32-a,c>>>a,this.unsigned): 22 | 32===a?b.fromBits(c,0,this.unsigned):b.fromBits(c>>>a-32,0,this.unsigned)};b.prototype.shru=b.prototype.shiftRightUnsigned;b.prototype.toSigned=function(){return this.unsigned?new b(this.low,this.high,!1):this};b.prototype.toUnsigned=function(){return this.unsigned?this:new b(this.low,this.high,!0)};return b}"function"===typeof define&&define.amd?define([],p):"function"===typeof require&&"object"===typeof module&&module&&module.exports?module.exports=p():(this.dcodeIO=this.dcodeIO||{}).Long=p(); 23 | -------------------------------------------------------------------------------- /nodeserver/www/ProtoBuf.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ProtoBuf.js (c) 2013 Daniel Wirtz 3 | Released under the Apache License, Version 2.0 4 | see: https://github.com/dcodeIO/ProtoBuf.js for details 5 | */ 6 | (function(s){function u(l){var g={VERSION:"3.8.2",WIRE_TYPES:{}};g.WIRE_TYPES.VARINT=0;g.WIRE_TYPES.BITS64=1;g.WIRE_TYPES.LDELIM=2;g.WIRE_TYPES.STARTGROUP=3;g.WIRE_TYPES.ENDGROUP=4;g.WIRE_TYPES.BITS32=5;g.PACKABLE_WIRE_TYPES=[g.WIRE_TYPES.VARINT,g.WIRE_TYPES.BITS64,g.WIRE_TYPES.BITS32];g.TYPES={int32:{name:"int32",wireType:g.WIRE_TYPES.VARINT},uint32:{name:"uint32",wireType:g.WIRE_TYPES.VARINT},sint32:{name:"sint32",wireType:g.WIRE_TYPES.VARINT},int64:{name:"int64",wireType:g.WIRE_TYPES.VARINT},uint64:{name:"uint64", 7 | wireType:g.WIRE_TYPES.VARINT},sint64:{name:"sint64",wireType:g.WIRE_TYPES.VARINT},bool:{name:"bool",wireType:g.WIRE_TYPES.VARINT},"double":{name:"double",wireType:g.WIRE_TYPES.BITS64},string:{name:"string",wireType:g.WIRE_TYPES.LDELIM},bytes:{name:"bytes",wireType:g.WIRE_TYPES.LDELIM},fixed32:{name:"fixed32",wireType:g.WIRE_TYPES.BITS32},sfixed32:{name:"sfixed32",wireType:g.WIRE_TYPES.BITS32},fixed64:{name:"fixed64",wireType:g.WIRE_TYPES.BITS64},sfixed64:{name:"sfixed64",wireType:g.WIRE_TYPES.BITS64}, 8 | "float":{name:"float",wireType:g.WIRE_TYPES.BITS32},"enum":{name:"enum",wireType:g.WIRE_TYPES.VARINT},message:{name:"message",wireType:g.WIRE_TYPES.LDELIM},group:{name:"group",wireType:g.WIRE_TYPES.STARTGROUP}};g.ID_MIN=1;g.ID_MAX=536870911;g.ByteBuffer=l;g.Long=l.Long||null;g.convertFieldsToCamelCase=!1;g.populateAccessors=!0;g.Util=function(){Object.create||(Object.create=function(e){function d(){}if(1=this.source.length)return null;if(this.readingString)return this.readingString=!1,this._readString();var f,a;do{for(f=!1;d.WHITESPACE.test(a=this.source.charAt(this.index));)if(this.index++,"\n"===a&&this.line++,this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if("/"=== 15 | this.source.charAt(++this.index)){for(;"\n"!==this.source.charAt(this.index);)if(this.index++,this.index==this.source.length)return null;this.index++;this.line++;f=!0}else if("*"===this.source.charAt(this.index)){for(a="";"*/"!==a+(a=this.source.charAt(this.index));)if(this.index++,"\n"===a&&this.line++,this.index===this.source.length)return null;this.index++;f=!0}else throw Error("Unterminated comment at line "+this.line+": /"+this.source.charAt(this.index));}while(f);if(this.index===this.source.length)return null; 16 | f=this.index;d.DELIM.lastIndex=0;if(d.DELIM.test(this.source.charAt(f)))++f;else for(++f;fa?"-":"")+f);};b._parseString=function(){var f="",a;do{this.tn.next();f+=this.tn.next();a=this.tn.next();if(a!==this.tn.stringEndsWith)throw Error("Illegal end of string at line "+ 20 | this.tn.line+": "+a);a=this.tn.peek()}while(a===d.STRINGOPEN||a===d.STRINGOPEN_SQ);return f};b._parseId=function(f,a){var c=-1,b=1;"-"==f.charAt(0)&&(b=-1,f=f.substring(1));if(d.NUMBER_DEC.test(f))c=parseInt(f);else if(d.NUMBER_HEX.test(f))c=parseInt(f.substring(2),16);else if(d.NUMBER_OCT.test(f))c=parseInt(f.substring(1),8);else throw Error("Illegal id at line "+this.tn.line+": "+(0>b?"-":"")+f);c=b*c|0;if(!a&&0>c)throw Error("Illegal id at line "+this.tn.line+": "+(0>b?"-":"")+f);return c};b._parsePackage= 21 | function(f){f=this.tn.next();if(!d.TYPEREF.test(f))throw Error("Illegal package name at line "+this.tn.line+": "+f);var a=f;f=this.tn.next();if(f!=d.END)throw Error("Illegal end of package at line "+this.tn.line+": "+f);return a};b._parseImport=function(f){f=this.tn.peek();"public"===f&&(this.tn.next(),f=this.tn.peek());if(f!==d.STRINGOPEN&&f!==d.STRINGOPEN_SQ)throw Error("Illegal start of import at line "+this.tn.line+": "+f);var a=this._parseString();f=this.tn.next();if(f!==d.END)throw Error("Illegal end of import at line "+ 22 | this.tn.line+": "+f);return a};b._parseOption=function(f,a){a=this.tn.next();var c=!1;a==d.COPTOPEN&&(c=!0,a=this.tn.next());if(!d.TYPEREF.test(a)&&!/google\.protobuf\./.test(a))throw Error("Illegal option name in message "+f.name+" at line "+this.tn.line+": "+a);var b=a;a=this.tn.next();if(c){if(a!==d.COPTCLOSE)throw Error("Illegal end in message "+f.name+", option "+b+" at line "+this.tn.line+": "+a);b="("+b+")";a=this.tn.next();d.FQTYPEREF.test(a)&&(b+=a,a=this.tn.next())}if(a!==d.EQUAL)throw Error("Illegal operator in message "+ 23 | f.name+", option "+b+" at line "+this.tn.line+": "+a);a=this.tn.peek();if(a===d.STRINGOPEN||a===d.STRINGOPEN_SQ)c=this._parseString();else if(this.tn.next(),d.NUMBER.test(a))c=this._parseNumber(a,!0);else if(d.BOOL.test(a))c="true"===a;else if(d.TYPEREF.test(a))c=a;else throw Error("Illegal option value in message "+f.name+", option "+b+" at line "+this.tn.line+": "+a);a=this.tn.next();if(a!==d.END)throw Error("Illegal end of option in message "+f.name+", option "+b+" at line "+this.tn.line+": "+ 24 | a);f.options[b]=c};b._parseIgnoredStatement=function(f,a){var c;do{c=this.tn.next();if(null===c)throw Error("Unexpected EOF in "+f.name+", "+a+" at line "+this.tn.line);if(c===d.END)break}while(1)};b._parseService=function(f,a){a=this.tn.next();if(!d.NAME.test(a))throw Error("Illegal service name at line "+this.tn.line+": "+a);var c=a,b={name:c,rpc:{},options:{}};a=this.tn.next();if(a!==d.OPEN)throw Error("Illegal start of service "+c+" at line "+this.tn.line+": "+a);do if(a=this.tn.next(),"option"=== 25 | a)this._parseOption(b,a);else if("rpc"===a)this._parseServiceRPC(b,a);else if(a!==d.CLOSE)throw Error("Illegal type of service "+c+" at line "+this.tn.line+": "+a);while(a!==d.CLOSE);f.services.push(b)};b._parseServiceRPC=function(f,a){var c=a;a=this.tn.next();if(!d.NAME.test(a))throw Error("Illegal method name in service "+f.name+" at line "+this.tn.line+": "+a);var b=a,e={request:null,response:null,options:{}};a=this.tn.next();if(a!==d.COPTOPEN)throw Error("Illegal start of request type in service "+ 26 | f.name+"#"+b+" at line "+this.tn.line+": "+a);a=this.tn.next();if(!d.TYPEREF.test(a))throw Error("Illegal request type in service "+f.name+"#"+b+" at line "+this.tn.line+": "+a);e.request=a;a=this.tn.next();if(a!=d.COPTCLOSE)throw Error("Illegal end of request type in service "+f.name+"#"+b+" at line "+this.tn.line+": "+a);a=this.tn.next();if("returns"!==a.toLowerCase())throw Error("Illegal delimiter in service "+f.name+"#"+b+" at line "+this.tn.line+": "+a);a=this.tn.next();if(a!=d.COPTOPEN)throw Error("Illegal start of response type in service "+ 27 | f.name+"#"+b+" at line "+this.tn.line+": "+a);a=this.tn.next();e.response=a;a=this.tn.next();if(a!==d.COPTCLOSE)throw Error("Illegal end of response type in service "+f.name+"#"+b+" at line "+this.tn.line+": "+a);a=this.tn.next();if(a===d.OPEN){do if(a=this.tn.next(),"option"===a)this._parseOption(e,a);else if(a!==d.CLOSE)throw Error("Illegal start of option inservice "+f.name+"#"+b+" at line "+this.tn.line+": "+a);while(a!==d.CLOSE);this.tn.peek()===d.END&&this.tn.next()}else if(a!==d.END)throw Error("Illegal delimiter in service "+ 28 | f.name+"#"+b+" at line "+this.tn.line+": "+a);"undefined"===typeof f[c]&&(f[c]={});f[c][b]=e};b._parseMessage=function(f,a,c){var b={},e="group"===c;c=this.tn.next();if(!d.NAME.test(c))throw Error("Illegal "+(e?"group":"message")+" name"+(f?" in message "+f.name:"")+" at line "+this.tn.line+": "+c);b.name=c;if(e){c=this.tn.next();if(c!==d.EQUAL)throw Error("Illegal id assignment after group "+b.name+" at line "+this.tn.line+": "+c);c=this.tn.next();try{a.id=this._parseId(c)}catch(g){throw Error("Illegal field id value for group "+ 29 | b.name+"#"+a.name+" at line "+this.tn.line+": "+c);}b.isGroup=!0}b.fields=[];b.enums=[];b.messages=[];b.options={};b.oneofs={};c=this.tn.next();c===d.OPTOPEN&&a&&(this._parseFieldOptions(b,a,c),c=this.tn.next());if(c!==d.OPEN)throw Error("Illegal start of "+(e?"group":"message")+" "+b.name+" at line "+this.tn.line+": "+c);do if(c=this.tn.next(),c===d.CLOSE){c=this.tn.peek();c===d.END&&this.tn.next();break}else if(d.RULE.test(c))this._parseMessageField(b,c);else if("oneof"===c)this._parseMessageOneOf(b, 30 | c);else if("enum"===c)this._parseEnum(b,c);else if("message"===c)this._parseMessage(b,null,c);else if("option"===c)this._parseOption(b,c);else if("extensions"===c)b.extensions=this._parseExtensions(b,c);else if("extend"===c)this._parseExtend(b,c);else throw Error("Illegal token in message "+b.name+" at line "+this.tn.line+": "+c);while(1);f.messages.push(b);return b};b._parseMessageField=function(b,a){var c={},e=null;c.rule=a;c.options={};a=this.tn.next();if("group"===a){e=this._parseMessage(b,c, 31 | a);if(!/^[A-Z]/.test(e.name))throw Error("Group names must start with a capital letter");c.type=e.name;c.name=e.name.toLowerCase();a=this.tn.peek();a===d.END&&this.tn.next()}else{if(!d.TYPE.test(a)&&!d.TYPEREF.test(a))throw Error("Illegal field type in message "+b.name+" at line "+this.tn.line+": "+a);c.type=a;a=this.tn.next();if(!d.NAME.test(a))throw Error("Illegal field name in message "+b.name+" at line "+this.tn.line+": "+a);c.name=a;a=this.tn.next();if(a!==d.EQUAL)throw Error("Illegal token in field "+ 32 | b.name+"#"+c.name+" at line "+this.tn.line+": "+a);a=this.tn.next();try{c.id=this._parseId(a)}catch(g){throw Error("Illegal field id in message "+b.name+"#"+c.name+" at line "+this.tn.line+": "+a);}a=this.tn.next();a===d.OPTOPEN&&(this._parseFieldOptions(b,c,a),a=this.tn.next());if(a!==d.END)throw Error("Illegal delimiter in message "+b.name+"#"+c.name+" at line "+this.tn.line+": "+a);}b.fields.push(c);return c};b._parseMessageOneOf=function(b,a){a=this.tn.next();if(!d.NAME.test(a))throw Error("Illegal oneof name in message "+ 33 | b.name+" at line "+this.tn.line+": "+a);var c=a,e,g=[];a=this.tn.next();if(a!==d.OPEN)throw Error("Illegal start of oneof "+c+" at line "+this.tn.line+": "+a);for(;this.tn.peek()!==d.CLOSE;)e=this._parseMessageField(b,"optional"),e.oneof=c,g.push(e.id);this.tn.next();b.oneofs[c]=g};b._parseFieldOptions=function(b,a,c){var e=!0;do{c=this.tn.next();if(c===d.OPTCLOSE)break;else if(c===d.OPTEND){if(e)throw Error("Illegal start of options in message "+b.name+"#"+a.name+" at line "+this.tn.line+": "+c); 34 | c=this.tn.next()}this._parseFieldOption(b,a,c);e=!1}while(1)};b._parseFieldOption=function(b,a,c){var e=!1;c===d.COPTOPEN&&(c=this.tn.next(),e=!0);if(!d.TYPEREF.test(c))throw Error("Illegal field option in "+b.name+"#"+a.name+" at line "+this.tn.line+": "+c);var g=c;c=this.tn.next();if(e){if(c!==d.COPTCLOSE)throw Error("Illegal delimiter in "+b.name+"#"+a.name+" at line "+this.tn.line+": "+c);g="("+g+")";c=this.tn.next();d.FQTYPEREF.test(c)&&(g+=c,c=this.tn.next())}if(c!==d.EQUAL)throw Error("Illegal token in "+ 35 | b.name+"#"+a.name+" at line "+this.tn.line+": "+c);c=this.tn.peek();if(c===d.STRINGOPEN||c===d.STRINGOPEN_SQ)b=this._parseString();else if(d.NUMBER.test(c,!0))b=this._parseNumber(this.tn.next(),!0);else if(d.BOOL.test(c))b="true"===this.tn.next().toLowerCase();else if(d.TYPEREF.test(c))b=this.tn.next();else throw Error("Illegal value in message "+b.name+"#"+a.name+", option "+g+" at line "+this.tn.line+": "+c);a.options[g]=b};b._parseEnum=function(b,a){var c={};a=this.tn.next();if(!d.NAME.test(a))throw Error("Illegal enum name in message "+ 36 | b.name+" at line "+this.tn.line+": "+a);c.name=a;a=this.tn.next();if(a!==d.OPEN)throw Error("Illegal start of enum "+c.name+" at line "+this.tn.line+": "+a);c.values=[];c.options={};do{a=this.tn.next();if(a===d.CLOSE){a=this.tn.peek();a===d.END&&this.tn.next();break}if("option"==a)this._parseOption(c,a);else{if(!d.NAME.test(a))throw Error("Illegal name in enum "+c.name+" at line "+this.tn.line+": "+a);this._parseEnumValue(c,a)}}while(1);b.enums.push(c)};b._parseEnumValue=function(b,a){var c={};c.name= 37 | a;a=this.tn.next();if(a!==d.EQUAL)throw Error("Illegal token in enum "+b.name+" at line "+this.tn.line+": "+a);a=this.tn.next();try{c.id=this._parseId(a,!0)}catch(e){throw Error("Illegal id in enum "+b.name+" at line "+this.tn.line+": "+a);}b.values.push(c);a=this.tn.next();a===d.OPTOPEN&&(this._parseFieldOptions(b,{options:{}},a),a=this.tn.next());if(a!==d.END)throw Error("Illegal delimiter in enum "+b.name+" at line "+this.tn.line+": "+a);};b._parseExtensions=function(b,a){var c=[];a=this.tn.next(); 38 | "min"===a?c.push(e.ID_MIN):"max"===a?c.push(e.ID_MAX):c.push(this._parseNumber(a));a=this.tn.next();if("to"!==a)throw Error("Illegal extensions delimiter in message "+b.name+" at line "+this.tn.line+": "+a);a=this.tn.next();"min"===a?c.push(e.ID_MIN):"max"===a?c.push(e.ID_MAX):c.push(this._parseNumber(a));a=this.tn.next();if(a!==d.END)throw Error("Illegal extensions delimiter in message "+b.name+" at line "+this.tn.line+": "+a);return c};b._parseExtend=function(b,a){a=this.tn.next();if(!d.TYPEREF.test(a))throw Error("Illegal message name at line "+ 39 | this.tn.line+": "+a);var c={};c.ref=a;c.fields=[];a=this.tn.next();if(a!==d.OPEN)throw Error("Illegal start of extend "+c.name+" at line "+this.tn.line+": "+a);do if(a=this.tn.next(),a===d.CLOSE){a=this.tn.peek();a==d.END&&this.tn.next();break}else if(d.RULE.test(a))this._parseMessageField(c,a);else throw Error("Illegal token in extend "+c.name+" at line "+this.tn.line+": "+a);while(1);b.messages.push(c);return c};b.toString=function(){return"Parser"};g.Parser=n;return g}(g,g.Lang);g.Reflect=function(e){function d(a, 40 | b){var c=b.readVarint32(),f=c&7,c=c>>3;switch(f){case e.WIRE_TYPES.VARINT:do c=b.readUint8();while(128===(c&128));break;case e.WIRE_TYPES.BITS64:b.offset+=8;break;case e.WIRE_TYPES.LDELIM:c=b.readVarint32();b.offset+=c;break;case e.WIRE_TYPES.STARTGROUP:d(c,b);break;case e.WIRE_TYPES.ENDGROUP:if(c===a)return!1;throw Error("Illegal GROUPEND after unknown group: "+c+" ("+a+" expected)");case e.WIRE_TYPES.BITS32:b.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+a+": "+f);}return!0} 41 | function g(a,b){if(a&&"number"===typeof a.low&&"number"===typeof a.high&&"boolean"===typeof a.unsigned&&a.low===a.low&&a.high===a.high)return new e.Long(a.low,a.high,"undefined"===typeof b?a.unsigned:b);if("string"===typeof a)return e.Long.fromString(a,b||!1,10);if("number"===typeof a)return e.Long.fromNumber(a,b||!1);throw Error("not convertible to Long");}var k={},n=function(a,b,c){this.builder=a;this.parent=b;this.name=c},b=n.prototype;b.fqn=function(){var a=this.name,b=this;do{b=b.parent;if(null== 42 | b)break;a=b.name+"."+a}while(1);return a};b.toString=function(a){return(a?this.className+" ":"")+this.fqn()};b.build=function(){throw Error(this.toString(!0)+" cannot be built directly");};k.T=n;var f=function(a,b,c,e){n.call(this,a,b,c);this.className="Namespace";this.children=[];this.options=e||{}},b=f.prototype=Object.create(n.prototype);b.getChildren=function(a){a=a||null;if(null==a)return this.children.slice();for(var b=[],c=0,e=this.children.length;ca.remaining())return null;var e=a.offset,d=a.readVarint32();if(a.remaining()>3;if(p===e.WIRE_TYPES.ENDGROUP){if(k!==c)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+k+" ("+(c?c+" expected":"not a group")+")");break}if(h=this._fieldsById[k])h.repeated&&!h.options.packed?g[h.name].push(h.decode(p,a)):(g[h.name]=h.decode(p,a),h.oneof&&(null!== 58 | this[h.oneof.name]&&(this[this[h.oneof.name]]=null),g[h.oneof.name]=h.name));else switch(p){case e.WIRE_TYPES.VARINT:a.readVarint32();break;case e.WIRE_TYPES.BITS32:a.offset+=4;break;case e.WIRE_TYPES.BITS64:a.offset+=8;break;case e.WIRE_TYPES.LDELIM:h=a.readVarint32();a.offset+=h;break;case e.WIRE_TYPES.STARTGROUP:for(;d(k,a););break;default:throw Error("Illegal wire type for unknown field "+k+" in "+this.toString(!0)+"#decode: "+p);}}a=0;for(b=this._fields.length;aa?a>>>0:a;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return g(a,!1)}catch(f){c(typeof a,f.message)}else c(typeof a,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return g(a,!0)}catch(h){c(typeof a,h.message)}else c(typeof a,"requires Long.js");case e.TYPES.bool:return"boolean"!==typeof a&&c(typeof a,"not a boolean"),a;case e.TYPES["float"]:case e.TYPES["double"]:return"number"!==typeof a&&c(typeof a, 63 | "not a number"),a;case e.TYPES.string:return"string"===typeof a||a&&a instanceof String||c(typeof a,"not a string"),""+a;case e.TYPES.bytes:return l.isByteBuffer(a)?a:l.wrap(a,"base64");case e.TYPES["enum"]:var k=this.resolvedType.getChildren(p.Value);for(d=0;da?b.writeVarint64(a):b.writeVarint32(a);break;case e.TYPES.uint32:b.writeVarint32(a);break;case e.TYPES.sint32:b.writeVarint32ZigZag(a);break;case e.TYPES.fixed32:b.writeUint32(a);break;case e.TYPES.sfixed32:b.writeInt32(a);break;case e.TYPES.int64:case e.TYPES.uint64:b.writeVarint64(a);break;case e.TYPES.sint64:b.writeVarint64ZigZag(a);break;case e.TYPES.fixed64:b.writeUint64(a);break;case e.TYPES.sfixed64:b.writeInt64(a); 67 | break;case e.TYPES.bool:"string"===typeof a?b.writeVarint32("false"===a.toLowerCase()?0:!!a):b.writeVarint32(a?1:0);break;case e.TYPES["enum"]:b.writeVarint32(a);break;case e.TYPES["float"]:b.writeFloat32(a);break;case e.TYPES["double"]:b.writeFloat64(a);break;case e.TYPES.string:b.writeVString(a);break;case e.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");var c=a.offset;b.writeVarint32(a.remaining());b.append(a);a.offset=c; 68 | break;case e.TYPES.message:c=(new l).LE();this.resolvedType.encode(a,c);b.writeVarint32(c.offset);b.append(c.flip());break;case e.TYPES.group:this.resolvedType.encode(a,b);b.writeVarint32(this.id<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");}return b};c.calculate=function(a){a=this.verifyValue(a);if(null===this.type||"object"!==typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+ 69 | ": "+this.type);if(null===a||this.repeated&&0==a.length)return 0;var b=0;try{if(this.repeated){var c,d;if(this.options.packed&&0<=e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){b+=l.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM);for(c=d=0;ca?l.calculateVarint64(a):l.calculateVarint32(a);case e.TYPES.uint32:return l.calculateVarint32(a);case e.TYPES.sint32:return l.calculateVarint32(l.zigZagEncode32(a));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES["float"]:return 4;case e.TYPES.int64:case e.TYPES.uint64:return l.calculateVarint64(a);case e.TYPES.sint64:return l.calculateVarint64(l.zigZagEncode64(a)); 71 | case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES["enum"]:return l.calculateVarint32(a);case e.TYPES["double"]:return 8;case e.TYPES.string:return a=l.calculateUTF8Bytes(a),l.calculateVarint32(a)+a;case e.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");return l.calculateVarint32(a.remaining())+a.remaining();case e.TYPES.message:return a=this.resolvedType.calculate(a),l.calculateVarint32(a)+ 72 | a;case e.TYPES.group:return a=this.resolvedType.calculate(a),a+l.calculateVarint32(this.id<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");};c.decode=function(a,b,c){if(a!=this.type.wireType&&(c||a!=e.WIRE_TYPES.LDELIM||!this.repeated))throw Error("Illegal wire type for field "+this.toString(!0)+": "+a+" ("+this.type.wireType+" expected)");if(a==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&0<=e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)&& 73 | !c){a=b.readVarint32();a=b.offset+a;for(c=[];b.offset>>0;case e.TYPES.sint32:return b.readVarint32ZigZag()|0;case e.TYPES.fixed32:return b.readUint32()>>>0;case e.TYPES.sfixed32:return b.readInt32()|0;case e.TYPES.int64:return b.readVarint64();case e.TYPES.uint64:return b.readVarint64().toUnsigned();case e.TYPES.sint64:return b.readVarint64ZigZag(); 74 | case e.TYPES.fixed64:return b.readUint64();case e.TYPES.sfixed64:return b.readInt64();case e.TYPES.bool:return!!b.readVarint32();case e.TYPES["enum"]:return b.readVarint32();case e.TYPES["float"]:return b.readFloat();case e.TYPES["double"]:return b.readDouble();case e.TYPES.string:return b.readVString();case e.TYPES.bytes:a=b.readVarint32();if(b.remaining()e.ID_MAX&&(c.extensions[1]=e.ID_MAX));this.ptr.addChild(c);0c.extensions[1])throw Error("Illegal extended field id in message "+c.name+": "+a.fields[h].id+" ("+c.extensions.join(" to ")+ 90 | " expected)");n=a.fields[h].name;this.options.convertFieldsToCamelCase&&(n=g.Message.Field._toCamelCase(a.fields[h].name));p=new g.Message.ExtensionField(this,c,a.fields[h].rule,a.fields[h].type,this.ptr.fqn()+"."+n,a.fields[h].id,a.fields[h].options);n=new g.Extension(this,this.ptr,a.fields[h].name,p);p.extension=n;this.ptr.addChild(n);c.addChild(p)}else{if(!/\.?google\.protobuf\./.test(a.ref))throw Error("Extended message "+a.ref+" is not defined");}else throw Error("Not a valid definition: "+JSON.stringify(a)); 91 | }else throw Error("Not a valid namespace: "+JSON.stringify(b));this.ptr=this.ptr.parent}this.resolved=!1;this.result=null;return this};n["import"]=function(b,d){if("string"===typeof d){e.Util.IS_NODE&&(d=require("path").resolve(d));if(!0===this.files[d])return this.reset(),this;this.files[d]=!0}if(b.imports&&0 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | 17 |
18 | 19 | 20 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /nodeserver/www/qtprotobufreq.proto: -------------------------------------------------------------------------------- 1 | message RequestMessage { 2 | //data service name 3 | required string service = 1; 4 | //result data format 5 | required string format = 2; 6 | //token 7 | required string token = 3; 8 | //params 9 | //map params = 4; 10 | } 11 | 12 | message ErrorStatus { 13 | required string message = 1; 14 | //google.protobuf.Any details = 2; 15 | } 16 | -------------------------------------------------------------------------------- /nodeserver/www/qtprotobufres.proto: -------------------------------------------------------------------------------- 1 | message ResponseMessage { 2 | //data service name 3 | required string service = 1; 4 | //result data format 5 | required string format = 2; 6 | //request is succeeded or not 7 | required bool isSucceeded = 3; 8 | //result data 9 | //google.protobuf.Any data = 4; 10 | //errors 11 | required string errors = 5; 12 | } 13 | -------------------------------------------------------------------------------- /qtclient/Information.RequestMessage.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: Information.RequestMessage.proto 3 | 4 | #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION 5 | #include "Information.RequestMessage.pb.h" 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | // @@protoc_insertion_point(includes) 19 | 20 | namespace tutorial { 21 | 22 | namespace { 23 | 24 | const ::google::protobuf::Descriptor* RequestMessage_descriptor_ = NULL; 25 | const ::google::protobuf::internal::GeneratedMessageReflection* 26 | RequestMessage_reflection_ = NULL; 27 | const ::google::protobuf::Descriptor* RequestMessage_ParamsEntry_descriptor_ = NULL; 28 | const ::google::protobuf::Descriptor* ErrorStatus_descriptor_ = NULL; 29 | const ::google::protobuf::internal::GeneratedMessageReflection* 30 | ErrorStatus_reflection_ = NULL; 31 | 32 | } // namespace 33 | 34 | 35 | void protobuf_AssignDesc_Information_2eRequestMessage_2eproto() { 36 | protobuf_AddDesc_Information_2eRequestMessage_2eproto(); 37 | const ::google::protobuf::FileDescriptor* file = 38 | ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( 39 | "Information.RequestMessage.proto"); 40 | GOOGLE_CHECK(file != NULL); 41 | RequestMessage_descriptor_ = file->message_type(0); 42 | static const int RequestMessage_offsets_[4] = { 43 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestMessage, service_), 44 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestMessage, format_), 45 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestMessage, token_), 46 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestMessage, params_), 47 | }; 48 | RequestMessage_reflection_ = 49 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( 50 | RequestMessage_descriptor_, 51 | RequestMessage::default_instance_, 52 | RequestMessage_offsets_, 53 | -1, 54 | -1, 55 | -1, 56 | sizeof(RequestMessage), 57 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestMessage, _internal_metadata_), 58 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestMessage, _is_default_instance_)); 59 | RequestMessage_ParamsEntry_descriptor_ = RequestMessage_descriptor_->nested_type(0); 60 | ErrorStatus_descriptor_ = file->message_type(1); 61 | static const int ErrorStatus_offsets_[2] = { 62 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ErrorStatus, message_), 63 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ErrorStatus, details_), 64 | }; 65 | ErrorStatus_reflection_ = 66 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( 67 | ErrorStatus_descriptor_, 68 | ErrorStatus::default_instance_, 69 | ErrorStatus_offsets_, 70 | -1, 71 | -1, 72 | -1, 73 | sizeof(ErrorStatus), 74 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ErrorStatus, _internal_metadata_), 75 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ErrorStatus, _is_default_instance_)); 76 | } 77 | 78 | namespace { 79 | 80 | GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); 81 | inline void protobuf_AssignDescriptorsOnce() { 82 | ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, 83 | &protobuf_AssignDesc_Information_2eRequestMessage_2eproto); 84 | } 85 | 86 | void protobuf_RegisterTypes(const ::std::string&) { 87 | protobuf_AssignDescriptorsOnce(); 88 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( 89 | RequestMessage_descriptor_, &RequestMessage::default_instance()); 90 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( 91 | RequestMessage_ParamsEntry_descriptor_, 92 | ::google::protobuf::internal::MapEntry< 93 | ::std::string, 94 | ::google::protobuf::Any, 95 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, 96 | ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, 97 | 0>::CreateDefaultInstance( 98 | RequestMessage_ParamsEntry_descriptor_)); 99 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( 100 | ErrorStatus_descriptor_, &ErrorStatus::default_instance()); 101 | } 102 | 103 | } // namespace 104 | 105 | void protobuf_ShutdownFile_Information_2eRequestMessage_2eproto() { 106 | delete RequestMessage::default_instance_; 107 | delete RequestMessage_reflection_; 108 | delete ErrorStatus::default_instance_; 109 | delete ErrorStatus_reflection_; 110 | } 111 | 112 | void protobuf_AddDesc_Information_2eRequestMessage_2eproto() { 113 | static bool already_here = false; 114 | if (already_here) return; 115 | already_here = true; 116 | GOOGLE_PROTOBUF_VERIFY_VERSION; 117 | 118 | ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); 119 | ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( 120 | "\n Information.RequestMessage.proto\022\010tuto" 121 | "rial\032\031google/protobuf/any.proto\"\273\001\n\016Requ" 122 | "estMessage\022\017\n\007service\030\001 \001(\t\022\016\n\006format\030\002 " 123 | "\001(\t\022\r\n\005token\030\003 \001(\t\0224\n\006params\030\004 \003(\0132$.tut" 124 | "orial.RequestMessage.ParamsEntry\032C\n\013Para" 125 | "msEntry\022\013\n\003key\030\001 \001(\t\022#\n\005value\030\002 \001(\0132\024.go" 126 | "ogle.protobuf.Any:\0028\001\"E\n\013ErrorStatus\022\017\n\007" 127 | "message\030\001 \001(\t\022%\n\007details\030\002 \001(\0132\024.google." 128 | "protobuf.Anyb\006proto3", 340); 129 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( 130 | "Information.RequestMessage.proto", &protobuf_RegisterTypes); 131 | RequestMessage::default_instance_ = new RequestMessage(); 132 | ErrorStatus::default_instance_ = new ErrorStatus(); 133 | RequestMessage::default_instance_->InitAsDefaultInstance(); 134 | ErrorStatus::default_instance_->InitAsDefaultInstance(); 135 | ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Information_2eRequestMessage_2eproto); 136 | } 137 | 138 | // Force AddDescriptors() to be called at static initialization time. 139 | struct StaticDescriptorInitializer_Information_2eRequestMessage_2eproto { 140 | StaticDescriptorInitializer_Information_2eRequestMessage_2eproto() { 141 | protobuf_AddDesc_Information_2eRequestMessage_2eproto(); 142 | } 143 | } static_descriptor_initializer_Information_2eRequestMessage_2eproto_; 144 | 145 | namespace { 146 | 147 | static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD; 148 | static void MergeFromFail(int line) { 149 | GOOGLE_CHECK(false) << __FILE__ << ":" << line; 150 | } 151 | 152 | } // namespace 153 | 154 | 155 | // =================================================================== 156 | 157 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 158 | const int RequestMessage::kServiceFieldNumber; 159 | const int RequestMessage::kFormatFieldNumber; 160 | const int RequestMessage::kTokenFieldNumber; 161 | const int RequestMessage::kParamsFieldNumber; 162 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 163 | 164 | RequestMessage::RequestMessage() 165 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { 166 | SharedCtor(); 167 | // @@protoc_insertion_point(constructor:tutorial.RequestMessage) 168 | } 169 | 170 | void RequestMessage::InitAsDefaultInstance() { 171 | _is_default_instance_ = true; 172 | } 173 | 174 | RequestMessage::RequestMessage(const RequestMessage& from) 175 | : ::google::protobuf::Message(), 176 | _internal_metadata_(NULL) { 177 | SharedCtor(); 178 | MergeFrom(from); 179 | // @@protoc_insertion_point(copy_constructor:tutorial.RequestMessage) 180 | } 181 | 182 | void RequestMessage::SharedCtor() { 183 | _is_default_instance_ = false; 184 | ::google::protobuf::internal::GetEmptyString(); 185 | _cached_size_ = 0; 186 | service_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 187 | format_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 188 | token_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 189 | params_.SetAssignDescriptorCallback( 190 | protobuf_AssignDescriptorsOnce); 191 | params_.SetEntryDescriptor( 192 | &::tutorial::RequestMessage_ParamsEntry_descriptor_); 193 | } 194 | 195 | RequestMessage::~RequestMessage() { 196 | // @@protoc_insertion_point(destructor:tutorial.RequestMessage) 197 | SharedDtor(); 198 | } 199 | 200 | void RequestMessage::SharedDtor() { 201 | service_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 202 | format_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 203 | token_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 204 | if (this != default_instance_) { 205 | } 206 | } 207 | 208 | void RequestMessage::SetCachedSize(int size) const { 209 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 210 | _cached_size_ = size; 211 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 212 | } 213 | const ::google::protobuf::Descriptor* RequestMessage::descriptor() { 214 | protobuf_AssignDescriptorsOnce(); 215 | return RequestMessage_descriptor_; 216 | } 217 | 218 | const RequestMessage& RequestMessage::default_instance() { 219 | if (default_instance_ == NULL) protobuf_AddDesc_Information_2eRequestMessage_2eproto(); 220 | return *default_instance_; 221 | } 222 | 223 | RequestMessage* RequestMessage::default_instance_ = NULL; 224 | 225 | RequestMessage* RequestMessage::New(::google::protobuf::Arena* arena) const { 226 | RequestMessage* n = new RequestMessage; 227 | if (arena != NULL) { 228 | arena->Own(n); 229 | } 230 | return n; 231 | } 232 | 233 | void RequestMessage::Clear() { 234 | service_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 235 | format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 236 | token_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 237 | params_.Clear(); 238 | } 239 | 240 | bool RequestMessage::MergePartialFromCodedStream( 241 | ::google::protobuf::io::CodedInputStream* input) { 242 | #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure 243 | ::google::protobuf::uint32 tag; 244 | // @@protoc_insertion_point(parse_start:tutorial.RequestMessage) 245 | for (;;) { 246 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); 247 | tag = p.first; 248 | if (!p.second) goto handle_unusual; 249 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 250 | // optional string service = 1; 251 | case 1: { 252 | if (tag == 10) { 253 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( 254 | input, this->mutable_service())); 255 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 256 | this->service().data(), this->service().length(), 257 | ::google::protobuf::internal::WireFormatLite::PARSE, 258 | "tutorial.RequestMessage.service")); 259 | } else { 260 | goto handle_unusual; 261 | } 262 | if (input->ExpectTag(18)) goto parse_format; 263 | break; 264 | } 265 | 266 | // optional string format = 2; 267 | case 2: { 268 | if (tag == 18) { 269 | parse_format: 270 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( 271 | input, this->mutable_format())); 272 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 273 | this->format().data(), this->format().length(), 274 | ::google::protobuf::internal::WireFormatLite::PARSE, 275 | "tutorial.RequestMessage.format")); 276 | } else { 277 | goto handle_unusual; 278 | } 279 | if (input->ExpectTag(26)) goto parse_token; 280 | break; 281 | } 282 | 283 | // optional string token = 3; 284 | case 3: { 285 | if (tag == 26) { 286 | parse_token: 287 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( 288 | input, this->mutable_token())); 289 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 290 | this->token().data(), this->token().length(), 291 | ::google::protobuf::internal::WireFormatLite::PARSE, 292 | "tutorial.RequestMessage.token")); 293 | } else { 294 | goto handle_unusual; 295 | } 296 | if (input->ExpectTag(34)) goto parse_params; 297 | break; 298 | } 299 | 300 | // map params = 4; 301 | case 4: { 302 | if (tag == 34) { 303 | parse_params: 304 | DO_(input->IncrementRecursionDepth()); 305 | parse_loop_params: 306 | ::google::protobuf::scoped_ptr entry(params_.NewEntry()); 307 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( 308 | input, entry.get())); 309 | (*mutable_params())[entry->key()].Swap(entry->mutable_value()); 310 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 311 | entry->key().data(), entry->key().length(), 312 | ::google::protobuf::internal::WireFormatLite::PARSE, 313 | "tutorial.RequestMessage.ParamsEntry.key")); 314 | } else { 315 | goto handle_unusual; 316 | } 317 | if (input->ExpectTag(34)) goto parse_loop_params; 318 | input->UnsafeDecrementRecursionDepth(); 319 | if (input->ExpectAtEnd()) goto success; 320 | break; 321 | } 322 | 323 | default: { 324 | handle_unusual: 325 | if (tag == 0 || 326 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == 327 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { 328 | goto success; 329 | } 330 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); 331 | break; 332 | } 333 | } 334 | } 335 | success: 336 | // @@protoc_insertion_point(parse_success:tutorial.RequestMessage) 337 | return true; 338 | failure: 339 | // @@protoc_insertion_point(parse_failure:tutorial.RequestMessage) 340 | return false; 341 | #undef DO_ 342 | } 343 | 344 | void RequestMessage::SerializeWithCachedSizes( 345 | ::google::protobuf::io::CodedOutputStream* output) const { 346 | // @@protoc_insertion_point(serialize_start:tutorial.RequestMessage) 347 | // optional string service = 1; 348 | if (this->service().size() > 0) { 349 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 350 | this->service().data(), this->service().length(), 351 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 352 | "tutorial.RequestMessage.service"); 353 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 354 | 1, this->service(), output); 355 | } 356 | 357 | // optional string format = 2; 358 | if (this->format().size() > 0) { 359 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 360 | this->format().data(), this->format().length(), 361 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 362 | "tutorial.RequestMessage.format"); 363 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 364 | 2, this->format(), output); 365 | } 366 | 367 | // optional string token = 3; 368 | if (this->token().size() > 0) { 369 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 370 | this->token().data(), this->token().length(), 371 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 372 | "tutorial.RequestMessage.token"); 373 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 374 | 3, this->token(), output); 375 | } 376 | 377 | // map params = 4; 378 | { 379 | ::google::protobuf::scoped_ptr entry; 380 | for (::google::protobuf::Map< ::std::string, ::google::protobuf::Any >::const_iterator 381 | it = this->params().begin(); 382 | it != this->params().end(); ++it) { 383 | entry.reset(params_.NewEntryWrapper(it->first, it->second)); 384 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 385 | 4, *entry, output); 386 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 387 | it->first.data(), it->first.length(), 388 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 389 | "tutorial.RequestMessage.ParamsEntry.key"); 390 | } 391 | } 392 | 393 | // @@protoc_insertion_point(serialize_end:tutorial.RequestMessage) 394 | } 395 | 396 | ::google::protobuf::uint8* RequestMessage::SerializeWithCachedSizesToArray( 397 | ::google::protobuf::uint8* target) const { 398 | // @@protoc_insertion_point(serialize_to_array_start:tutorial.RequestMessage) 399 | // optional string service = 1; 400 | if (this->service().size() > 0) { 401 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 402 | this->service().data(), this->service().length(), 403 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 404 | "tutorial.RequestMessage.service"); 405 | target = 406 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 407 | 1, this->service(), target); 408 | } 409 | 410 | // optional string format = 2; 411 | if (this->format().size() > 0) { 412 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 413 | this->format().data(), this->format().length(), 414 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 415 | "tutorial.RequestMessage.format"); 416 | target = 417 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 418 | 2, this->format(), target); 419 | } 420 | 421 | // optional string token = 3; 422 | if (this->token().size() > 0) { 423 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 424 | this->token().data(), this->token().length(), 425 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 426 | "tutorial.RequestMessage.token"); 427 | target = 428 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 429 | 3, this->token(), target); 430 | } 431 | 432 | // map params = 4; 433 | { 434 | ::google::protobuf::scoped_ptr entry; 435 | for (::google::protobuf::Map< ::std::string, ::google::protobuf::Any >::const_iterator 436 | it = this->params().begin(); 437 | it != this->params().end(); ++it) { 438 | entry.reset(params_.NewEntryWrapper(it->first, it->second)); 439 | target = ::google::protobuf::internal::WireFormatLite:: 440 | WriteMessageNoVirtualToArray( 441 | 4, *entry, target); 442 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 443 | it->first.data(), it->first.length(), 444 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 445 | "tutorial.RequestMessage.ParamsEntry.key"); 446 | } 447 | } 448 | 449 | // @@protoc_insertion_point(serialize_to_array_end:tutorial.RequestMessage) 450 | return target; 451 | } 452 | 453 | int RequestMessage::ByteSize() const { 454 | int total_size = 0; 455 | 456 | // optional string service = 1; 457 | if (this->service().size() > 0) { 458 | total_size += 1 + 459 | ::google::protobuf::internal::WireFormatLite::StringSize( 460 | this->service()); 461 | } 462 | 463 | // optional string format = 2; 464 | if (this->format().size() > 0) { 465 | total_size += 1 + 466 | ::google::protobuf::internal::WireFormatLite::StringSize( 467 | this->format()); 468 | } 469 | 470 | // optional string token = 3; 471 | if (this->token().size() > 0) { 472 | total_size += 1 + 473 | ::google::protobuf::internal::WireFormatLite::StringSize( 474 | this->token()); 475 | } 476 | 477 | // map params = 4; 478 | total_size += 1 * this->params_size(); 479 | { 480 | ::google::protobuf::scoped_ptr entry; 481 | for (::google::protobuf::Map< ::std::string, ::google::protobuf::Any >::const_iterator 482 | it = this->params().begin(); 483 | it != this->params().end(); ++it) { 484 | entry.reset(params_.NewEntryWrapper(it->first, it->second)); 485 | total_size += ::google::protobuf::internal::WireFormatLite:: 486 | MessageSizeNoVirtual(*entry); 487 | } 488 | } 489 | 490 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 491 | _cached_size_ = total_size; 492 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 493 | return total_size; 494 | } 495 | 496 | void RequestMessage::MergeFrom(const ::google::protobuf::Message& from) { 497 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); 498 | const RequestMessage* source = 499 | ::google::protobuf::internal::DynamicCastToGenerated( 500 | &from); 501 | if (source == NULL) { 502 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); 503 | } else { 504 | MergeFrom(*source); 505 | } 506 | } 507 | 508 | void RequestMessage::MergeFrom(const RequestMessage& from) { 509 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); 510 | params_.MergeFrom(from.params_); 511 | if (from.service().size() > 0) { 512 | 513 | service_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.service_); 514 | } 515 | if (from.format().size() > 0) { 516 | 517 | format_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.format_); 518 | } 519 | if (from.token().size() > 0) { 520 | 521 | token_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.token_); 522 | } 523 | } 524 | 525 | void RequestMessage::CopyFrom(const ::google::protobuf::Message& from) { 526 | if (&from == this) return; 527 | Clear(); 528 | MergeFrom(from); 529 | } 530 | 531 | void RequestMessage::CopyFrom(const RequestMessage& from) { 532 | if (&from == this) return; 533 | Clear(); 534 | MergeFrom(from); 535 | } 536 | 537 | bool RequestMessage::IsInitialized() const { 538 | 539 | return true; 540 | } 541 | 542 | void RequestMessage::Swap(RequestMessage* other) { 543 | if (other == this) return; 544 | InternalSwap(other); 545 | } 546 | void RequestMessage::InternalSwap(RequestMessage* other) { 547 | service_.Swap(&other->service_); 548 | format_.Swap(&other->format_); 549 | token_.Swap(&other->token_); 550 | params_.Swap(&other->params_); 551 | _internal_metadata_.Swap(&other->_internal_metadata_); 552 | std::swap(_cached_size_, other->_cached_size_); 553 | } 554 | 555 | ::google::protobuf::Metadata RequestMessage::GetMetadata() const { 556 | protobuf_AssignDescriptorsOnce(); 557 | ::google::protobuf::Metadata metadata; 558 | metadata.descriptor = RequestMessage_descriptor_; 559 | metadata.reflection = RequestMessage_reflection_; 560 | return metadata; 561 | } 562 | 563 | #if PROTOBUF_INLINE_NOT_IN_HEADERS 564 | // RequestMessage 565 | 566 | // optional string service = 1; 567 | void RequestMessage::clear_service() { 568 | service_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 569 | } 570 | const ::std::string& RequestMessage::service() const { 571 | // @@protoc_insertion_point(field_get:tutorial.RequestMessage.service) 572 | return service_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 573 | } 574 | void RequestMessage::set_service(const ::std::string& value) { 575 | 576 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 577 | // @@protoc_insertion_point(field_set:tutorial.RequestMessage.service) 578 | } 579 | void RequestMessage::set_service(const char* value) { 580 | 581 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 582 | // @@protoc_insertion_point(field_set_char:tutorial.RequestMessage.service) 583 | } 584 | void RequestMessage::set_service(const char* value, size_t size) { 585 | 586 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 587 | ::std::string(reinterpret_cast(value), size)); 588 | // @@protoc_insertion_point(field_set_pointer:tutorial.RequestMessage.service) 589 | } 590 | ::std::string* RequestMessage::mutable_service() { 591 | 592 | // @@protoc_insertion_point(field_mutable:tutorial.RequestMessage.service) 593 | return service_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 594 | } 595 | ::std::string* RequestMessage::release_service() { 596 | 597 | return service_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 598 | } 599 | void RequestMessage::set_allocated_service(::std::string* service) { 600 | if (service != NULL) { 601 | 602 | } else { 603 | 604 | } 605 | service_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), service); 606 | // @@protoc_insertion_point(field_set_allocated:tutorial.RequestMessage.service) 607 | } 608 | 609 | // optional string format = 2; 610 | void RequestMessage::clear_format() { 611 | format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 612 | } 613 | const ::std::string& RequestMessage::format() const { 614 | // @@protoc_insertion_point(field_get:tutorial.RequestMessage.format) 615 | return format_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 616 | } 617 | void RequestMessage::set_format(const ::std::string& value) { 618 | 619 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 620 | // @@protoc_insertion_point(field_set:tutorial.RequestMessage.format) 621 | } 622 | void RequestMessage::set_format(const char* value) { 623 | 624 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 625 | // @@protoc_insertion_point(field_set_char:tutorial.RequestMessage.format) 626 | } 627 | void RequestMessage::set_format(const char* value, size_t size) { 628 | 629 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 630 | ::std::string(reinterpret_cast(value), size)); 631 | // @@protoc_insertion_point(field_set_pointer:tutorial.RequestMessage.format) 632 | } 633 | ::std::string* RequestMessage::mutable_format() { 634 | 635 | // @@protoc_insertion_point(field_mutable:tutorial.RequestMessage.format) 636 | return format_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 637 | } 638 | ::std::string* RequestMessage::release_format() { 639 | 640 | return format_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 641 | } 642 | void RequestMessage::set_allocated_format(::std::string* format) { 643 | if (format != NULL) { 644 | 645 | } else { 646 | 647 | } 648 | format_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), format); 649 | // @@protoc_insertion_point(field_set_allocated:tutorial.RequestMessage.format) 650 | } 651 | 652 | // optional string token = 3; 653 | void RequestMessage::clear_token() { 654 | token_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 655 | } 656 | const ::std::string& RequestMessage::token() const { 657 | // @@protoc_insertion_point(field_get:tutorial.RequestMessage.token) 658 | return token_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 659 | } 660 | void RequestMessage::set_token(const ::std::string& value) { 661 | 662 | token_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 663 | // @@protoc_insertion_point(field_set:tutorial.RequestMessage.token) 664 | } 665 | void RequestMessage::set_token(const char* value) { 666 | 667 | token_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 668 | // @@protoc_insertion_point(field_set_char:tutorial.RequestMessage.token) 669 | } 670 | void RequestMessage::set_token(const char* value, size_t size) { 671 | 672 | token_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 673 | ::std::string(reinterpret_cast(value), size)); 674 | // @@protoc_insertion_point(field_set_pointer:tutorial.RequestMessage.token) 675 | } 676 | ::std::string* RequestMessage::mutable_token() { 677 | 678 | // @@protoc_insertion_point(field_mutable:tutorial.RequestMessage.token) 679 | return token_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 680 | } 681 | ::std::string* RequestMessage::release_token() { 682 | 683 | return token_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 684 | } 685 | void RequestMessage::set_allocated_token(::std::string* token) { 686 | if (token != NULL) { 687 | 688 | } else { 689 | 690 | } 691 | token_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), token); 692 | // @@protoc_insertion_point(field_set_allocated:tutorial.RequestMessage.token) 693 | } 694 | 695 | // map params = 4; 696 | int RequestMessage::params_size() const { 697 | return params_.size(); 698 | } 699 | void RequestMessage::clear_params() { 700 | params_.Clear(); 701 | } 702 | const ::google::protobuf::Map< ::std::string, ::google::protobuf::Any >& 703 | RequestMessage::params() const { 704 | // @@protoc_insertion_point(field_map:tutorial.RequestMessage.params) 705 | return params_.GetMap(); 706 | } 707 | ::google::protobuf::Map< ::std::string, ::google::protobuf::Any >* 708 | RequestMessage::mutable_params() { 709 | // @@protoc_insertion_point(field_mutable_map:tutorial.RequestMessage.params) 710 | return params_.MutableMap(); 711 | } 712 | 713 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS 714 | 715 | // =================================================================== 716 | 717 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 718 | const int ErrorStatus::kMessageFieldNumber; 719 | const int ErrorStatus::kDetailsFieldNumber; 720 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 721 | 722 | ErrorStatus::ErrorStatus() 723 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { 724 | SharedCtor(); 725 | // @@protoc_insertion_point(constructor:tutorial.ErrorStatus) 726 | } 727 | 728 | void ErrorStatus::InitAsDefaultInstance() { 729 | _is_default_instance_ = true; 730 | details_ = const_cast< ::google::protobuf::Any*>(&::google::protobuf::Any::default_instance()); 731 | } 732 | 733 | ErrorStatus::ErrorStatus(const ErrorStatus& from) 734 | : ::google::protobuf::Message(), 735 | _internal_metadata_(NULL) { 736 | SharedCtor(); 737 | MergeFrom(from); 738 | // @@protoc_insertion_point(copy_constructor:tutorial.ErrorStatus) 739 | } 740 | 741 | void ErrorStatus::SharedCtor() { 742 | _is_default_instance_ = false; 743 | ::google::protobuf::internal::GetEmptyString(); 744 | _cached_size_ = 0; 745 | message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 746 | details_ = NULL; 747 | } 748 | 749 | ErrorStatus::~ErrorStatus() { 750 | // @@protoc_insertion_point(destructor:tutorial.ErrorStatus) 751 | SharedDtor(); 752 | } 753 | 754 | void ErrorStatus::SharedDtor() { 755 | message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 756 | if (this != default_instance_) { 757 | delete details_; 758 | } 759 | } 760 | 761 | void ErrorStatus::SetCachedSize(int size) const { 762 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 763 | _cached_size_ = size; 764 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 765 | } 766 | const ::google::protobuf::Descriptor* ErrorStatus::descriptor() { 767 | protobuf_AssignDescriptorsOnce(); 768 | return ErrorStatus_descriptor_; 769 | } 770 | 771 | const ErrorStatus& ErrorStatus::default_instance() { 772 | if (default_instance_ == NULL) protobuf_AddDesc_Information_2eRequestMessage_2eproto(); 773 | return *default_instance_; 774 | } 775 | 776 | ErrorStatus* ErrorStatus::default_instance_ = NULL; 777 | 778 | ErrorStatus* ErrorStatus::New(::google::protobuf::Arena* arena) const { 779 | ErrorStatus* n = new ErrorStatus; 780 | if (arena != NULL) { 781 | arena->Own(n); 782 | } 783 | return n; 784 | } 785 | 786 | void ErrorStatus::Clear() { 787 | message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 788 | if (GetArenaNoVirtual() == NULL && details_ != NULL) delete details_; 789 | details_ = NULL; 790 | } 791 | 792 | bool ErrorStatus::MergePartialFromCodedStream( 793 | ::google::protobuf::io::CodedInputStream* input) { 794 | #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure 795 | ::google::protobuf::uint32 tag; 796 | // @@protoc_insertion_point(parse_start:tutorial.ErrorStatus) 797 | for (;;) { 798 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); 799 | tag = p.first; 800 | if (!p.second) goto handle_unusual; 801 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 802 | // optional string message = 1; 803 | case 1: { 804 | if (tag == 10) { 805 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( 806 | input, this->mutable_message())); 807 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 808 | this->message().data(), this->message().length(), 809 | ::google::protobuf::internal::WireFormatLite::PARSE, 810 | "tutorial.ErrorStatus.message")); 811 | } else { 812 | goto handle_unusual; 813 | } 814 | if (input->ExpectTag(18)) goto parse_details; 815 | break; 816 | } 817 | 818 | // optional .google.protobuf.Any details = 2; 819 | case 2: { 820 | if (tag == 18) { 821 | parse_details: 822 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( 823 | input, mutable_details())); 824 | } else { 825 | goto handle_unusual; 826 | } 827 | if (input->ExpectAtEnd()) goto success; 828 | break; 829 | } 830 | 831 | default: { 832 | handle_unusual: 833 | if (tag == 0 || 834 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == 835 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { 836 | goto success; 837 | } 838 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); 839 | break; 840 | } 841 | } 842 | } 843 | success: 844 | // @@protoc_insertion_point(parse_success:tutorial.ErrorStatus) 845 | return true; 846 | failure: 847 | // @@protoc_insertion_point(parse_failure:tutorial.ErrorStatus) 848 | return false; 849 | #undef DO_ 850 | } 851 | 852 | void ErrorStatus::SerializeWithCachedSizes( 853 | ::google::protobuf::io::CodedOutputStream* output) const { 854 | // @@protoc_insertion_point(serialize_start:tutorial.ErrorStatus) 855 | // optional string message = 1; 856 | if (this->message().size() > 0) { 857 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 858 | this->message().data(), this->message().length(), 859 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 860 | "tutorial.ErrorStatus.message"); 861 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 862 | 1, this->message(), output); 863 | } 864 | 865 | // optional .google.protobuf.Any details = 2; 866 | if (this->has_details()) { 867 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 868 | 2, *this->details_, output); 869 | } 870 | 871 | // @@protoc_insertion_point(serialize_end:tutorial.ErrorStatus) 872 | } 873 | 874 | ::google::protobuf::uint8* ErrorStatus::SerializeWithCachedSizesToArray( 875 | ::google::protobuf::uint8* target) const { 876 | // @@protoc_insertion_point(serialize_to_array_start:tutorial.ErrorStatus) 877 | // optional string message = 1; 878 | if (this->message().size() > 0) { 879 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 880 | this->message().data(), this->message().length(), 881 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 882 | "tutorial.ErrorStatus.message"); 883 | target = 884 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 885 | 1, this->message(), target); 886 | } 887 | 888 | // optional .google.protobuf.Any details = 2; 889 | if (this->has_details()) { 890 | target = ::google::protobuf::internal::WireFormatLite:: 891 | WriteMessageNoVirtualToArray( 892 | 2, *this->details_, target); 893 | } 894 | 895 | // @@protoc_insertion_point(serialize_to_array_end:tutorial.ErrorStatus) 896 | return target; 897 | } 898 | 899 | int ErrorStatus::ByteSize() const { 900 | int total_size = 0; 901 | 902 | // optional string message = 1; 903 | if (this->message().size() > 0) { 904 | total_size += 1 + 905 | ::google::protobuf::internal::WireFormatLite::StringSize( 906 | this->message()); 907 | } 908 | 909 | // optional .google.protobuf.Any details = 2; 910 | if (this->has_details()) { 911 | total_size += 1 + 912 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( 913 | *this->details_); 914 | } 915 | 916 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 917 | _cached_size_ = total_size; 918 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 919 | return total_size; 920 | } 921 | 922 | void ErrorStatus::MergeFrom(const ::google::protobuf::Message& from) { 923 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); 924 | const ErrorStatus* source = 925 | ::google::protobuf::internal::DynamicCastToGenerated( 926 | &from); 927 | if (source == NULL) { 928 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); 929 | } else { 930 | MergeFrom(*source); 931 | } 932 | } 933 | 934 | void ErrorStatus::MergeFrom(const ErrorStatus& from) { 935 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); 936 | if (from.message().size() > 0) { 937 | 938 | message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_); 939 | } 940 | if (from.has_details()) { 941 | mutable_details()->::google::protobuf::Any::MergeFrom(from.details()); 942 | } 943 | } 944 | 945 | void ErrorStatus::CopyFrom(const ::google::protobuf::Message& from) { 946 | if (&from == this) return; 947 | Clear(); 948 | MergeFrom(from); 949 | } 950 | 951 | void ErrorStatus::CopyFrom(const ErrorStatus& from) { 952 | if (&from == this) return; 953 | Clear(); 954 | MergeFrom(from); 955 | } 956 | 957 | bool ErrorStatus::IsInitialized() const { 958 | 959 | return true; 960 | } 961 | 962 | void ErrorStatus::Swap(ErrorStatus* other) { 963 | if (other == this) return; 964 | InternalSwap(other); 965 | } 966 | void ErrorStatus::InternalSwap(ErrorStatus* other) { 967 | message_.Swap(&other->message_); 968 | std::swap(details_, other->details_); 969 | _internal_metadata_.Swap(&other->_internal_metadata_); 970 | std::swap(_cached_size_, other->_cached_size_); 971 | } 972 | 973 | ::google::protobuf::Metadata ErrorStatus::GetMetadata() const { 974 | protobuf_AssignDescriptorsOnce(); 975 | ::google::protobuf::Metadata metadata; 976 | metadata.descriptor = ErrorStatus_descriptor_; 977 | metadata.reflection = ErrorStatus_reflection_; 978 | return metadata; 979 | } 980 | 981 | #if PROTOBUF_INLINE_NOT_IN_HEADERS 982 | // ErrorStatus 983 | 984 | // optional string message = 1; 985 | void ErrorStatus::clear_message() { 986 | message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 987 | } 988 | const ::std::string& ErrorStatus::message() const { 989 | // @@protoc_insertion_point(field_get:tutorial.ErrorStatus.message) 990 | return message_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 991 | } 992 | void ErrorStatus::set_message(const ::std::string& value) { 993 | 994 | message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 995 | // @@protoc_insertion_point(field_set:tutorial.ErrorStatus.message) 996 | } 997 | void ErrorStatus::set_message(const char* value) { 998 | 999 | message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 1000 | // @@protoc_insertion_point(field_set_char:tutorial.ErrorStatus.message) 1001 | } 1002 | void ErrorStatus::set_message(const char* value, size_t size) { 1003 | 1004 | message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 1005 | ::std::string(reinterpret_cast(value), size)); 1006 | // @@protoc_insertion_point(field_set_pointer:tutorial.ErrorStatus.message) 1007 | } 1008 | ::std::string* ErrorStatus::mutable_message() { 1009 | 1010 | // @@protoc_insertion_point(field_mutable:tutorial.ErrorStatus.message) 1011 | return message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1012 | } 1013 | ::std::string* ErrorStatus::release_message() { 1014 | 1015 | return message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 1016 | } 1017 | void ErrorStatus::set_allocated_message(::std::string* message) { 1018 | if (message != NULL) { 1019 | 1020 | } else { 1021 | 1022 | } 1023 | message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), message); 1024 | // @@protoc_insertion_point(field_set_allocated:tutorial.ErrorStatus.message) 1025 | } 1026 | 1027 | // optional .google.protobuf.Any details = 2; 1028 | bool ErrorStatus::has_details() const { 1029 | return !_is_default_instance_ && details_ != NULL; 1030 | } 1031 | void ErrorStatus::clear_details() { 1032 | if (GetArenaNoVirtual() == NULL && details_ != NULL) delete details_; 1033 | details_ = NULL; 1034 | } 1035 | const ::google::protobuf::Any& ErrorStatus::details() const { 1036 | // @@protoc_insertion_point(field_get:tutorial.ErrorStatus.details) 1037 | return details_ != NULL ? *details_ : *default_instance_->details_; 1038 | } 1039 | ::google::protobuf::Any* ErrorStatus::mutable_details() { 1040 | 1041 | if (details_ == NULL) { 1042 | details_ = new ::google::protobuf::Any; 1043 | } 1044 | // @@protoc_insertion_point(field_mutable:tutorial.ErrorStatus.details) 1045 | return details_; 1046 | } 1047 | ::google::protobuf::Any* ErrorStatus::release_details() { 1048 | 1049 | ::google::protobuf::Any* temp = details_; 1050 | details_ = NULL; 1051 | return temp; 1052 | } 1053 | void ErrorStatus::set_allocated_details(::google::protobuf::Any* details) { 1054 | delete details_; 1055 | details_ = details; 1056 | if (details) { 1057 | 1058 | } else { 1059 | 1060 | } 1061 | // @@protoc_insertion_point(field_set_allocated:tutorial.ErrorStatus.details) 1062 | } 1063 | 1064 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS 1065 | 1066 | // @@protoc_insertion_point(namespace_scope) 1067 | 1068 | } // namespace tutorial 1069 | 1070 | // @@protoc_insertion_point(global_scope) 1071 | -------------------------------------------------------------------------------- /qtclient/Information.RequestMessage.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: Information.RequestMessage.proto 3 | 4 | #ifndef PROTOBUF_Information_2eRequestMessage_2eproto__INCLUDED 5 | #define PROTOBUF_Information_2eRequestMessage_2eproto__INCLUDED 6 | 7 | #include 8 | 9 | #include 10 | 11 | #if GOOGLE_PROTOBUF_VERSION < 3000000 12 | #error This file was generated by a newer version of protoc which is 13 | #error incompatible with your Protocol Buffer headers. Please update 14 | #error your headers. 15 | #endif 16 | #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 17 | #error This file was generated by an older version of protoc which is 18 | #error incompatible with your Protocol Buffer headers. Please 19 | #error regenerate this file with a newer version of protoc. 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | // @@protoc_insertion_point(includes) 34 | 35 | namespace tutorial { 36 | 37 | // Internal implementation detail -- do not call these. 38 | void protobuf_AddDesc_Information_2eRequestMessage_2eproto(); 39 | void protobuf_AssignDesc_Information_2eRequestMessage_2eproto(); 40 | void protobuf_ShutdownFile_Information_2eRequestMessage_2eproto(); 41 | 42 | class ErrorStatus; 43 | class RequestMessage; 44 | 45 | // =================================================================== 46 | 47 | class RequestMessage : public ::google::protobuf::Message { 48 | public: 49 | RequestMessage(); 50 | virtual ~RequestMessage(); 51 | 52 | RequestMessage(const RequestMessage& from); 53 | 54 | inline RequestMessage& operator=(const RequestMessage& from) { 55 | CopyFrom(from); 56 | return *this; 57 | } 58 | 59 | static const ::google::protobuf::Descriptor* descriptor(); 60 | static const RequestMessage& default_instance(); 61 | 62 | void Swap(RequestMessage* other); 63 | 64 | // implements Message ---------------------------------------------- 65 | 66 | inline RequestMessage* New() const { return New(NULL); } 67 | 68 | RequestMessage* New(::google::protobuf::Arena* arena) const; 69 | void CopyFrom(const ::google::protobuf::Message& from); 70 | void MergeFrom(const ::google::protobuf::Message& from); 71 | void CopyFrom(const RequestMessage& from); 72 | void MergeFrom(const RequestMessage& from); 73 | void Clear(); 74 | bool IsInitialized() const; 75 | 76 | int ByteSize() const; 77 | bool MergePartialFromCodedStream( 78 | ::google::protobuf::io::CodedInputStream* input); 79 | void SerializeWithCachedSizes( 80 | ::google::protobuf::io::CodedOutputStream* output) const; 81 | ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; 82 | int GetCachedSize() const { return _cached_size_; } 83 | private: 84 | void SharedCtor(); 85 | void SharedDtor(); 86 | void SetCachedSize(int size) const; 87 | void InternalSwap(RequestMessage* other); 88 | private: 89 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 90 | return _internal_metadata_.arena(); 91 | } 92 | inline void* MaybeArenaPtr() const { 93 | return _internal_metadata_.raw_arena_ptr(); 94 | } 95 | public: 96 | 97 | ::google::protobuf::Metadata GetMetadata() const; 98 | 99 | // nested types ---------------------------------------------------- 100 | 101 | 102 | // accessors ------------------------------------------------------- 103 | 104 | // optional string service = 1; 105 | void clear_service(); 106 | static const int kServiceFieldNumber = 1; 107 | const ::std::string& service() const; 108 | void set_service(const ::std::string& value); 109 | void set_service(const char* value); 110 | void set_service(const char* value, size_t size); 111 | ::std::string* mutable_service(); 112 | ::std::string* release_service(); 113 | void set_allocated_service(::std::string* service); 114 | 115 | // optional string format = 2; 116 | void clear_format(); 117 | static const int kFormatFieldNumber = 2; 118 | const ::std::string& format() const; 119 | void set_format(const ::std::string& value); 120 | void set_format(const char* value); 121 | void set_format(const char* value, size_t size); 122 | ::std::string* mutable_format(); 123 | ::std::string* release_format(); 124 | void set_allocated_format(::std::string* format); 125 | 126 | // optional string token = 3; 127 | void clear_token(); 128 | static const int kTokenFieldNumber = 3; 129 | const ::std::string& token() const; 130 | void set_token(const ::std::string& value); 131 | void set_token(const char* value); 132 | void set_token(const char* value, size_t size); 133 | ::std::string* mutable_token(); 134 | ::std::string* release_token(); 135 | void set_allocated_token(::std::string* token); 136 | 137 | // map params = 4; 138 | int params_size() const; 139 | void clear_params(); 140 | static const int kParamsFieldNumber = 4; 141 | const ::google::protobuf::Map< ::std::string, ::google::protobuf::Any >& 142 | params() const; 143 | ::google::protobuf::Map< ::std::string, ::google::protobuf::Any >* 144 | mutable_params(); 145 | 146 | // @@protoc_insertion_point(class_scope:tutorial.RequestMessage) 147 | private: 148 | 149 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 150 | bool _is_default_instance_; 151 | ::google::protobuf::internal::ArenaStringPtr service_; 152 | ::google::protobuf::internal::ArenaStringPtr format_; 153 | ::google::protobuf::internal::ArenaStringPtr token_; 154 | typedef ::google::protobuf::internal::MapEntryLite< 155 | ::std::string, ::google::protobuf::Any, 156 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, 157 | ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, 158 | 0 > 159 | RequestMessage_ParamsEntry; 160 | ::google::protobuf::internal::MapField< 161 | ::std::string, ::google::protobuf::Any, 162 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, 163 | ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, 164 | 0 > params_; 165 | mutable int _cached_size_; 166 | friend void protobuf_AddDesc_Information_2eRequestMessage_2eproto(); 167 | friend void protobuf_AssignDesc_Information_2eRequestMessage_2eproto(); 168 | friend void protobuf_ShutdownFile_Information_2eRequestMessage_2eproto(); 169 | 170 | void InitAsDefaultInstance(); 171 | static RequestMessage* default_instance_; 172 | }; 173 | // ------------------------------------------------------------------- 174 | 175 | class ErrorStatus : public ::google::protobuf::Message { 176 | public: 177 | ErrorStatus(); 178 | virtual ~ErrorStatus(); 179 | 180 | ErrorStatus(const ErrorStatus& from); 181 | 182 | inline ErrorStatus& operator=(const ErrorStatus& from) { 183 | CopyFrom(from); 184 | return *this; 185 | } 186 | 187 | static const ::google::protobuf::Descriptor* descriptor(); 188 | static const ErrorStatus& default_instance(); 189 | 190 | void Swap(ErrorStatus* other); 191 | 192 | // implements Message ---------------------------------------------- 193 | 194 | inline ErrorStatus* New() const { return New(NULL); } 195 | 196 | ErrorStatus* New(::google::protobuf::Arena* arena) const; 197 | void CopyFrom(const ::google::protobuf::Message& from); 198 | void MergeFrom(const ::google::protobuf::Message& from); 199 | void CopyFrom(const ErrorStatus& from); 200 | void MergeFrom(const ErrorStatus& from); 201 | void Clear(); 202 | bool IsInitialized() const; 203 | 204 | int ByteSize() const; 205 | bool MergePartialFromCodedStream( 206 | ::google::protobuf::io::CodedInputStream* input); 207 | void SerializeWithCachedSizes( 208 | ::google::protobuf::io::CodedOutputStream* output) const; 209 | ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; 210 | int GetCachedSize() const { return _cached_size_; } 211 | private: 212 | void SharedCtor(); 213 | void SharedDtor(); 214 | void SetCachedSize(int size) const; 215 | void InternalSwap(ErrorStatus* other); 216 | private: 217 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 218 | return _internal_metadata_.arena(); 219 | } 220 | inline void* MaybeArenaPtr() const { 221 | return _internal_metadata_.raw_arena_ptr(); 222 | } 223 | public: 224 | 225 | ::google::protobuf::Metadata GetMetadata() const; 226 | 227 | // nested types ---------------------------------------------------- 228 | 229 | // accessors ------------------------------------------------------- 230 | 231 | // optional string message = 1; 232 | void clear_message(); 233 | static const int kMessageFieldNumber = 1; 234 | const ::std::string& message() const; 235 | void set_message(const ::std::string& value); 236 | void set_message(const char* value); 237 | void set_message(const char* value, size_t size); 238 | ::std::string* mutable_message(); 239 | ::std::string* release_message(); 240 | void set_allocated_message(::std::string* message); 241 | 242 | // optional .google.protobuf.Any details = 2; 243 | bool has_details() const; 244 | void clear_details(); 245 | static const int kDetailsFieldNumber = 2; 246 | const ::google::protobuf::Any& details() const; 247 | ::google::protobuf::Any* mutable_details(); 248 | ::google::protobuf::Any* release_details(); 249 | void set_allocated_details(::google::protobuf::Any* details); 250 | 251 | // @@protoc_insertion_point(class_scope:tutorial.ErrorStatus) 252 | private: 253 | 254 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 255 | bool _is_default_instance_; 256 | ::google::protobuf::internal::ArenaStringPtr message_; 257 | ::google::protobuf::Any* details_; 258 | mutable int _cached_size_; 259 | friend void protobuf_AddDesc_Information_2eRequestMessage_2eproto(); 260 | friend void protobuf_AssignDesc_Information_2eRequestMessage_2eproto(); 261 | friend void protobuf_ShutdownFile_Information_2eRequestMessage_2eproto(); 262 | 263 | void InitAsDefaultInstance(); 264 | static ErrorStatus* default_instance_; 265 | }; 266 | // =================================================================== 267 | 268 | 269 | // =================================================================== 270 | 271 | #if !PROTOBUF_INLINE_NOT_IN_HEADERS 272 | // RequestMessage 273 | 274 | // optional string service = 1; 275 | inline void RequestMessage::clear_service() { 276 | service_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 277 | } 278 | inline const ::std::string& RequestMessage::service() const { 279 | // @@protoc_insertion_point(field_get:tutorial.RequestMessage.service) 280 | return service_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 281 | } 282 | inline void RequestMessage::set_service(const ::std::string& value) { 283 | 284 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 285 | // @@protoc_insertion_point(field_set:tutorial.RequestMessage.service) 286 | } 287 | inline void RequestMessage::set_service(const char* value) { 288 | 289 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 290 | // @@protoc_insertion_point(field_set_char:tutorial.RequestMessage.service) 291 | } 292 | inline void RequestMessage::set_service(const char* value, size_t size) { 293 | 294 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 295 | ::std::string(reinterpret_cast(value), size)); 296 | // @@protoc_insertion_point(field_set_pointer:tutorial.RequestMessage.service) 297 | } 298 | inline ::std::string* RequestMessage::mutable_service() { 299 | 300 | // @@protoc_insertion_point(field_mutable:tutorial.RequestMessage.service) 301 | return service_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 302 | } 303 | inline ::std::string* RequestMessage::release_service() { 304 | 305 | return service_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 306 | } 307 | inline void RequestMessage::set_allocated_service(::std::string* service) { 308 | if (service != NULL) { 309 | 310 | } else { 311 | 312 | } 313 | service_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), service); 314 | // @@protoc_insertion_point(field_set_allocated:tutorial.RequestMessage.service) 315 | } 316 | 317 | // optional string format = 2; 318 | inline void RequestMessage::clear_format() { 319 | format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 320 | } 321 | inline const ::std::string& RequestMessage::format() const { 322 | // @@protoc_insertion_point(field_get:tutorial.RequestMessage.format) 323 | return format_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 324 | } 325 | inline void RequestMessage::set_format(const ::std::string& value) { 326 | 327 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 328 | // @@protoc_insertion_point(field_set:tutorial.RequestMessage.format) 329 | } 330 | inline void RequestMessage::set_format(const char* value) { 331 | 332 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 333 | // @@protoc_insertion_point(field_set_char:tutorial.RequestMessage.format) 334 | } 335 | inline void RequestMessage::set_format(const char* value, size_t size) { 336 | 337 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 338 | ::std::string(reinterpret_cast(value), size)); 339 | // @@protoc_insertion_point(field_set_pointer:tutorial.RequestMessage.format) 340 | } 341 | inline ::std::string* RequestMessage::mutable_format() { 342 | 343 | // @@protoc_insertion_point(field_mutable:tutorial.RequestMessage.format) 344 | return format_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 345 | } 346 | inline ::std::string* RequestMessage::release_format() { 347 | 348 | return format_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 349 | } 350 | inline void RequestMessage::set_allocated_format(::std::string* format) { 351 | if (format != NULL) { 352 | 353 | } else { 354 | 355 | } 356 | format_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), format); 357 | // @@protoc_insertion_point(field_set_allocated:tutorial.RequestMessage.format) 358 | } 359 | 360 | // optional string token = 3; 361 | inline void RequestMessage::clear_token() { 362 | token_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 363 | } 364 | inline const ::std::string& RequestMessage::token() const { 365 | // @@protoc_insertion_point(field_get:tutorial.RequestMessage.token) 366 | return token_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 367 | } 368 | inline void RequestMessage::set_token(const ::std::string& value) { 369 | 370 | token_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 371 | // @@protoc_insertion_point(field_set:tutorial.RequestMessage.token) 372 | } 373 | inline void RequestMessage::set_token(const char* value) { 374 | 375 | token_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 376 | // @@protoc_insertion_point(field_set_char:tutorial.RequestMessage.token) 377 | } 378 | inline void RequestMessage::set_token(const char* value, size_t size) { 379 | 380 | token_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 381 | ::std::string(reinterpret_cast(value), size)); 382 | // @@protoc_insertion_point(field_set_pointer:tutorial.RequestMessage.token) 383 | } 384 | inline ::std::string* RequestMessage::mutable_token() { 385 | 386 | // @@protoc_insertion_point(field_mutable:tutorial.RequestMessage.token) 387 | return token_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 388 | } 389 | inline ::std::string* RequestMessage::release_token() { 390 | 391 | return token_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 392 | } 393 | inline void RequestMessage::set_allocated_token(::std::string* token) { 394 | if (token != NULL) { 395 | 396 | } else { 397 | 398 | } 399 | token_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), token); 400 | // @@protoc_insertion_point(field_set_allocated:tutorial.RequestMessage.token) 401 | } 402 | 403 | // map params = 4; 404 | inline int RequestMessage::params_size() const { 405 | return params_.size(); 406 | } 407 | inline void RequestMessage::clear_params() { 408 | params_.Clear(); 409 | } 410 | inline const ::google::protobuf::Map< ::std::string, ::google::protobuf::Any >& 411 | RequestMessage::params() const { 412 | // @@protoc_insertion_point(field_map:tutorial.RequestMessage.params) 413 | return params_.GetMap(); 414 | } 415 | inline ::google::protobuf::Map< ::std::string, ::google::protobuf::Any >* 416 | RequestMessage::mutable_params() { 417 | // @@protoc_insertion_point(field_mutable_map:tutorial.RequestMessage.params) 418 | return params_.MutableMap(); 419 | } 420 | 421 | // ------------------------------------------------------------------- 422 | 423 | // ErrorStatus 424 | 425 | // optional string message = 1; 426 | inline void ErrorStatus::clear_message() { 427 | message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 428 | } 429 | inline const ::std::string& ErrorStatus::message() const { 430 | // @@protoc_insertion_point(field_get:tutorial.ErrorStatus.message) 431 | return message_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 432 | } 433 | inline void ErrorStatus::set_message(const ::std::string& value) { 434 | 435 | message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 436 | // @@protoc_insertion_point(field_set:tutorial.ErrorStatus.message) 437 | } 438 | inline void ErrorStatus::set_message(const char* value) { 439 | 440 | message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 441 | // @@protoc_insertion_point(field_set_char:tutorial.ErrorStatus.message) 442 | } 443 | inline void ErrorStatus::set_message(const char* value, size_t size) { 444 | 445 | message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 446 | ::std::string(reinterpret_cast(value), size)); 447 | // @@protoc_insertion_point(field_set_pointer:tutorial.ErrorStatus.message) 448 | } 449 | inline ::std::string* ErrorStatus::mutable_message() { 450 | 451 | // @@protoc_insertion_point(field_mutable:tutorial.ErrorStatus.message) 452 | return message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 453 | } 454 | inline ::std::string* ErrorStatus::release_message() { 455 | 456 | return message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 457 | } 458 | inline void ErrorStatus::set_allocated_message(::std::string* message) { 459 | if (message != NULL) { 460 | 461 | } else { 462 | 463 | } 464 | message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), message); 465 | // @@protoc_insertion_point(field_set_allocated:tutorial.ErrorStatus.message) 466 | } 467 | 468 | // optional .google.protobuf.Any details = 2; 469 | inline bool ErrorStatus::has_details() const { 470 | return !_is_default_instance_ && details_ != NULL; 471 | } 472 | inline void ErrorStatus::clear_details() { 473 | if (GetArenaNoVirtual() == NULL && details_ != NULL) delete details_; 474 | details_ = NULL; 475 | } 476 | inline const ::google::protobuf::Any& ErrorStatus::details() const { 477 | // @@protoc_insertion_point(field_get:tutorial.ErrorStatus.details) 478 | return details_ != NULL ? *details_ : *default_instance_->details_; 479 | } 480 | inline ::google::protobuf::Any* ErrorStatus::mutable_details() { 481 | 482 | if (details_ == NULL) { 483 | details_ = new ::google::protobuf::Any; 484 | } 485 | // @@protoc_insertion_point(field_mutable:tutorial.ErrorStatus.details) 486 | return details_; 487 | } 488 | inline ::google::protobuf::Any* ErrorStatus::release_details() { 489 | 490 | ::google::protobuf::Any* temp = details_; 491 | details_ = NULL; 492 | return temp; 493 | } 494 | inline void ErrorStatus::set_allocated_details(::google::protobuf::Any* details) { 495 | delete details_; 496 | details_ = details; 497 | if (details) { 498 | 499 | } else { 500 | 501 | } 502 | // @@protoc_insertion_point(field_set_allocated:tutorial.ErrorStatus.details) 503 | } 504 | 505 | #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS 506 | // ------------------------------------------------------------------- 507 | 508 | 509 | // @@protoc_insertion_point(namespace_scope) 510 | 511 | } // namespace tutorial 512 | 513 | // @@protoc_insertion_point(global_scope) 514 | 515 | #endif // PROTOBUF_Information_2eRequestMessage_2eproto__INCLUDED 516 | -------------------------------------------------------------------------------- /qtclient/Information.ResponseMessage.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: Information.ResponseMessage.proto 3 | 4 | #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION 5 | #include "Information.ResponseMessage.pb.h" 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | // @@protoc_insertion_point(includes) 19 | 20 | namespace tutorial { 21 | 22 | namespace { 23 | 24 | const ::google::protobuf::Descriptor* ResponseMessage_descriptor_ = NULL; 25 | const ::google::protobuf::internal::GeneratedMessageReflection* 26 | ResponseMessage_reflection_ = NULL; 27 | 28 | } // namespace 29 | 30 | 31 | void protobuf_AssignDesc_Information_2eResponseMessage_2eproto() { 32 | protobuf_AddDesc_Information_2eResponseMessage_2eproto(); 33 | const ::google::protobuf::FileDescriptor* file = 34 | ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( 35 | "Information.ResponseMessage.proto"); 36 | GOOGLE_CHECK(file != NULL); 37 | ResponseMessage_descriptor_ = file->message_type(0); 38 | static const int ResponseMessage_offsets_[5] = { 39 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseMessage, service_), 40 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseMessage, format_), 41 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseMessage, issucceeded_), 42 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseMessage, data_), 43 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseMessage, errors_), 44 | }; 45 | ResponseMessage_reflection_ = 46 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( 47 | ResponseMessage_descriptor_, 48 | ResponseMessage::default_instance_, 49 | ResponseMessage_offsets_, 50 | -1, 51 | -1, 52 | -1, 53 | sizeof(ResponseMessage), 54 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseMessage, _internal_metadata_), 55 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseMessage, _is_default_instance_)); 56 | } 57 | 58 | namespace { 59 | 60 | GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); 61 | inline void protobuf_AssignDescriptorsOnce() { 62 | ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, 63 | &protobuf_AssignDesc_Information_2eResponseMessage_2eproto); 64 | } 65 | 66 | void protobuf_RegisterTypes(const ::std::string&) { 67 | protobuf_AssignDescriptorsOnce(); 68 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( 69 | ResponseMessage_descriptor_, &ResponseMessage::default_instance()); 70 | } 71 | 72 | } // namespace 73 | 74 | void protobuf_ShutdownFile_Information_2eResponseMessage_2eproto() { 75 | delete ResponseMessage::default_instance_; 76 | delete ResponseMessage_reflection_; 77 | } 78 | 79 | void protobuf_AddDesc_Information_2eResponseMessage_2eproto() { 80 | static bool already_here = false; 81 | if (already_here) return; 82 | already_here = true; 83 | GOOGLE_PROTOBUF_VERIFY_VERSION; 84 | 85 | ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fany_2eproto(); 86 | ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( 87 | "\n!Information.ResponseMessage.proto\022\010tut" 88 | "orial\032\031google/protobuf/any.proto\"{\n\017Resp" 89 | "onseMessage\022\017\n\007service\030\001 \001(\t\022\016\n\006format\030\002" 90 | " \001(\t\022\023\n\013isSucceeded\030\003 \001(\010\022\"\n\004data\030\004 \001(\0132" 91 | "\024.google.protobuf.Any\022\016\n\006errors\030\005 \001(\tb\006p" 92 | "roto3", 205); 93 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( 94 | "Information.ResponseMessage.proto", &protobuf_RegisterTypes); 95 | ResponseMessage::default_instance_ = new ResponseMessage(); 96 | ResponseMessage::default_instance_->InitAsDefaultInstance(); 97 | ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Information_2eResponseMessage_2eproto); 98 | } 99 | 100 | // Force AddDescriptors() to be called at static initialization time. 101 | struct StaticDescriptorInitializer_Information_2eResponseMessage_2eproto { 102 | StaticDescriptorInitializer_Information_2eResponseMessage_2eproto() { 103 | protobuf_AddDesc_Information_2eResponseMessage_2eproto(); 104 | } 105 | } static_descriptor_initializer_Information_2eResponseMessage_2eproto_; 106 | 107 | namespace { 108 | 109 | static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD; 110 | static void MergeFromFail(int line) { 111 | GOOGLE_CHECK(false) << __FILE__ << ":" << line; 112 | } 113 | 114 | } // namespace 115 | 116 | 117 | // =================================================================== 118 | 119 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 120 | const int ResponseMessage::kServiceFieldNumber; 121 | const int ResponseMessage::kFormatFieldNumber; 122 | const int ResponseMessage::kIsSucceededFieldNumber; 123 | const int ResponseMessage::kDataFieldNumber; 124 | const int ResponseMessage::kErrorsFieldNumber; 125 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 126 | 127 | ResponseMessage::ResponseMessage() 128 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { 129 | SharedCtor(); 130 | // @@protoc_insertion_point(constructor:tutorial.ResponseMessage) 131 | } 132 | 133 | void ResponseMessage::InitAsDefaultInstance() { 134 | _is_default_instance_ = true; 135 | data_ = const_cast< ::google::protobuf::Any*>(&::google::protobuf::Any::default_instance()); 136 | } 137 | 138 | ResponseMessage::ResponseMessage(const ResponseMessage& from) 139 | : ::google::protobuf::Message(), 140 | _internal_metadata_(NULL) { 141 | SharedCtor(); 142 | MergeFrom(from); 143 | // @@protoc_insertion_point(copy_constructor:tutorial.ResponseMessage) 144 | } 145 | 146 | void ResponseMessage::SharedCtor() { 147 | _is_default_instance_ = false; 148 | ::google::protobuf::internal::GetEmptyString(); 149 | _cached_size_ = 0; 150 | service_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 151 | format_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 152 | issucceeded_ = false; 153 | data_ = NULL; 154 | errors_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 155 | } 156 | 157 | ResponseMessage::~ResponseMessage() { 158 | // @@protoc_insertion_point(destructor:tutorial.ResponseMessage) 159 | SharedDtor(); 160 | } 161 | 162 | void ResponseMessage::SharedDtor() { 163 | service_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 164 | format_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 165 | errors_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 166 | if (this != default_instance_) { 167 | delete data_; 168 | } 169 | } 170 | 171 | void ResponseMessage::SetCachedSize(int size) const { 172 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 173 | _cached_size_ = size; 174 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 175 | } 176 | const ::google::protobuf::Descriptor* ResponseMessage::descriptor() { 177 | protobuf_AssignDescriptorsOnce(); 178 | return ResponseMessage_descriptor_; 179 | } 180 | 181 | const ResponseMessage& ResponseMessage::default_instance() { 182 | if (default_instance_ == NULL) protobuf_AddDesc_Information_2eResponseMessage_2eproto(); 183 | return *default_instance_; 184 | } 185 | 186 | ResponseMessage* ResponseMessage::default_instance_ = NULL; 187 | 188 | ResponseMessage* ResponseMessage::New(::google::protobuf::Arena* arena) const { 189 | ResponseMessage* n = new ResponseMessage; 190 | if (arena != NULL) { 191 | arena->Own(n); 192 | } 193 | return n; 194 | } 195 | 196 | void ResponseMessage::Clear() { 197 | service_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 198 | format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 199 | issucceeded_ = false; 200 | if (GetArenaNoVirtual() == NULL && data_ != NULL) delete data_; 201 | data_ = NULL; 202 | errors_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 203 | } 204 | 205 | bool ResponseMessage::MergePartialFromCodedStream( 206 | ::google::protobuf::io::CodedInputStream* input) { 207 | #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure 208 | ::google::protobuf::uint32 tag; 209 | // @@protoc_insertion_point(parse_start:tutorial.ResponseMessage) 210 | for (;;) { 211 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); 212 | tag = p.first; 213 | if (!p.second) goto handle_unusual; 214 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 215 | // optional string service = 1; 216 | case 1: { 217 | if (tag == 10) { 218 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( 219 | input, this->mutable_service())); 220 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 221 | this->service().data(), this->service().length(), 222 | ::google::protobuf::internal::WireFormatLite::PARSE, 223 | "tutorial.ResponseMessage.service")); 224 | } else { 225 | goto handle_unusual; 226 | } 227 | if (input->ExpectTag(18)) goto parse_format; 228 | break; 229 | } 230 | 231 | // optional string format = 2; 232 | case 2: { 233 | if (tag == 18) { 234 | parse_format: 235 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( 236 | input, this->mutable_format())); 237 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 238 | this->format().data(), this->format().length(), 239 | ::google::protobuf::internal::WireFormatLite::PARSE, 240 | "tutorial.ResponseMessage.format")); 241 | } else { 242 | goto handle_unusual; 243 | } 244 | if (input->ExpectTag(24)) goto parse_isSucceeded; 245 | break; 246 | } 247 | 248 | // optional bool isSucceeded = 3; 249 | case 3: { 250 | if (tag == 24) { 251 | parse_isSucceeded: 252 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 253 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( 254 | input, &issucceeded_))); 255 | 256 | } else { 257 | goto handle_unusual; 258 | } 259 | if (input->ExpectTag(34)) goto parse_data; 260 | break; 261 | } 262 | 263 | // optional .google.protobuf.Any data = 4; 264 | case 4: { 265 | if (tag == 34) { 266 | parse_data: 267 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( 268 | input, mutable_data())); 269 | } else { 270 | goto handle_unusual; 271 | } 272 | if (input->ExpectTag(42)) goto parse_errors; 273 | break; 274 | } 275 | 276 | // optional string errors = 5; 277 | case 5: { 278 | if (tag == 42) { 279 | parse_errors: 280 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( 281 | input, this->mutable_errors())); 282 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 283 | this->errors().data(), this->errors().length(), 284 | ::google::protobuf::internal::WireFormatLite::PARSE, 285 | "tutorial.ResponseMessage.errors")); 286 | } else { 287 | goto handle_unusual; 288 | } 289 | if (input->ExpectAtEnd()) goto success; 290 | break; 291 | } 292 | 293 | default: { 294 | handle_unusual: 295 | if (tag == 0 || 296 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == 297 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { 298 | goto success; 299 | } 300 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); 301 | break; 302 | } 303 | } 304 | } 305 | success: 306 | // @@protoc_insertion_point(parse_success:tutorial.ResponseMessage) 307 | return true; 308 | failure: 309 | // @@protoc_insertion_point(parse_failure:tutorial.ResponseMessage) 310 | return false; 311 | #undef DO_ 312 | } 313 | 314 | void ResponseMessage::SerializeWithCachedSizes( 315 | ::google::protobuf::io::CodedOutputStream* output) const { 316 | // @@protoc_insertion_point(serialize_start:tutorial.ResponseMessage) 317 | // optional string service = 1; 318 | if (this->service().size() > 0) { 319 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 320 | this->service().data(), this->service().length(), 321 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 322 | "tutorial.ResponseMessage.service"); 323 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 324 | 1, this->service(), output); 325 | } 326 | 327 | // optional string format = 2; 328 | if (this->format().size() > 0) { 329 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 330 | this->format().data(), this->format().length(), 331 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 332 | "tutorial.ResponseMessage.format"); 333 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 334 | 2, this->format(), output); 335 | } 336 | 337 | // optional bool isSucceeded = 3; 338 | if (this->issucceeded() != 0) { 339 | ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->issucceeded(), output); 340 | } 341 | 342 | // optional .google.protobuf.Any data = 4; 343 | if (this->has_data()) { 344 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 345 | 4, *this->data_, output); 346 | } 347 | 348 | // optional string errors = 5; 349 | if (this->errors().size() > 0) { 350 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 351 | this->errors().data(), this->errors().length(), 352 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 353 | "tutorial.ResponseMessage.errors"); 354 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 355 | 5, this->errors(), output); 356 | } 357 | 358 | // @@protoc_insertion_point(serialize_end:tutorial.ResponseMessage) 359 | } 360 | 361 | ::google::protobuf::uint8* ResponseMessage::SerializeWithCachedSizesToArray( 362 | ::google::protobuf::uint8* target) const { 363 | // @@protoc_insertion_point(serialize_to_array_start:tutorial.ResponseMessage) 364 | // optional string service = 1; 365 | if (this->service().size() > 0) { 366 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 367 | this->service().data(), this->service().length(), 368 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 369 | "tutorial.ResponseMessage.service"); 370 | target = 371 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 372 | 1, this->service(), target); 373 | } 374 | 375 | // optional string format = 2; 376 | if (this->format().size() > 0) { 377 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 378 | this->format().data(), this->format().length(), 379 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 380 | "tutorial.ResponseMessage.format"); 381 | target = 382 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 383 | 2, this->format(), target); 384 | } 385 | 386 | // optional bool isSucceeded = 3; 387 | if (this->issucceeded() != 0) { 388 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->issucceeded(), target); 389 | } 390 | 391 | // optional .google.protobuf.Any data = 4; 392 | if (this->has_data()) { 393 | target = ::google::protobuf::internal::WireFormatLite:: 394 | WriteMessageNoVirtualToArray( 395 | 4, *this->data_, target); 396 | } 397 | 398 | // optional string errors = 5; 399 | if (this->errors().size() > 0) { 400 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 401 | this->errors().data(), this->errors().length(), 402 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 403 | "tutorial.ResponseMessage.errors"); 404 | target = 405 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 406 | 5, this->errors(), target); 407 | } 408 | 409 | // @@protoc_insertion_point(serialize_to_array_end:tutorial.ResponseMessage) 410 | return target; 411 | } 412 | 413 | int ResponseMessage::ByteSize() const { 414 | int total_size = 0; 415 | 416 | // optional string service = 1; 417 | if (this->service().size() > 0) { 418 | total_size += 1 + 419 | ::google::protobuf::internal::WireFormatLite::StringSize( 420 | this->service()); 421 | } 422 | 423 | // optional string format = 2; 424 | if (this->format().size() > 0) { 425 | total_size += 1 + 426 | ::google::protobuf::internal::WireFormatLite::StringSize( 427 | this->format()); 428 | } 429 | 430 | // optional bool isSucceeded = 3; 431 | if (this->issucceeded() != 0) { 432 | total_size += 1 + 1; 433 | } 434 | 435 | // optional .google.protobuf.Any data = 4; 436 | if (this->has_data()) { 437 | total_size += 1 + 438 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( 439 | *this->data_); 440 | } 441 | 442 | // optional string errors = 5; 443 | if (this->errors().size() > 0) { 444 | total_size += 1 + 445 | ::google::protobuf::internal::WireFormatLite::StringSize( 446 | this->errors()); 447 | } 448 | 449 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 450 | _cached_size_ = total_size; 451 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 452 | return total_size; 453 | } 454 | 455 | void ResponseMessage::MergeFrom(const ::google::protobuf::Message& from) { 456 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); 457 | const ResponseMessage* source = 458 | ::google::protobuf::internal::DynamicCastToGenerated( 459 | &from); 460 | if (source == NULL) { 461 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); 462 | } else { 463 | MergeFrom(*source); 464 | } 465 | } 466 | 467 | void ResponseMessage::MergeFrom(const ResponseMessage& from) { 468 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); 469 | if (from.service().size() > 0) { 470 | 471 | service_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.service_); 472 | } 473 | if (from.format().size() > 0) { 474 | 475 | format_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.format_); 476 | } 477 | if (from.issucceeded() != 0) { 478 | set_issucceeded(from.issucceeded()); 479 | } 480 | if (from.has_data()) { 481 | mutable_data()->::google::protobuf::Any::MergeFrom(from.data()); 482 | } 483 | if (from.errors().size() > 0) { 484 | 485 | errors_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.errors_); 486 | } 487 | } 488 | 489 | void ResponseMessage::CopyFrom(const ::google::protobuf::Message& from) { 490 | if (&from == this) return; 491 | Clear(); 492 | MergeFrom(from); 493 | } 494 | 495 | void ResponseMessage::CopyFrom(const ResponseMessage& from) { 496 | if (&from == this) return; 497 | Clear(); 498 | MergeFrom(from); 499 | } 500 | 501 | bool ResponseMessage::IsInitialized() const { 502 | 503 | return true; 504 | } 505 | 506 | void ResponseMessage::Swap(ResponseMessage* other) { 507 | if (other == this) return; 508 | InternalSwap(other); 509 | } 510 | void ResponseMessage::InternalSwap(ResponseMessage* other) { 511 | service_.Swap(&other->service_); 512 | format_.Swap(&other->format_); 513 | std::swap(issucceeded_, other->issucceeded_); 514 | std::swap(data_, other->data_); 515 | errors_.Swap(&other->errors_); 516 | _internal_metadata_.Swap(&other->_internal_metadata_); 517 | std::swap(_cached_size_, other->_cached_size_); 518 | } 519 | 520 | ::google::protobuf::Metadata ResponseMessage::GetMetadata() const { 521 | protobuf_AssignDescriptorsOnce(); 522 | ::google::protobuf::Metadata metadata; 523 | metadata.descriptor = ResponseMessage_descriptor_; 524 | metadata.reflection = ResponseMessage_reflection_; 525 | return metadata; 526 | } 527 | 528 | #if PROTOBUF_INLINE_NOT_IN_HEADERS 529 | // ResponseMessage 530 | 531 | // optional string service = 1; 532 | void ResponseMessage::clear_service() { 533 | service_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 534 | } 535 | const ::std::string& ResponseMessage::service() const { 536 | // @@protoc_insertion_point(field_get:tutorial.ResponseMessage.service) 537 | return service_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 538 | } 539 | void ResponseMessage::set_service(const ::std::string& value) { 540 | 541 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 542 | // @@protoc_insertion_point(field_set:tutorial.ResponseMessage.service) 543 | } 544 | void ResponseMessage::set_service(const char* value) { 545 | 546 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 547 | // @@protoc_insertion_point(field_set_char:tutorial.ResponseMessage.service) 548 | } 549 | void ResponseMessage::set_service(const char* value, size_t size) { 550 | 551 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 552 | ::std::string(reinterpret_cast(value), size)); 553 | // @@protoc_insertion_point(field_set_pointer:tutorial.ResponseMessage.service) 554 | } 555 | ::std::string* ResponseMessage::mutable_service() { 556 | 557 | // @@protoc_insertion_point(field_mutable:tutorial.ResponseMessage.service) 558 | return service_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 559 | } 560 | ::std::string* ResponseMessage::release_service() { 561 | 562 | return service_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 563 | } 564 | void ResponseMessage::set_allocated_service(::std::string* service) { 565 | if (service != NULL) { 566 | 567 | } else { 568 | 569 | } 570 | service_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), service); 571 | // @@protoc_insertion_point(field_set_allocated:tutorial.ResponseMessage.service) 572 | } 573 | 574 | // optional string format = 2; 575 | void ResponseMessage::clear_format() { 576 | format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 577 | } 578 | const ::std::string& ResponseMessage::format() const { 579 | // @@protoc_insertion_point(field_get:tutorial.ResponseMessage.format) 580 | return format_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 581 | } 582 | void ResponseMessage::set_format(const ::std::string& value) { 583 | 584 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 585 | // @@protoc_insertion_point(field_set:tutorial.ResponseMessage.format) 586 | } 587 | void ResponseMessage::set_format(const char* value) { 588 | 589 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 590 | // @@protoc_insertion_point(field_set_char:tutorial.ResponseMessage.format) 591 | } 592 | void ResponseMessage::set_format(const char* value, size_t size) { 593 | 594 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 595 | ::std::string(reinterpret_cast(value), size)); 596 | // @@protoc_insertion_point(field_set_pointer:tutorial.ResponseMessage.format) 597 | } 598 | ::std::string* ResponseMessage::mutable_format() { 599 | 600 | // @@protoc_insertion_point(field_mutable:tutorial.ResponseMessage.format) 601 | return format_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 602 | } 603 | ::std::string* ResponseMessage::release_format() { 604 | 605 | return format_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 606 | } 607 | void ResponseMessage::set_allocated_format(::std::string* format) { 608 | if (format != NULL) { 609 | 610 | } else { 611 | 612 | } 613 | format_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), format); 614 | // @@protoc_insertion_point(field_set_allocated:tutorial.ResponseMessage.format) 615 | } 616 | 617 | // optional bool isSucceeded = 3; 618 | void ResponseMessage::clear_issucceeded() { 619 | issucceeded_ = false; 620 | } 621 | bool ResponseMessage::issucceeded() const { 622 | // @@protoc_insertion_point(field_get:tutorial.ResponseMessage.isSucceeded) 623 | return issucceeded_; 624 | } 625 | void ResponseMessage::set_issucceeded(bool value) { 626 | 627 | issucceeded_ = value; 628 | // @@protoc_insertion_point(field_set:tutorial.ResponseMessage.isSucceeded) 629 | } 630 | 631 | // optional .google.protobuf.Any data = 4; 632 | bool ResponseMessage::has_data() const { 633 | return !_is_default_instance_ && data_ != NULL; 634 | } 635 | void ResponseMessage::clear_data() { 636 | if (GetArenaNoVirtual() == NULL && data_ != NULL) delete data_; 637 | data_ = NULL; 638 | } 639 | const ::google::protobuf::Any& ResponseMessage::data() const { 640 | // @@protoc_insertion_point(field_get:tutorial.ResponseMessage.data) 641 | return data_ != NULL ? *data_ : *default_instance_->data_; 642 | } 643 | ::google::protobuf::Any* ResponseMessage::mutable_data() { 644 | 645 | if (data_ == NULL) { 646 | data_ = new ::google::protobuf::Any; 647 | } 648 | // @@protoc_insertion_point(field_mutable:tutorial.ResponseMessage.data) 649 | return data_; 650 | } 651 | ::google::protobuf::Any* ResponseMessage::release_data() { 652 | 653 | ::google::protobuf::Any* temp = data_; 654 | data_ = NULL; 655 | return temp; 656 | } 657 | void ResponseMessage::set_allocated_data(::google::protobuf::Any* data) { 658 | delete data_; 659 | data_ = data; 660 | if (data) { 661 | 662 | } else { 663 | 664 | } 665 | // @@protoc_insertion_point(field_set_allocated:tutorial.ResponseMessage.data) 666 | } 667 | 668 | // optional string errors = 5; 669 | void ResponseMessage::clear_errors() { 670 | errors_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 671 | } 672 | const ::std::string& ResponseMessage::errors() const { 673 | // @@protoc_insertion_point(field_get:tutorial.ResponseMessage.errors) 674 | return errors_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 675 | } 676 | void ResponseMessage::set_errors(const ::std::string& value) { 677 | 678 | errors_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 679 | // @@protoc_insertion_point(field_set:tutorial.ResponseMessage.errors) 680 | } 681 | void ResponseMessage::set_errors(const char* value) { 682 | 683 | errors_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 684 | // @@protoc_insertion_point(field_set_char:tutorial.ResponseMessage.errors) 685 | } 686 | void ResponseMessage::set_errors(const char* value, size_t size) { 687 | 688 | errors_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 689 | ::std::string(reinterpret_cast(value), size)); 690 | // @@protoc_insertion_point(field_set_pointer:tutorial.ResponseMessage.errors) 691 | } 692 | ::std::string* ResponseMessage::mutable_errors() { 693 | 694 | // @@protoc_insertion_point(field_mutable:tutorial.ResponseMessage.errors) 695 | return errors_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 696 | } 697 | ::std::string* ResponseMessage::release_errors() { 698 | 699 | return errors_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 700 | } 701 | void ResponseMessage::set_allocated_errors(::std::string* errors) { 702 | if (errors != NULL) { 703 | 704 | } else { 705 | 706 | } 707 | errors_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), errors); 708 | // @@protoc_insertion_point(field_set_allocated:tutorial.ResponseMessage.errors) 709 | } 710 | 711 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS 712 | 713 | // @@protoc_insertion_point(namespace_scope) 714 | 715 | } // namespace tutorial 716 | 717 | // @@protoc_insertion_point(global_scope) 718 | -------------------------------------------------------------------------------- /qtclient/Information.ResponseMessage.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: Information.ResponseMessage.proto 3 | 4 | #ifndef PROTOBUF_Information_2eResponseMessage_2eproto__INCLUDED 5 | #define PROTOBUF_Information_2eResponseMessage_2eproto__INCLUDED 6 | 7 | #include 8 | 9 | #include 10 | 11 | #if GOOGLE_PROTOBUF_VERSION < 3000000 12 | #error This file was generated by a newer version of protoc which is 13 | #error incompatible with your Protocol Buffer headers. Please update 14 | #error your headers. 15 | #endif 16 | #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 17 | #error This file was generated by an older version of protoc which is 18 | #error incompatible with your Protocol Buffer headers. Please 19 | #error regenerate this file with a newer version of protoc. 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | // @@protoc_insertion_point(includes) 32 | 33 | namespace tutorial { 34 | 35 | // Internal implementation detail -- do not call these. 36 | void protobuf_AddDesc_Information_2eResponseMessage_2eproto(); 37 | void protobuf_AssignDesc_Information_2eResponseMessage_2eproto(); 38 | void protobuf_ShutdownFile_Information_2eResponseMessage_2eproto(); 39 | 40 | class ResponseMessage; 41 | 42 | // =================================================================== 43 | 44 | class ResponseMessage : public ::google::protobuf::Message { 45 | public: 46 | ResponseMessage(); 47 | virtual ~ResponseMessage(); 48 | 49 | ResponseMessage(const ResponseMessage& from); 50 | 51 | inline ResponseMessage& operator=(const ResponseMessage& from) { 52 | CopyFrom(from); 53 | return *this; 54 | } 55 | 56 | static const ::google::protobuf::Descriptor* descriptor(); 57 | static const ResponseMessage& default_instance(); 58 | 59 | void Swap(ResponseMessage* other); 60 | 61 | // implements Message ---------------------------------------------- 62 | 63 | inline ResponseMessage* New() const { return New(NULL); } 64 | 65 | ResponseMessage* New(::google::protobuf::Arena* arena) const; 66 | void CopyFrom(const ::google::protobuf::Message& from); 67 | void MergeFrom(const ::google::protobuf::Message& from); 68 | void CopyFrom(const ResponseMessage& from); 69 | void MergeFrom(const ResponseMessage& from); 70 | void Clear(); 71 | bool IsInitialized() const; 72 | 73 | int ByteSize() const; 74 | bool MergePartialFromCodedStream( 75 | ::google::protobuf::io::CodedInputStream* input); 76 | void SerializeWithCachedSizes( 77 | ::google::protobuf::io::CodedOutputStream* output) const; 78 | ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; 79 | int GetCachedSize() const { return _cached_size_; } 80 | private: 81 | void SharedCtor(); 82 | void SharedDtor(); 83 | void SetCachedSize(int size) const; 84 | void InternalSwap(ResponseMessage* other); 85 | private: 86 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 87 | return _internal_metadata_.arena(); 88 | } 89 | inline void* MaybeArenaPtr() const { 90 | return _internal_metadata_.raw_arena_ptr(); 91 | } 92 | public: 93 | 94 | ::google::protobuf::Metadata GetMetadata() const; 95 | 96 | // nested types ---------------------------------------------------- 97 | 98 | // accessors ------------------------------------------------------- 99 | 100 | // optional string service = 1; 101 | void clear_service(); 102 | static const int kServiceFieldNumber = 1; 103 | const ::std::string& service() const; 104 | void set_service(const ::std::string& value); 105 | void set_service(const char* value); 106 | void set_service(const char* value, size_t size); 107 | ::std::string* mutable_service(); 108 | ::std::string* release_service(); 109 | void set_allocated_service(::std::string* service); 110 | 111 | // optional string format = 2; 112 | void clear_format(); 113 | static const int kFormatFieldNumber = 2; 114 | const ::std::string& format() const; 115 | void set_format(const ::std::string& value); 116 | void set_format(const char* value); 117 | void set_format(const char* value, size_t size); 118 | ::std::string* mutable_format(); 119 | ::std::string* release_format(); 120 | void set_allocated_format(::std::string* format); 121 | 122 | // optional bool isSucceeded = 3; 123 | void clear_issucceeded(); 124 | static const int kIsSucceededFieldNumber = 3; 125 | bool issucceeded() const; 126 | void set_issucceeded(bool value); 127 | 128 | // optional .google.protobuf.Any data = 4; 129 | bool has_data() const; 130 | void clear_data(); 131 | static const int kDataFieldNumber = 4; 132 | const ::google::protobuf::Any& data() const; 133 | ::google::protobuf::Any* mutable_data(); 134 | ::google::protobuf::Any* release_data(); 135 | void set_allocated_data(::google::protobuf::Any* data); 136 | 137 | // optional string errors = 5; 138 | void clear_errors(); 139 | static const int kErrorsFieldNumber = 5; 140 | const ::std::string& errors() const; 141 | void set_errors(const ::std::string& value); 142 | void set_errors(const char* value); 143 | void set_errors(const char* value, size_t size); 144 | ::std::string* mutable_errors(); 145 | ::std::string* release_errors(); 146 | void set_allocated_errors(::std::string* errors); 147 | 148 | // @@protoc_insertion_point(class_scope:tutorial.ResponseMessage) 149 | private: 150 | 151 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 152 | bool _is_default_instance_; 153 | ::google::protobuf::internal::ArenaStringPtr service_; 154 | ::google::protobuf::internal::ArenaStringPtr format_; 155 | ::google::protobuf::Any* data_; 156 | ::google::protobuf::internal::ArenaStringPtr errors_; 157 | bool issucceeded_; 158 | mutable int _cached_size_; 159 | friend void protobuf_AddDesc_Information_2eResponseMessage_2eproto(); 160 | friend void protobuf_AssignDesc_Information_2eResponseMessage_2eproto(); 161 | friend void protobuf_ShutdownFile_Information_2eResponseMessage_2eproto(); 162 | 163 | void InitAsDefaultInstance(); 164 | static ResponseMessage* default_instance_; 165 | }; 166 | // =================================================================== 167 | 168 | 169 | // =================================================================== 170 | 171 | #if !PROTOBUF_INLINE_NOT_IN_HEADERS 172 | // ResponseMessage 173 | 174 | // optional string service = 1; 175 | inline void ResponseMessage::clear_service() { 176 | service_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 177 | } 178 | inline const ::std::string& ResponseMessage::service() const { 179 | // @@protoc_insertion_point(field_get:tutorial.ResponseMessage.service) 180 | return service_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 181 | } 182 | inline void ResponseMessage::set_service(const ::std::string& value) { 183 | 184 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 185 | // @@protoc_insertion_point(field_set:tutorial.ResponseMessage.service) 186 | } 187 | inline void ResponseMessage::set_service(const char* value) { 188 | 189 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 190 | // @@protoc_insertion_point(field_set_char:tutorial.ResponseMessage.service) 191 | } 192 | inline void ResponseMessage::set_service(const char* value, size_t size) { 193 | 194 | service_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 195 | ::std::string(reinterpret_cast(value), size)); 196 | // @@protoc_insertion_point(field_set_pointer:tutorial.ResponseMessage.service) 197 | } 198 | inline ::std::string* ResponseMessage::mutable_service() { 199 | 200 | // @@protoc_insertion_point(field_mutable:tutorial.ResponseMessage.service) 201 | return service_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 202 | } 203 | inline ::std::string* ResponseMessage::release_service() { 204 | 205 | return service_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 206 | } 207 | inline void ResponseMessage::set_allocated_service(::std::string* service) { 208 | if (service != NULL) { 209 | 210 | } else { 211 | 212 | } 213 | service_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), service); 214 | // @@protoc_insertion_point(field_set_allocated:tutorial.ResponseMessage.service) 215 | } 216 | 217 | // optional string format = 2; 218 | inline void ResponseMessage::clear_format() { 219 | format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 220 | } 221 | inline const ::std::string& ResponseMessage::format() const { 222 | // @@protoc_insertion_point(field_get:tutorial.ResponseMessage.format) 223 | return format_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 224 | } 225 | inline void ResponseMessage::set_format(const ::std::string& value) { 226 | 227 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 228 | // @@protoc_insertion_point(field_set:tutorial.ResponseMessage.format) 229 | } 230 | inline void ResponseMessage::set_format(const char* value) { 231 | 232 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 233 | // @@protoc_insertion_point(field_set_char:tutorial.ResponseMessage.format) 234 | } 235 | inline void ResponseMessage::set_format(const char* value, size_t size) { 236 | 237 | format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 238 | ::std::string(reinterpret_cast(value), size)); 239 | // @@protoc_insertion_point(field_set_pointer:tutorial.ResponseMessage.format) 240 | } 241 | inline ::std::string* ResponseMessage::mutable_format() { 242 | 243 | // @@protoc_insertion_point(field_mutable:tutorial.ResponseMessage.format) 244 | return format_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 245 | } 246 | inline ::std::string* ResponseMessage::release_format() { 247 | 248 | return format_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 249 | } 250 | inline void ResponseMessage::set_allocated_format(::std::string* format) { 251 | if (format != NULL) { 252 | 253 | } else { 254 | 255 | } 256 | format_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), format); 257 | // @@protoc_insertion_point(field_set_allocated:tutorial.ResponseMessage.format) 258 | } 259 | 260 | // optional bool isSucceeded = 3; 261 | inline void ResponseMessage::clear_issucceeded() { 262 | issucceeded_ = false; 263 | } 264 | inline bool ResponseMessage::issucceeded() const { 265 | // @@protoc_insertion_point(field_get:tutorial.ResponseMessage.isSucceeded) 266 | return issucceeded_; 267 | } 268 | inline void ResponseMessage::set_issucceeded(bool value) { 269 | 270 | issucceeded_ = value; 271 | // @@protoc_insertion_point(field_set:tutorial.ResponseMessage.isSucceeded) 272 | } 273 | 274 | // optional .google.protobuf.Any data = 4; 275 | inline bool ResponseMessage::has_data() const { 276 | return !_is_default_instance_ && data_ != NULL; 277 | } 278 | inline void ResponseMessage::clear_data() { 279 | if (GetArenaNoVirtual() == NULL && data_ != NULL) delete data_; 280 | data_ = NULL; 281 | } 282 | inline const ::google::protobuf::Any& ResponseMessage::data() const { 283 | // @@protoc_insertion_point(field_get:tutorial.ResponseMessage.data) 284 | return data_ != NULL ? *data_ : *default_instance_->data_; 285 | } 286 | inline ::google::protobuf::Any* ResponseMessage::mutable_data() { 287 | 288 | if (data_ == NULL) { 289 | data_ = new ::google::protobuf::Any; 290 | } 291 | // @@protoc_insertion_point(field_mutable:tutorial.ResponseMessage.data) 292 | return data_; 293 | } 294 | inline ::google::protobuf::Any* ResponseMessage::release_data() { 295 | 296 | ::google::protobuf::Any* temp = data_; 297 | data_ = NULL; 298 | return temp; 299 | } 300 | inline void ResponseMessage::set_allocated_data(::google::protobuf::Any* data) { 301 | delete data_; 302 | data_ = data; 303 | if (data) { 304 | 305 | } else { 306 | 307 | } 308 | // @@protoc_insertion_point(field_set_allocated:tutorial.ResponseMessage.data) 309 | } 310 | 311 | // optional string errors = 5; 312 | inline void ResponseMessage::clear_errors() { 313 | errors_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 314 | } 315 | inline const ::std::string& ResponseMessage::errors() const { 316 | // @@protoc_insertion_point(field_get:tutorial.ResponseMessage.errors) 317 | return errors_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 318 | } 319 | inline void ResponseMessage::set_errors(const ::std::string& value) { 320 | 321 | errors_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 322 | // @@protoc_insertion_point(field_set:tutorial.ResponseMessage.errors) 323 | } 324 | inline void ResponseMessage::set_errors(const char* value) { 325 | 326 | errors_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 327 | // @@protoc_insertion_point(field_set_char:tutorial.ResponseMessage.errors) 328 | } 329 | inline void ResponseMessage::set_errors(const char* value, size_t size) { 330 | 331 | errors_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 332 | ::std::string(reinterpret_cast(value), size)); 333 | // @@protoc_insertion_point(field_set_pointer:tutorial.ResponseMessage.errors) 334 | } 335 | inline ::std::string* ResponseMessage::mutable_errors() { 336 | 337 | // @@protoc_insertion_point(field_mutable:tutorial.ResponseMessage.errors) 338 | return errors_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 339 | } 340 | inline ::std::string* ResponseMessage::release_errors() { 341 | 342 | return errors_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 343 | } 344 | inline void ResponseMessage::set_allocated_errors(::std::string* errors) { 345 | if (errors != NULL) { 346 | 347 | } else { 348 | 349 | } 350 | errors_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), errors); 351 | // @@protoc_insertion_point(field_set_allocated:tutorial.ResponseMessage.errors) 352 | } 353 | 354 | #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS 355 | 356 | // @@protoc_insertion_point(namespace_scope) 357 | 358 | } // namespace tutorial 359 | 360 | // @@protoc_insertion_point(global_scope) 361 | 362 | #endif // PROTOBUF_Information_2eResponseMessage_2eproto__INCLUDED 363 | -------------------------------------------------------------------------------- /qtclient/WebSocketAndProto.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2016-06-13T18:07:59 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets websockets 10 | 11 | TARGET = WebSocketAndProto 12 | TEMPLATE = app 13 | CONFIG += C++11 14 | 15 | 16 | #system(protoc -I=$$PWD --cpp_out=$$PWD $$PWD/*.proto) 17 | 18 | INCLUDEPATH += /usr/local/include 19 | LIBS += -L/usr/local/lib -lprotobuf 20 | 21 | SOURCES += main.cpp\ 22 | widget.cpp \ 23 | echoclient.cpp 24 | 25 | HEADERS += widget.h \ 26 | echoclient.h \ 27 | BDDataFormat.h 28 | 29 | FORMS += widget.ui 30 | SOURCES += \ 31 | *.pb.cc 32 | HEADERS += \ 33 | *.pb.h 34 | -------------------------------------------------------------------------------- /qtclient/echoclient.cpp: -------------------------------------------------------------------------------- 1 | #include "echoclient.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "Information.RequestMessage.pb.h" 11 | #include "Information.ResponseMessage.pb.h" 12 | 13 | QT_USE_NAMESPACE 14 | 15 | EchoClient::EchoClient(const QUrl &url, QObject *parent) : 16 | QObject(parent), 17 | mUrl(url) 18 | { 19 | connect(&mWebSocket, &QWebSocket::connected, this, &EchoClient::onConnected); 20 | connect(&mWebSocket, &QWebSocket::disconnected, this, &EchoClient::closed); 21 | } 22 | 23 | EchoClient::~EchoClient() 24 | { 25 | mWebSocket.close(); 26 | } 27 | 28 | void EchoClient::sendMsg() 29 | { 30 | tutorial::RequestMessage subRequest; 31 | subRequest.set_service("obj-data-getter-job"); 32 | subRequest.set_token("1212819898BACD3DDD"); 33 | subRequest.set_format("protobuf"); 34 | std::string string; 35 | if (!subRequest.SerializeToString(&string)) { 36 | qDebug() << " Serialize Failed"; 37 | } 38 | QString strmsg = QString("Send Binary message:
" 39 | "
service: %1
format: %2
token: %3
") 40 | .arg(QString::fromStdString("obj-data-getter-job")) 41 | .arg(QString::fromStdString("1212819898BACD3DDD")) 42 | .arg(QString::fromStdString("protobuf")); 43 | emit signalRecieveMessage(strmsg); 44 | mWebSocket.sendBinaryMessage(string.data()); 45 | } 46 | 47 | void EchoClient::openWS() 48 | { 49 | mWebSocket.open(QUrl(mUrl)); 50 | } 51 | 52 | void EchoClient::onConnected() 53 | { 54 | qDebug() << "WebSocket connected"; 55 | emit signalRecieveMessage("WebSocket Connected:"); 56 | connect(&mWebSocket, &QWebSocket::textMessageReceived, 57 | this, &EchoClient::onTextMessageReceived); 58 | connect(&mWebSocket,&QWebSocket::binaryMessageReceived, 59 | this,&EchoClient::onBinaryMessageReceived); 60 | // tutorial::ResponseMessage response 61 | } 62 | 63 | void EchoClient::onTextMessageReceived(QString message) 64 | { 65 | tutorial::ResponseMessage subResult; 66 | tutorial::ResponseMessage result; 67 | google::protobuf::Any any; 68 | 69 | if (!result.ParseFromString(message.toStdString())) 70 | qDebug() << "Parse Failed"; 71 | 72 | QString sevice = QString::fromStdString(subResult.service()); 73 | QString format = QString::fromStdString(subResult.format()); 74 | bool success = subResult.issucceeded(); 75 | 76 | subResult.mutable_data()->UnpackTo(&any); 77 | any.UnpackTo(&result); 78 | 79 | qDebug() << sevice << format << success 80 | <TextData Recv: service:%1
format: %2
result-service:%3
result-format:%4").arg(sevice).arg(format).arg(QString::fromStdString(result.service())).arg(QString::fromStdString( result.format())); 84 | emit signalRecieveMessage(strmsg); 85 | } 86 | 87 | void EchoClient::onBinaryMessageReceived(QByteArray message) 88 | { 89 | QString qMessage= QString::fromUtf8(message.data()); 90 | tutorial::ResponseMessage rootResult; 91 | tutorial::ResponseMessage subResult; 92 | google::protobuf::Any any; 93 | 94 | if (!subResult.ParseFromString(qMessage.toStdString())) 95 | qDebug() << "Parse Failed"; 96 | 97 | QString sevice = QString::fromStdString(rootResult.service()); 98 | QString format = QString::fromStdString(rootResult.format()); 99 | bool success = rootResult.issucceeded(); 100 | 101 | rootResult.mutable_data()->UnpackTo(&any); 102 | any.UnpackTo(&subResult); 103 | 104 | QString strmsg = QString("BinaryData Recv:
" 105 | "
service:%1
format: %2
result-service:%3
result-format:%4
result-type_url:%5
result-value:%6
") 106 | .arg(sevice).arg(format) 107 | .arg(QString::fromStdString(subResult.service())) 108 | .arg(QString::fromStdString( subResult.format())) 109 | .arg(QString::fromStdString( subResult.mutable_data()->type_url())) 110 | .arg(QString::fromStdString( subResult.mutable_data()->value())); 111 | emit signalRecieveMessage(strmsg); 112 | 113 | qDebug() << sevice << format << success; 114 | qDebug() <type_url()); 118 | qDebug()<< QString::fromStdString(subResult.mutable_data()->value()); 119 | 120 | 121 | // mWebSocket.close(); 122 | } 123 | -------------------------------------------------------------------------------- /qtclient/echoclient.h: -------------------------------------------------------------------------------- 1 | #ifndef ECHOCLIENT_H 2 | #define ECHOCLIENT_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | class EchoClient : public QObject 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit EchoClient(const QUrl &url, QObject *parent = Q_NULLPTR); 13 | ~EchoClient(); 14 | 15 | void sendMsg(); 16 | 17 | void openWS(); 18 | Q_SIGNALS: 19 | void closed(); 20 | void signalRecieveMessage(const QString& msg); 21 | 22 | private Q_SLOTS: 23 | void onConnected(); 24 | void onTextMessageReceived(QString message); 25 | void onBinaryMessageReceived(QByteArray message); 26 | private: 27 | QWebSocket mWebSocket; 28 | QUrl mUrl; 29 | }; 30 | 31 | #endif // ECHOCLIENT_H 32 | -------------------------------------------------------------------------------- /qtclient/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /qtclient/widget.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "widget.h" 3 | #include "ui_widget.h" 4 | #include 5 | 6 | Widget::Widget(QWidget *parent) : 7 | QWidget(parent), 8 | ui(new Ui::Widget) 9 | ,m_client(NULL) 10 | { 11 | ui->setupUi(this); 12 | //EchoClient client(QUrl(QStringLiteral("ws://localhost:8080")), debug); 13 | } 14 | 15 | Widget::~Widget() 16 | { 17 | delete ui; 18 | } 19 | 20 | void Widget::on_connLb_clicked() 21 | { 22 | if(m_client == NULL){ 23 | ui->connLb->setEnabled(false); 24 | QString wsUrl = QString("ws://%1:%2").arg(ui->hosted->text()).arg(ui->portld->text()); 25 | qDebug()<openWS(); 31 | } 32 | 33 | void Widget::slotRec(QString str) 34 | { 35 | ui->msgTd->append(str); 36 | } 37 | 38 | void Widget::on_sendLb_clicked() 39 | { 40 | m_client->sendMsg(); 41 | } 42 | 43 | void Widget::slotClose() 44 | { 45 | ui->connLb->setEnabled(true); 46 | ui->msgTd->append("remote server is closed"); 47 | } 48 | -------------------------------------------------------------------------------- /qtclient/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include "echoclient.h" 6 | 7 | namespace Ui { 8 | class Widget; 9 | } 10 | 11 | class Widget : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit Widget(QWidget *parent = 0); 17 | ~Widget(); 18 | 19 | private slots: 20 | void on_connLb_clicked(); 21 | void slotRec(QString); 22 | void on_sendLb_clicked(); 23 | void slotClose(); 24 | 25 | private: 26 | Ui::Widget *ui; 27 | EchoClient *m_client; 28 | }; 29 | 30 | #endif // WIDGET_H 31 | -------------------------------------------------------------------------------- /qtclient/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 551 10 | 396 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 0 19 | 20 | 21 | 0 22 | 23 | 24 | 0 25 | 26 | 27 | 0 28 | 29 | 30 | 31 | 32 | 0 33 | 34 | 35 | 36 | 37 | 0 38 | 39 | 40 | 41 | 42 | 43 | 44 | 地址: 45 | 46 | 47 | 48 | 49 | 50 | 51 | 160.6.68.237 52 | 53 | 54 | 55 | 56 | 57 | 58 | Qt::Horizontal 59 | 60 | 61 | 62 | 40 63 | 20 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 端口: 76 | 77 | 78 | 79 | 80 | 81 | 82 | 808 83 | 84 | 85 | 86 | 87 | 88 | 89 | Qt::Horizontal 90 | 91 | 92 | 93 | 40 94 | 20 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 连接WS服务端 112 | 113 | 114 | 115 | 116 | 117 | 118 | 发送消息 119 | 120 | 121 | 122 | 123 | 124 | 125 | Qt::Vertical 126 | 127 | 128 | 129 | 20 130 | 40 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | --------------------------------------------------------------------------------