-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from BastianBlokland/feature/bracket-mode
Same line curly-brackets.
- Loading branch information
Showing
9 changed files
with
182 additions
and
27 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace EnumGenerator.Core.Exporter | ||
{ | ||
/// <summary> | ||
/// Mode to use when writing curly brackets. | ||
/// </summary> | ||
public enum CurlyBracketMode | ||
{ | ||
/// <summary> | ||
/// Opening curly-brackets should be placed on a new line. | ||
/// </summary> | ||
NewLine = 0, | ||
|
||
/// <summary> | ||
/// Opening curly-brackets should be placed on the same line. | ||
/// </summary> | ||
SameLine = 1 | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
src/EnumGenerator.Core/Utilities/StringBuilderExtensions.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,27 @@ | ||
using System; | ||
using System.Text; | ||
|
||
namespace EnumGenerator.Core.Utilities | ||
{ | ||
/// <summary> | ||
/// Utility extensions for <see cref="StringBuilder"/>. | ||
/// </summary> | ||
public static class StringBuilderExtensions | ||
{ | ||
/// <summary> | ||
/// Check if given <see cref="StringBuilder"/> ends with given text. | ||
/// </summary> | ||
/// <param name="stringBuilder">Builder to check</param> | ||
/// <param name="text">Text to check for</param> | ||
/// <returns>'True' if builder ends with given text, otherwise 'False'.</returns> | ||
public static bool EndsWith(this StringBuilder stringBuilder, string text) | ||
{ | ||
var length = text.Length; | ||
if (stringBuilder.Length < length) | ||
return false; | ||
|
||
var end = stringBuilder.ToString(stringBuilder.Length - length, length); | ||
return end.Equals(text, StringComparison.OrdinalIgnoreCase); | ||
} | ||
} | ||
} |
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