@@ -212,7 +212,7 @@ private static void generateGroupClassHeader(
212212 indent + "public:\n " ,
213213 formatClassName (groupName ), dimensionsClassName ));
214214
215- sb .append (String .format (" \n " +
215+ sb .append (String .format (
216216 indent + " inline void wrapForDecode(char *buffer, std::uint64_t *pos," +
217217 " const std::uint64_t actingVersion, const std::uint64_t bufferLength)\n " +
218218 indent + " {\n " +
@@ -356,7 +356,7 @@ private static CharSequence generateGroupProperty(
356356 className ,
357357 propertyName ));
358358
359- sb .append (String .format (" \n " +
359+ sb .append (String .format (
360360 indent + " static SBE_CONSTEXPR std::uint16_t %1$sId() SBE_NOEXCEPT\n " +
361361 indent + " {\n " +
362362 indent + " return %2$d;\n " +
@@ -640,7 +640,7 @@ private void generateChoiceSet(final List<Token> tokens) throws IOException
640640 out .append (generateClassDeclaration (bitSetName ));
641641 out .append (generateFixedFlyweightCode (bitSetName , tokens .get (0 ).encodedLength ()));
642642
643- out .append (String .format (
643+ out .append (String .format (" \n " +
644644 " %1$s &clear()\n " +
645645 " {\n " +
646646 " %2$s zero = 0;\n " +
@@ -679,8 +679,8 @@ private void generateEnum(final List<Token> tokens) throws IOException
679679
680680 out .append (generateEnumLookupMethod (tokens .subList (1 , tokens .size () - 1 ), enumToken ));
681681
682- out .append ("};\n " );
683- out .append (CppUtil .closingBraces (ir .namespaces ().length )).append ("#endif\n " );
682+ out .append ("};\n \n " );
683+ out .append (CppUtil .closingBraces (ir .namespaces ().length )).append ("\n #endif\n " );
684684 }
685685 }
686686
@@ -698,8 +698,8 @@ private void generateComposite(final List<Token> tokens) throws IOException
698698 out .append (generateCompositePropertyElements (
699699 compositeName , tokens .subList (1 , tokens .size () - 1 ), BASE_INDENT ));
700700
701- out .append ("};\n " );
702- out .append (CppUtil .closingBraces (ir .namespaces ().length )).append ("#endif\n " );
701+ out .append ("};\n \n " );
702+ out .append (CppUtil .closingBraces (ir .namespaces ().length )).append ("\n #endif\n " );
703703 }
704704 }
705705
@@ -793,7 +793,7 @@ private CharSequence generateEnumValues(final List<Token> tokens, final Token en
793793 final Encoding encoding = encodingToken .encoding ();
794794
795795 sb .append (
796- " enum Value \n " +
796+ " enum Value\n " +
797797 " {\n " );
798798
799799 for (final Token token : tokens )
@@ -1040,7 +1040,7 @@ private static CharSequence generateClassDeclaration(final String className)
10401040
10411041 private static CharSequence generateEnumDeclaration (final String name )
10421042 {
1043- return "class " + name + "\n {\n public:\n \n " ;
1043+ return "class " + name + "\n {\n public:\n " ;
10441044 }
10451045
10461046 private CharSequence generateCompositePropertyElements (
@@ -1322,7 +1322,7 @@ private CharSequence generateArrayProperty(
13221322 indent );
13231323
13241324 sb .append (String .format ("\n " +
1325- indent + " %1$s %2$s(std::uint64_t index) const\n " +
1325+ indent + " %1$s %2$s(const std::uint64_t index) const\n " +
13261326 indent + " {\n " +
13271327 indent + " if (index >= %3$d)\n " +
13281328 indent + " {\n " +
@@ -1344,7 +1344,7 @@ private CharSequence generateArrayProperty(
13441344 indent );
13451345
13461346 sb .append (String .format ("\n " +
1347- indent + " %1$s %2$s(std::uint64_t index, %3$s value)\n " +
1347+ indent + " %1$s & %2$s(const std::uint64_t index, const %3$s value)\n " +
13481348 indent + " {\n " +
13491349 indent + " if (index >= %4$d)\n " +
13501350 indent + " {\n " +
@@ -1361,7 +1361,7 @@ private CharSequence generateArrayProperty(
13611361 storeValue ));
13621362
13631363 sb .append (String .format ("\n " +
1364- indent + " std::uint64_t get%1$s(char *dst, std::uint64_t length) const\n " +
1364+ indent + " std::uint64_t get%1$s(char *const dst, const std::uint64_t length) const\n " +
13651365 indent + " {\n " +
13661366 indent + " if (length > %2$d)\n " +
13671367 indent + " {\n " +
@@ -1379,7 +1379,7 @@ private CharSequence generateArrayProperty(
13791379 cppTypeName ));
13801380
13811381 sb .append (String .format ("\n " +
1382- indent + " %1$s &put%2$s(const char *src) SBE_NOEXCEPT\n " +
1382+ indent + " %1$s &put%2$s(const char *const src) SBE_NOEXCEPT\n " +
13831383 indent + " {\n " +
13841384 indent + " std::memcpy(m_buffer + m_offset + %3$d, src, sizeof(%4$s) * %5$d);\n " +
13851385 indent + " return *this;\n " +
@@ -1426,7 +1426,7 @@ private CharSequence generateArrayProperty(
14261426
14271427 sb .append (String .format ("\n " +
14281428 indent + " #if __cplusplus >= 201703L\n " +
1429- indent + " %1$s &put%2$s(std::string_view str)\n " +
1429+ indent + " %1$s &put%2$s(const std::string_view str)\n " +
14301430 indent + " {\n " +
14311431 indent + " const size_t srcLength = str.length();\n " +
14321432 indent + " if (srcLength > %4$d)\n " +
@@ -2085,7 +2085,7 @@ private static Object generateBitsetProperty(final String propertyName, final To
20852085 bitsetName ,
20862086 propertyName ));
20872087
2088- sb .append (String .format (" \n " +
2088+ sb .append (String .format (
20892089 indent + " %1$s &%2$s()\n " +
20902090 indent + " {\n " +
20912091 indent + " m_%2$s.wrap(m_buffer, m_offset + %3$d, m_actingVersion, m_bufferLength);\n " +
@@ -2121,7 +2121,7 @@ private static Object generateCompositeProperty(final String propertyName, final
21212121 compositeName ,
21222122 propertyName ));
21232123
2124- sb .append (String .format (" \n " +
2124+ sb .append (String .format (
21252125 indent + " %1$s &%2$s()\n " +
21262126 indent + " {\n " +
21272127 indent + " m_%2$s.wrap(m_buffer, m_offset + %3$d, m_actingVersion, m_bufferLength);\n " +
0 commit comments