This is an automated email from the ASF dual-hosted git repository.

brycemecum pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new db83c8ef19 GH-45541: [Doc][C++] Render ASCII art as-is (#45542)
db83c8ef19 is described below

commit db83c8ef19f444b1765a61c4114d6abd22b87d93
Author: Hiroyuki Sato <[email protected]>
AuthorDate: Mon Feb 17 03:56:05 2025 +0900

    GH-45541: [Doc][C++] Render ASCII art as-is (#45542)
    
    ### Rationale for this change
    
    [union 
c_type]https://arrow.apache.org/docs/cpp/api/datatype.html#_CPPv4N5arrow14BinaryViewType6c_typeE
 in the BinaryViewType class describes data layout using ASCII art. It rendered 
a non-readable layout.
    
    ```
    - Entirely inlined string data |-&#8212;|———–&#8212;| ^ ^ | | size in-line 
string data, zero padded
    
    - Reference into a buffer |-&#8212;|-&#8212;|-&#8212;|-&#8212;| ^ ^ ^ ^ | | 
| | size | | `—&#8212;. prefix | | buffer index | offset in buffer
    ```
    
    It would be better render ascii as is.
    
    ```
     - Entirely inlined string data
    
      |----|--------------|
       ^    ^
       |    |
    size    in-line string data, zero padded
    
    - Reference into a buffer
    
      |----|----|----|----|
       ^    ^    ^    ^
       |    |    |    |
    size    |    |    `------.
        prefix   |           |
              buffer index   |
                        offset in buffer
    ```
    
    ### What changes are included in this PR?
    
    Render the ASCII part as-is.
    
    ### Are these changes tested?
    
    No.
    
    ### Are there any user-facing changes?
    
    No.
    * GitHub Issue: #45541
    
    Authored-by: Hiroyuki Sato <[email protected]>
    Signed-off-by: Bryce Mecum <[email protected]>
---
 cpp/src/arrow/type.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cpp/src/arrow/type.h b/cpp/src/arrow/type.h
index 53207bb9da..6b4f2c9f37 100644
--- a/cpp/src/arrow/type.h
+++ b/cpp/src/arrow/type.h
@@ -800,12 +800,15 @@ class ARROW_EXPORT BinaryViewType : public DataType {
   /// This union supports two states:
   ///
   /// - Entirely inlined string data
+  /// \code{.unparsed}
   ///                |----|--------------|
   ///                 ^    ^
   ///                 |    |
   ///              size    in-line string data, zero padded
+  /// \endcode
   ///
   /// - Reference into a buffer
+  /// \code{.unparsed}
   ///                |----|----|----|----|
   ///                 ^    ^    ^    ^
   ///                 |    |    |    |
@@ -813,6 +816,7 @@ class ARROW_EXPORT BinaryViewType : public DataType {
   ///                  prefix   |           |
   ///                        buffer index   |
   ///                                  offset in buffer
+  /// \endcode
   ///
   /// Adapted from TU Munich's UmbraDB [1], Velox, DuckDB.
   ///

Reply via email to