-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rgen] Allow the transformer to use the tabbed string builder. (#22020)
- Loading branch information
1 parent
3a0fb1a
commit 1480b5d
Showing
3 changed files
with
26 additions
and
19 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/rgen/Microsoft.Macios.Generator/TabbedStringBuilder.Generator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Microsoft.Macios.Generator.Attributes; | ||
using ObjCRuntime; | ||
|
||
namespace Microsoft.Macios.Generator; | ||
|
||
partial class TabbedStringBuilder { | ||
|
||
public TabbedStringBuilder AppendExportData<T> (in ExportData<T> exportData) where T : Enum | ||
{ | ||
// Try to write the smaller amount of data. We are using the old ExportAttribute until we make the final move | ||
if (exportData.ArgumentSemantic != ArgumentSemantic.None) { | ||
AppendLine ($"[Export (\"{exportData.Selector}\", ArgumentSemantic.{exportData.ArgumentSemantic})]"); | ||
} else { | ||
AppendLine ($"[Export (\"{exportData.Selector}\")]"); | ||
} | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters