Class CppUtil
java.lang.Object
uk.co.real_logic.sbe.generation.cpp.CppUtil
Utilities for mapping between IR and the C++ language.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringclosingBraces(int count) Generate a count of closing braces, one on each line.static StringcppTypeName(PrimitiveType primitiveType) Map the name of aPrimitiveTypeto a C++98 primitive type name.static StringformatByteOrderEncoding(ByteOrder byteOrder, PrimitiveType primitiveType) Return the Cpp98 formatted byte order encoding string to use for a given byte order and primitiveTypestatic StringformatClassName(String value) Format a String as a class name.static StringformatForCppKeyword(String value) Format a String with a suffix in case it's a keyword.static StringformatPropertyName(String value) Format a String as a property name.
-
Constructor Details
-
CppUtil
public CppUtil()
-
-
Method Details
-
cppTypeName
Map the name of aPrimitiveTypeto a C++98 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.
-
formatForCppKeyword
Format a String with a suffix in case it's a keyword.- Parameters:
value- to be formatted.- Returns:
- the formatted string.
-
formatClassName
Format a String as a class name.- Parameters:
value- to be formatted.- Returns:
- the string formatted as a class name.
-
formatByteOrderEncoding
Return the Cpp98 formatted byte order encoding string to use for a given byte order and primitiveType -
closingBraces
Generate a count of closing braces, one on each line.- Parameters:
count- of closing braces.- Returns:
- A string with count of closing braces.
-