[lldb/StringPrinter] Convert DecodedCharBuffer to a class, NFC
authorVedant Kumar <vsk@apple.com>
Wed, 3 Jun 2020 18:51:22 +0000 (11:51 -0700)
committerVedant Kumar <vsk@apple.com>
Wed, 3 Jun 2020 19:24:23 +0000 (12:24 -0700)
The m_size and m_data members of DecodedCharBuffer are meant to be
private.

lldb/source/DataFormatters/StringPrinter.cpp

index 53dbc8d..7f7d6c1 100644 (file)
@@ -30,9 +30,7 @@ using StringElementType = StringPrinter::StringElementType;
 /// DecodedCharBuffer stores the decoded contents of a single character. It
 /// avoids managing memory on the heap by copying decoded bytes into an in-line
 /// buffer.
-struct DecodedCharBuffer {
-  static constexpr unsigned MaxLength = 16;
-
+class DecodedCharBuffer {
 public:
   DecodedCharBuffer(std::nullptr_t) {}
 
@@ -50,6 +48,8 @@ public:
   size_t GetSize() const { return m_size; }
 
 private:
+  static constexpr unsigned MaxLength = 16;
+
   size_t m_size = 0;
   uint8_t m_data[MaxLength] = {0};
 };