Utilities functions used in ezrSquared.
More...
|
static long | GetNextUniqueId () |
| Generates an incremental unique identifier.
|
|
static int | IndexToFlag (int index) |
| Converts an index to a power of two, so that the index can be used like an enum flag.
|
|
static int string SourceWithUnderline | SourceWithUnderline (Position startPosition, Position endPosition) |
|
static string | PascalToSnakeCase (string text) |
| Converts a string from PascalCase to snake_case.
|
|
|
static int | AdjustedLineNumber |
| Creates formatted text which contains the text between startPosition and endPosition , underlined with tilde (~) symbols.
|
|
|
static long | s_currentId = 0 |
| long value for the last generated unique identifier.
|
|
Utilities functions used in ezrSquared.
◆ GetNextUniqueId()
static long EzrSquared.Util.Utils.GetNextUniqueId |
( |
| ) |
|
|
static |
Generates an incremental unique identifier.
- Returns
- A new unique identifier.
◆ IndexToFlag()
static int EzrSquared.Util.Utils.IndexToFlag |
( |
int | index | ) |
|
|
static |
Converts an index to a power of two, so that the index can be used like an enum flag.
This function is used to check if all arguments have been provided to Runtime.Types.CSharpWrappers.SourceWrappers.EzrSharpSourceExecutableWrapper and Runtime.Types.EzrRuntimeExecutable types.
The indices of the given arguments are converted to powers of two and bitwise-ored together, then bitwise-anded with the index of a defined parameter which is also converted to a power of two.
Finally, if the result is the same as the power of two of the parameter's index, this tells the interpreter that the particular required parameter has been provided.
- Parameters
-
index | The index to be converted. |
- Returns
- The power of two.
◆ PascalToSnakeCase()
static string EzrSquared.Util.Utils.PascalToSnakeCase |
( |
string | text | ) |
|
|
static |
Converts a string from PascalCase to snake_case.
- Parameters
-
text | The text to convert in PascalCase. |
- Returns
- The converted text in snake_case.
◆ AdjustedLineNumber
int EzrSquared.Util.Utils.AdjustedLineNumber |
|
static |
Creates formatted text which contains the text between startPosition and endPosition , underlined with tilde (~) symbols.
- Returns
- The formatted text.
The documentation for this class was generated from the following file:
- D:/Code/csharp/ezrSquared/src/Util/Utils.cs