@@ -194,14 +194,14 @@ public void GenerateNamespace(Namespace @namespace)
194
194
WriteLine ( "namespace {0}" , isTopLevel
195
195
? @namespace . TranslationUnit . Module . OutputNamespace
196
196
: @namespace . Name ) ;
197
- WriteStartBraceIndent ( ) ;
197
+ WriteOpenBraceAndIndent ( ) ;
198
198
}
199
199
200
200
GenerateDeclContext ( @namespace ) ;
201
201
202
202
if ( generateNamespace )
203
203
{
204
- WriteCloseBraceIndent ( ) ;
204
+ UnindentAndWriteCloseBrace ( ) ;
205
205
PopBlock ( NewLineKind . BeforeNextBlock ) ;
206
206
}
207
207
}
@@ -224,15 +224,15 @@ public void GenerateFunctions(DeclarationContext decl)
224
224
WriteLine ( "public ref class {0}" , TranslationUnit . FileNameWithoutExtension ) ;
225
225
WriteLine ( "{" ) ;
226
226
WriteLine ( "public:" ) ;
227
- PushIndent ( ) ;
227
+ Indent ( ) ;
228
228
229
229
// Generate all the function declarations for the module.
230
230
foreach ( var function in decl . Functions )
231
231
{
232
232
GenerateFunction ( function ) ;
233
233
}
234
234
235
- PopIndent ( ) ;
235
+ Unindent ( ) ;
236
236
WriteLine ( "};" ) ;
237
237
238
238
PopBlock ( NewLineKind . BeforeNextBlock ) ;
@@ -259,9 +259,9 @@ public void GenerateClass(Class @class)
259
259
NewLine ( ) ;
260
260
261
261
// Process the nested types.
262
- PushIndent ( ) ;
262
+ Indent ( ) ;
263
263
GenerateDeclContext ( @class ) ;
264
- PopIndent ( ) ;
264
+ Unindent ( ) ;
265
265
266
266
var nativeType = string . Format ( "::{0}*" , @class . QualifiedOriginalName ) ;
267
267
@@ -308,20 +308,20 @@ public void GenerateClassNativeField(Class @class, string nativeType)
308
308
{
309
309
WriteLineIndent ( "property {0} NativePtr;" , nativeType ) ;
310
310
311
- PushIndent ( ) ;
311
+ Indent ( ) ;
312
312
WriteLine ( "property System::IntPtr {0}" , Helpers . InstanceIdentifier ) ;
313
- WriteStartBraceIndent ( ) ;
313
+ WriteOpenBraceAndIndent ( ) ;
314
314
WriteLine ( "virtual System::IntPtr get();" ) ;
315
315
WriteLine ( "virtual void set(System::IntPtr instance);" ) ;
316
- WriteCloseBraceIndent ( ) ;
316
+ UnindentAndWriteCloseBrace ( ) ;
317
317
NewLine ( ) ;
318
318
319
- PopIndent ( ) ;
319
+ Unindent ( ) ;
320
320
}
321
321
322
322
public void GenerateClassGenericMethods ( Class @class )
323
323
{
324
- PushIndent ( ) ;
324
+ Indent ( ) ;
325
325
foreach ( var template in @class . Templates )
326
326
{
327
327
if ( ! template . IsGenerated ) continue ;
@@ -368,15 +368,15 @@ public void GenerateClassGenericMethods(Class @class)
368
368
369
369
PopBlock ( NewLineKind . BeforeNextBlock ) ;
370
370
}
371
- PopIndent ( ) ;
371
+ Unindent ( ) ;
372
372
}
373
373
374
374
public void GenerateClassConstructors ( Class @class , string nativeType )
375
375
{
376
376
if ( @class . IsStatic )
377
377
return ;
378
378
379
- PushIndent ( ) ;
379
+ Indent ( ) ;
380
380
381
381
// Output a default constructor that takes the native pointer.
382
382
WriteLine ( "{0}({1} native);" , @class . Name , nativeType ) ;
@@ -407,7 +407,7 @@ public void GenerateClassConstructors(Class @class, string nativeType)
407
407
}
408
408
}
409
409
410
- PopIndent ( ) ;
410
+ Unindent ( ) ;
411
411
}
412
412
413
413
private void GenerateClassDestructor ( Class @class )
@@ -436,7 +436,7 @@ public void GenerateClassFields(Class @class)
436
436
}
437
437
}
438
438
439
- PushIndent ( ) ;
439
+ Indent ( ) ;
440
440
// check for value types because some of the ignored fields may back properties;
441
441
// not the case for ref types because the NativePtr pattern is used there
442
442
foreach ( var field in @class . Fields . Where ( f => ! ASTUtils . CheckIgnoreField ( f ) ) )
@@ -447,7 +447,7 @@ public void GenerateClassFields(Class @class)
447
447
GenerateField ( @class , field ) ;
448
448
}
449
449
}
450
- PopIndent ( ) ;
450
+ Unindent ( ) ;
451
451
}
452
452
453
453
private void GenerateField ( Class @class , Field field )
@@ -473,7 +473,7 @@ public void GenerateClassEvents(Class @class)
473
473
var cppArgs = cppTypePrinter . VisitParameters ( @event . Parameters , hasNames : true ) ;
474
474
475
475
WriteLine ( "private:" ) ;
476
- PushIndent ( ) ;
476
+ Indent ( ) ;
477
477
478
478
var delegateName = string . Format ( "_{0}Delegate" , @event . Name ) ;
479
479
WriteLine ( "delegate void {0}({1});" , delegateName , cppArgs ) ;
@@ -482,12 +482,12 @@ public void GenerateClassEvents(Class @class)
482
482
WriteLine ( "void _{0}Raise({1});" , @event . Name , cppArgs ) ;
483
483
WriteLine ( "{0} _{1};" , @event . Type , @event . Name ) ;
484
484
485
- PopIndent ( ) ;
485
+ Unindent ( ) ;
486
486
WriteLine ( "public:" ) ;
487
- PushIndent ( ) ;
487
+ Indent ( ) ;
488
488
489
489
WriteLine ( "event {0} {1}" , @event . Type , @event . Name ) ;
490
- WriteStartBraceIndent ( ) ;
490
+ WriteOpenBraceAndIndent ( ) ;
491
491
492
492
WriteLine ( "void add({0} evt);" , @event . Type ) ;
493
493
WriteLine ( "void remove({0} evt);" , @event . Type ) ;
@@ -496,8 +496,8 @@ public void GenerateClassEvents(Class @class)
496
496
var cliArgs = cliTypePrinter . VisitParameters ( @event . Parameters , hasNames : true ) ;
497
497
498
498
WriteLine ( "void raise({0});" , cliArgs ) ;
499
- WriteCloseBraceIndent ( ) ;
500
- PopIndent ( ) ;
499
+ UnindentAndWriteCloseBrace ( ) ;
500
+ Unindent ( ) ;
501
501
}
502
502
}
503
503
@@ -506,7 +506,7 @@ public void GenerateClassMethods(List<Method> methods)
506
506
if ( methods . Count == 0 )
507
507
return ;
508
508
509
- PushIndent ( ) ;
509
+ Indent ( ) ;
510
510
511
511
var @class = ( Class ) methods [ 0 ] . Namespace ;
512
512
@@ -535,12 +535,12 @@ public void GenerateClassMethods(List<Method> methods)
535
535
foreach ( var method in staticMethods )
536
536
GenerateMethod ( method ) ;
537
537
538
- PopIndent ( ) ;
538
+ Unindent ( ) ;
539
539
}
540
540
541
541
public void GenerateClassVariables ( Class @class )
542
542
{
543
- PushIndent ( ) ;
543
+ Indent ( ) ;
544
544
545
545
foreach ( var variable in @class . Variables )
546
546
{
@@ -555,7 +555,7 @@ public void GenerateClassVariables(Class @class)
555
555
556
556
WriteLine ( "static property {0} {1}" , type , variable . Name ) ;
557
557
558
- WriteStartBraceIndent ( ) ;
558
+ WriteOpenBraceAndIndent ( ) ;
559
559
560
560
WriteLine ( "{0} get();" , type ) ;
561
561
@@ -564,12 +564,12 @@ public void GenerateClassVariables(Class @class)
564
564
if ( ! qualifiedType . Qualifiers . IsConst )
565
565
WriteLine ( "void set({0});" , type ) ;
566
566
567
- WriteCloseBraceIndent ( ) ;
567
+ UnindentAndWriteCloseBrace ( ) ;
568
568
569
569
PopBlock ( NewLineKind . BeforeNextBlock ) ;
570
570
}
571
571
572
- PopIndent ( ) ;
572
+ Unindent ( ) ;
573
573
}
574
574
575
575
public override void GenerateClassSpecifier ( Class @class )
@@ -612,7 +612,7 @@ public void GenerateClassProperties(Class @class)
612
612
}
613
613
}
614
614
615
- PushIndent ( ) ;
615
+ Indent ( ) ;
616
616
foreach ( var prop in @class . Properties . Where (
617
617
prop => ! ASTUtils . CheckIgnoreProperty ( prop ) && ! TypeIgnored ( prop . Type ) ) )
618
618
{
@@ -625,7 +625,7 @@ public void GenerateClassProperties(Class @class)
625
625
GenerateDeclarationCommon ( prop ) ;
626
626
GenerateProperty ( prop ) ;
627
627
}
628
- PopIndent ( ) ;
628
+ Unindent ( ) ;
629
629
}
630
630
631
631
public void GenerateIndexer ( Property property )
@@ -636,15 +636,15 @@ public void GenerateIndexer(Property property)
636
636
var indexParameterType = indexParameter . QualifiedType . Visit ( TypePrinter ) ;
637
637
638
638
WriteLine ( "property {0} default[{1}]" , type , indexParameterType ) ;
639
- WriteStartBraceIndent ( ) ;
639
+ WriteOpenBraceAndIndent ( ) ;
640
640
641
641
if ( property . HasGetter )
642
642
WriteLine ( "{0} get({1} {2});" , type , indexParameterType , indexParameter . Name ) ;
643
643
644
644
if ( property . HasSetter )
645
645
WriteLine ( "void set({1} {2}, {0} value);" , type , indexParameterType , indexParameter . Name ) ;
646
646
647
- WriteCloseBraceIndent ( ) ;
647
+ UnindentAndWriteCloseBrace ( ) ;
648
648
}
649
649
650
650
public void GenerateProperty ( Property property )
@@ -665,15 +665,15 @@ public void GenerateProperty(Property property)
665
665
else
666
666
{
667
667
WriteLine ( "property {0} {1}" , type , property . Name ) ;
668
- WriteStartBraceIndent ( ) ;
668
+ WriteOpenBraceAndIndent ( ) ;
669
669
670
670
if ( property . HasGetter )
671
671
WriteLine ( "{0} get();" , type ) ;
672
672
673
673
if ( property . HasSetter )
674
674
WriteLine ( "void set({0});" , type ) ;
675
675
676
- WriteCloseBraceIndent ( ) ;
676
+ UnindentAndWriteCloseBrace ( ) ;
677
677
}
678
678
679
679
PopBlock ( NewLineKind . BeforeNextBlock ) ;
@@ -835,11 +835,11 @@ public void GenerateEnum(Enumeration @enum)
835
835
Write ( " : {0}" , typeName ) ;
836
836
837
837
NewLine ( ) ;
838
- WriteStartBraceIndent ( ) ;
838
+ WriteOpenBraceAndIndent ( ) ;
839
839
840
840
GenerateEnumItems ( @enum ) ;
841
841
842
- PopIndent ( ) ;
842
+ Unindent ( ) ;
843
843
WriteLine ( "};" ) ;
844
844
845
845
PopBlock ( NewLineKind . BeforeNextBlock ) ;
0 commit comments