Class CUtil
java.lang.Object
uk.co.real_logic.sbe.generation.c.CUtil
Utilities for mapping between IR and the C language.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcTypeName(PrimitiveType primitiveType) Map the name of aPrimitiveTypeto a C11 primitive type name.static StringformatByteOrderEncoding(ByteOrder byteOrder, PrimitiveType primitiveType) Return the C99 formatted byte order encoding string to use for a given byte order and primitiveTypestatic StringformatName(String value) Format a String as a struct name.static StringformatPropertyName(String value) Format a String as a property name.static StringformatScopedName(CharSequence[] scope, String value) Format a String as a struct name prepended with a scope.
-
Constructor Details
-
CUtil
public CUtil()
-
-
Method Details
-
cTypeName
Map the name of aPrimitiveTypeto a C11 primitive type name.- Parameters:
primitiveType- to map.- Returns:
- the name of the Java primitive that most closely maps.
-
formatPropertyName
Format a String as a property name.- Parameters:
value- to be formatted.- Returns:
- the string formatted as a property name.
-
formatName
Format a String as a struct name.- Parameters:
value- to be formatted.- Returns:
- the string formatted as a struct name.
-
formatScopedName
Format a String as a struct name prepended with a scope.- Parameters:
scope- to be prepended.value- to be formatted.- Returns:
- the string formatted as a struct name.
-
formatByteOrderEncoding
Return the C99 formatted byte order encoding string to use for a given byte order and primitiveType
-