source_context_pb.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. // source: google/protobuf/source_context.proto
  2. /**
  3. * @fileoverview
  4. * @enhanceable
  5. * @suppress {missingRequire} reports error on implicit type usages.
  6. * @suppress {messageConventions} JS Compiler reports an error if a variable or
  7. * field starts with 'MSG_' and isn't a translatable message.
  8. * @public
  9. */
  10. // GENERATED CODE -- DO NOT EDIT!
  11. /* eslint-disable */
  12. // @ts-nocheck
  13. var jspb = require('google-protobuf');
  14. var goog = jspb;
  15. var global =
  16. (typeof globalThis !== 'undefined' && globalThis) ||
  17. (typeof window !== 'undefined' && window) ||
  18. (typeof global !== 'undefined' && global) ||
  19. (typeof self !== 'undefined' && self) ||
  20. (function () { return this; }).call(null) ||
  21. Function('return this')();
  22. goog.exportSymbol('proto.google.protobuf.SourceContext', null, global);
  23. /**
  24. * Generated by JsPbCodeGenerator.
  25. * @param {Array=} opt_data Optional initial data array, typically from a
  26. * server response, or constructed directly in Javascript. The array is used
  27. * in place and becomes part of the constructed object. It is not cloned.
  28. * If no data is provided, the constructed object will be empty, but still
  29. * valid.
  30. * @extends {jspb.Message}
  31. * @constructor
  32. */
  33. proto.google.protobuf.SourceContext = function(opt_data) {
  34. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  35. };
  36. goog.inherits(proto.google.protobuf.SourceContext, jspb.Message);
  37. if (goog.DEBUG && !COMPILED) {
  38. /**
  39. * @public
  40. * @override
  41. */
  42. proto.google.protobuf.SourceContext.displayName = 'proto.google.protobuf.SourceContext';
  43. }
  44. if (jspb.Message.GENERATE_TO_OBJECT) {
  45. /**
  46. * Creates an object representation of this proto.
  47. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  48. * Optional fields that are not set will be set to undefined.
  49. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  50. * For the list of reserved names please see:
  51. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  52. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  53. * JSPB instance for transitional soy proto support:
  54. * http://goto/soy-param-migration
  55. * @return {!Object}
  56. */
  57. proto.google.protobuf.SourceContext.prototype.toObject = function(opt_includeInstance) {
  58. return proto.google.protobuf.SourceContext.toObject(opt_includeInstance, this);
  59. };
  60. /**
  61. * Static version of the {@see toObject} method.
  62. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  63. * the JSPB instance for transitional soy proto support:
  64. * http://goto/soy-param-migration
  65. * @param {!proto.google.protobuf.SourceContext} msg The msg instance to transform.
  66. * @return {!Object}
  67. * @suppress {unusedLocalVariables} f is only used for nested messages
  68. */
  69. proto.google.protobuf.SourceContext.toObject = function(includeInstance, msg) {
  70. var f, obj = {
  71. fileName: jspb.Message.getFieldWithDefault(msg, 1, "")
  72. };
  73. if (includeInstance) {
  74. obj.$jspbMessageInstance = msg;
  75. }
  76. return obj;
  77. };
  78. }
  79. /**
  80. * Deserializes binary data (in protobuf wire format).
  81. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  82. * @return {!proto.google.protobuf.SourceContext}
  83. */
  84. proto.google.protobuf.SourceContext.deserializeBinary = function(bytes) {
  85. var reader = new jspb.BinaryReader(bytes);
  86. var msg = new proto.google.protobuf.SourceContext;
  87. return proto.google.protobuf.SourceContext.deserializeBinaryFromReader(msg, reader);
  88. };
  89. /**
  90. * Deserializes binary data (in protobuf wire format) from the
  91. * given reader into the given message object.
  92. * @param {!proto.google.protobuf.SourceContext} msg The message object to deserialize into.
  93. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  94. * @return {!proto.google.protobuf.SourceContext}
  95. */
  96. proto.google.protobuf.SourceContext.deserializeBinaryFromReader = function(msg, reader) {
  97. while (reader.nextField()) {
  98. if (reader.isEndGroup()) {
  99. break;
  100. }
  101. var field = reader.getFieldNumber();
  102. switch (field) {
  103. case 1:
  104. var value = /** @type {string} */ (reader.readString());
  105. msg.setFileName(value);
  106. break;
  107. default:
  108. reader.skipField();
  109. break;
  110. }
  111. }
  112. return msg;
  113. };
  114. /**
  115. * Serializes the message to binary data (in protobuf wire format).
  116. * @return {!Uint8Array}
  117. */
  118. proto.google.protobuf.SourceContext.prototype.serializeBinary = function() {
  119. var writer = new jspb.BinaryWriter();
  120. proto.google.protobuf.SourceContext.serializeBinaryToWriter(this, writer);
  121. return writer.getResultBuffer();
  122. };
  123. /**
  124. * Serializes the given message to binary data (in protobuf wire
  125. * format), writing to the given BinaryWriter.
  126. * @param {!proto.google.protobuf.SourceContext} message
  127. * @param {!jspb.BinaryWriter} writer
  128. * @suppress {unusedLocalVariables} f is only used for nested messages
  129. */
  130. proto.google.protobuf.SourceContext.serializeBinaryToWriter = function(message, writer) {
  131. var f = undefined;
  132. f = message.getFileName();
  133. if (f.length > 0) {
  134. writer.writeString(
  135. 1,
  136. f
  137. );
  138. }
  139. };
  140. /**
  141. * optional string file_name = 1;
  142. * @return {string}
  143. */
  144. proto.google.protobuf.SourceContext.prototype.getFileName = function() {
  145. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  146. };
  147. /**
  148. * @param {string} value
  149. * @return {!proto.google.protobuf.SourceContext} returns this
  150. */
  151. proto.google.protobuf.SourceContext.prototype.setFileName = function(value) {
  152. return jspb.Message.setProto3StringField(this, 1, value);
  153. };
  154. goog.object.extend(exports, proto.google.protobuf);