Class CSharpUtil
java.lang.Object
uk.co.real_logic.sbe.generation.csharp.CSharpUtil
Utilities for mapping between IR and the C# language.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappend(StringBuilder builder, String indent, String line) Shortcut to append a line of generated codestatic StringformatClassName(String str) Format a String as a class name.static StringformatForCSharpKeyword(String value) Format a String with a suffix in case it's a keyword.static StringformatGetterName(String propertyName) Format a Getter name for generated code.static StringformatPropertyName(String str) Format a String as a property name.static StringformatVariableName(String str) Format a String as a variable name.static StringtoLowerFirstChar(String str) Lowercase the first character of a given String.static StringtoUpperFirstChar(String str) Uppercase the first character of a given String.
-
Constructor Details
-
CSharpUtil
public CSharpUtil()
-
-
Method Details
-
toUpperFirstChar
Uppercase the first character of a given String.- Parameters:
str- to have the first character upper-cased.- Returns:
- a new String with the first character in uppercase.
-
toLowerFirstChar
Lowercase the first character of a given String.- Parameters:
str- to have the first character upper-cased.- Returns:
- a new String with the first character in uppercase.
-
formatPropertyName
Format a String as a property name.- Parameters:
str- to be formatted.- Returns:
- the string formatted as a property name.
-
formatForCSharpKeyword
Format a String with a suffix in case it's a keyword.- Parameters:
value- to be formatted.- Returns:
- the formatted string.
-
formatVariableName
Format a String as a variable name.- Parameters:
str- to be formatted.- Returns:
- the string formatted as a property name.
-
formatClassName
Format a String as a class name.- Parameters:
str- to be formatted.- Returns:
- the string formatted as a class name.
-
formatGetterName
Format a Getter name for generated code.- Parameters:
propertyName- to be formatted.- Returns:
- the property name formatted as a getter name.
-
append
Shortcut to append a line of generated code- Parameters:
builder- string builder to which to append the lineindent- current text indentationline- line to be appended
-