@@ -166,9 +166,10 @@ public static string MangleMethodClass(AmqpClass c, AmqpMethod m) {
166
166
public int majorVersion ;
167
167
public int minorVersion ;
168
168
public string apiName ;
169
+ public bool m_emitComments = false ;
169
170
170
171
public Type modelType = typeof ( RabbitMQ . Client . Impl . IFullModel ) ;
171
- public ArrayList modelTypes = new ArrayList ( ) ;
172
+ public ArrayList modelTypes = new ArrayList ( ) ;
172
173
public ArrayList constants = new ArrayList ( ) ;
173
174
public ArrayList classes = new ArrayList ( ) ;
174
175
public Hashtable domains = new Hashtable ( ) ;
@@ -177,7 +178,7 @@ public static string MangleMethodClass(AmqpClass c, AmqpMethod m) {
177
178
public static Hashtable primitiveTypeFlagMap ;
178
179
static Apigen ( ) {
179
180
primitiveTypeMap = new Hashtable ( ) ;
180
- primitiveTypeFlagMap = new Hashtable ( ) ;
181
+ primitiveTypeFlagMap = new Hashtable ( ) ;
181
182
InitPrimitiveType ( "octet" , "byte" , false ) ;
182
183
InitPrimitiveType ( "shortstr" , "string" , true ) ;
183
184
InitPrimitiveType ( "longstr" , "byte[]" , true ) ;
@@ -206,6 +207,8 @@ public void HandleOption(string opt) {
206
207
versionOverridden = true ;
207
208
majorVersion = int . Parse ( parts [ 0 ] ) ;
208
209
minorVersion = int . Parse ( parts [ 1 ] ) ;
210
+ } else if ( opt == "/c" ) {
211
+ m_emitComments = true ;
209
212
} else {
210
213
Console . Error . WriteLine ( "Unsupported command-line option: " + opt ) ;
211
214
Usage ( ) ;
@@ -333,6 +336,11 @@ public void Emit(object o) {
333
336
public void EmitLine ( object o ) {
334
337
this . outputFile . WriteLine ( o ) ;
335
338
}
339
+
340
+ public void EmitSpecComment ( object o ) {
341
+ if ( m_emitComments )
342
+ EmitLine ( o ) ;
343
+ }
336
344
337
345
public void EmitPrelude ( ) {
338
346
EmitLine ( "// Autogenerated code. Do not edit." ) ;
@@ -384,10 +392,10 @@ public void EmitClassMethods(AmqpClass c) {
384
392
foreach ( AmqpMethod m in c . Methods ) {
385
393
EmitAutogeneratedSummary ( " " ,
386
394
"AMQP specification method \" " + c . Name + "." + m . Name + "\" ." ) ;
387
- EmitLine ( m . DocumentationCommentVariant ( " " , "remarks" ) ) ;
395
+ EmitSpecComment ( m . DocumentationCommentVariant ( " " , "remarks" ) ) ;
388
396
EmitLine ( " public interface I" + MangleMethodClass ( c , m ) + ": IMethod {" ) ;
389
397
foreach ( AmqpField f in m . Fields ) {
390
- EmitLine ( f . DocumentationComment ( " " ) ) ;
398
+ EmitSpecComment ( f . DocumentationComment ( " " ) ) ;
391
399
EmitLine ( " " + MapDomain ( f . Domain ) + " " + MangleClass ( f . Name ) + " { get; }" ) ;
392
400
}
393
401
EmitLine ( " }" ) ;
@@ -426,7 +434,7 @@ public void EmitClassProperties(AmqpClass c) {
426
434
EmitAutogeneratedSummary ( " " ,
427
435
"AMQP specification content header properties for " +
428
436
"content class \" " + c . Name + "\" " ) ;
429
- EmitLine ( c . DocumentationCommentVariant ( " " , "remarks" ) ) ;
437
+ EmitSpecComment ( c . DocumentationCommentVariant ( " " , "remarks" ) ) ;
430
438
EmitLine ( " public class " + MangleClass ( c . Name )
431
439
+ "Properties: " + propertiesBaseClass + " {" ) ;
432
440
foreach ( AmqpField f in c . Fields ) {
@@ -440,7 +448,7 @@ public void EmitClassProperties(AmqpClass c) {
440
448
}
441
449
EmitLine ( "" ) ;
442
450
foreach ( AmqpField f in c . Fields ) {
443
- EmitLine ( f . DocumentationComment ( " " , "@label" ) ) ;
451
+ EmitSpecComment ( f . DocumentationComment ( " " , "@label" ) ) ;
444
452
EmitLine ( " public " + maybeOverride + MapDomain ( f . Domain ) + " " + MangleClass ( f . Name ) + " {" ) ;
445
453
EmitLine ( " get {" ) ;
446
454
EmitLine ( " return m_" + MangleMethod ( f . Name ) + ";" ) ;
0 commit comments