Class CppUtil

java.lang.Object
uk.co.real_logic.sbe.generation.cpp.CppUtil

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

    • CppUtil

      public CppUtil()
  • Method Details

    • cppTypeName

      public static String cppTypeName(PrimitiveType primitiveType)
      Map the name of a PrimitiveType to a C++98 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.
    • formatForCppKeyword

      public static String formatForCppKeyword(String value)
      Format a String with a suffix in case it's a keyword.
      Parameters:
      value - to be formatted.
      Returns:
      the formatted string.
    • formatClassName

      public static String formatClassName(String value)
      Format a String as a class name.
      Parameters:
      value - to be formatted.
      Returns:
      the string formatted as a class name.
    • formatByteOrderEncoding

      public static String formatByteOrderEncoding(ByteOrder byteOrder, PrimitiveType primitiveType)
      Return the Cpp98 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
    • closingBraces

      public static String closingBraces(int count)
      Generate a count of closing braces, one on each line.
      Parameters:
      count - of closing braces.
      Returns:
      A string with count of closing braces.