@@ -296,6 +296,7 @@ private static void generateGroupClassHeader(
296
296
indent + " return *m_positionPtr;\n " +
297
297
indent + " }\n \n " +
298
298
299
+ indent + " // NOLINTNEXTLINE(readability-convert-member-functions-to-static)\n " +
299
300
indent + " std::uint64_t sbeCheckPosition(const std::uint64_t position)\n " +
300
301
indent + " {\n " +
301
302
indent + " if (SBE_BOUNDS_CHECK_EXPECT((position > m_bufferLength), false))\n " +
@@ -668,7 +669,7 @@ private void generateVarDataDescriptors(
668
669
sizeOfLengthField );
669
670
670
671
new Formatter (sb ).format ("\n " +
671
- indent + " %4$s %1$sLength() const\n " +
672
+ indent + " SBE_NODISCARD %4$s %1$sLength() const\n " +
672
673
indent + " {\n " +
673
674
"%2$s" +
674
675
indent + " %4$s length;\n " +
@@ -1524,7 +1525,7 @@ private void generateArrayProperty(
1524
1525
if (encodingToken .encoding ().primitiveType () == PrimitiveType .CHAR )
1525
1526
{
1526
1527
new Formatter (sb ).format ("\n " +
1527
- indent + " std::string get%1$sAsString() const\n " +
1528
+ indent + " SBE_NODISCARD std::string get%1$sAsString() const\n " +
1528
1529
indent + " {\n " +
1529
1530
indent + " const char *buffer = m_buffer + m_offset + %2$d;\n " +
1530
1531
indent + " size_t length = 0;\n \n " +
@@ -1542,7 +1543,7 @@ private void generateArrayProperty(
1542
1543
1543
1544
new Formatter (sb ).format ("\n " +
1544
1545
indent + " #if __cplusplus >= 201703L\n " +
1545
- indent + " std::string_view get%1$sAsStringView() const SBE_NOEXCEPT\n " +
1546
+ indent + " SBE_NODISCARD std::string_view get%1$sAsStringView() const SBE_NOEXCEPT\n " +
1546
1547
indent + " {\n " +
1547
1548
indent + " const char *buffer = m_buffer + m_offset + %2$d;\n " +
1548
1549
indent + " size_t length = 0;\n \n " +
@@ -1609,9 +1610,9 @@ private void generateJsonEscapedStringGetter(
1609
1610
"%2$s" +
1610
1611
indent + " std::ostringstream oss;\n " +
1611
1612
indent + " std::string s = get%1$sAsString();\n \n " +
1612
- indent + " for (auto c = s.cbegin(); c != s.cend(); c++ )\n " +
1613
+ indent + " for (const auto c : s )\n " +
1613
1614
indent + " {\n " +
1614
- indent + " switch (* c)\n " +
1615
+ indent + " switch (c)\n " +
1615
1616
indent + " {\n " +
1616
1617
indent + " case '\" ': oss << \" \\ \\ \\ \" \" ; break;\n " +
1617
1618
indent + " case '\\ \\ ': oss << \" \\ \\ \\ \\ \" ; break;\n " +
@@ -1621,14 +1622,14 @@ private void generateJsonEscapedStringGetter(
1621
1622
indent + " case '\\ r': oss << \" \\ \\ r\" ; break;\n " +
1622
1623
indent + " case '\\ t': oss << \" \\ \\ t\" ; break;\n \n " +
1623
1624
indent + " default:\n " +
1624
- indent + " if ('\\ x00' <= * c && * c <= '\\ x1f')\n " +
1625
+ indent + " if ('\\ x00' <= c && c <= '\\ x1f')\n " +
1625
1626
indent + " {\n " +
1626
1627
indent + " oss << \" \\ \\ u\" " + " << std::hex << std::setw(4)\n " +
1627
- indent + " << std::setfill('0') << (int)(* c);\n " +
1628
+ indent + " << std::setfill('0') << (int)(c);\n " +
1628
1629
indent + " }\n " +
1629
1630
indent + " else\n " +
1630
1631
indent + " {\n " +
1631
- indent + " oss << * c;\n " +
1632
+ indent + " oss << c;\n " +
1632
1633
indent + " }\n " +
1633
1634
indent + " }\n " +
1634
1635
indent + " }\n \n " +
@@ -1988,6 +1989,7 @@ private CharSequence generateMessageFlyweightCode(final String className, final
1988
1989
" return m_position;\n " +
1989
1990
" }\n \n " +
1990
1991
1992
+ " // NOLINTNEXTLINE(readability-convert-member-functions-to-static)\n " +
1991
1993
" std::uint64_t sbeCheckPosition(const std::uint64_t position)\n " +
1992
1994
" {\n " +
1993
1995
" if (SBE_BOUNDS_CHECK_EXPECT((position > m_bufferLength), false))\n " +
0 commit comments