Class CUtil

java.lang.Object
uk.co.real_logic.sbe.generation.c.CUtil

public class CUtil extends Object
Utilities for mapping between IR and the C language.
  • Constructor Details

    • CUtil

      public CUtil()
  • Method Details

    • cTypeName

      public static String cTypeName(PrimitiveType primitiveType)
      Map the name of a PrimitiveType to a C11 primitive type name.
      Parameters:
      primitiveType - to map.
      Returns:
      the name of the Java primitive that most closely maps.
    • formatPropertyName

      public static String formatPropertyName(String value)
      Format a String as a property name.
      Parameters:
      value - to be formatted.
      Returns:
      the string formatted as a property name.
    • formatName

      public static String formatName(String value)
      Format a String as a struct name.
      Parameters:
      value - to be formatted.
      Returns:
      the string formatted as a struct name.
    • formatScopedName

      public static String formatScopedName(CharSequence[] scope, String value)
      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

      public static String formatByteOrderEncoding(ByteOrder byteOrder, PrimitiveType primitiveType)
      Return the C99 formatted byte order encoding string to use for a given byte order and primitiveType
      Parameters:
      byteOrder - of the Token
      primitiveType - of the Token
      Returns:
      the string formatted as the byte ordering encoding