-
Notifications
You must be signed in to change notification settings - Fork 2
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 #25 from penev92/enumSupport
Add support for enum-type field values
- Loading branch information
Showing
11 changed files
with
314 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace Oraide.Core.Entities.Csharp | ||
{ | ||
/// <summary> | ||
/// Represents information about an enum type. | ||
/// </summary> | ||
public readonly struct EnumInfo | ||
{ | ||
public readonly string Name; | ||
|
||
public readonly string FullName; | ||
|
||
public readonly string Description; | ||
|
||
public readonly string[] Values; | ||
|
||
public readonly bool IsFlagsEnum; | ||
|
||
public readonly MemberLocation Location; | ||
|
||
public EnumInfo(string name, string fullName, string description, string[] values, bool isFlagsEnum, MemberLocation location) | ||
{ | ||
Name = name; | ||
FullName = fullName; | ||
Description = description; | ||
Values = values; | ||
IsFlagsEnum = isFlagsEnum; | ||
Location = location; | ||
} | ||
|
||
public override string ToString() => FullName; | ||
|
||
public string ToMarkdownInfoString() => "```csharp\n" + | ||
$"enum {Name}" + (IsFlagsEnum ? " (flags)" : "") + | ||
$"\n```\n" + | ||
$"{Description}"; | ||
} | ||
} |
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
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
Oops, something went wrong.