fgerlits commented on code in PR #1483:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1483#discussion_r1101493234


##########
minifi_main/TableFormatter.h:
##########
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "core/PropertyValue.h"
+
+namespace org::apache::nifi::minifi::docs {
+
+class Table {
+ public:
+  explicit Table(std::vector<std::string> header) : header_{std::move(header)} 
{}
+  void addRow(std::vector<std::string> row);
+  [[nodiscard]] std::string toString() const;
+
+ private:
+  [[nodiscard]] std::vector<size_t> find_widths() const;
+
+  std::vector<std::string> header_;
+  std::vector<std::vector<std::string>> rows_;
+};
+
+std::string formatName(const std::string& name, bool is_required);
+std::string formatAllowableValues(const 
std::vector<org::apache::nifi::minifi::core::PropertyValue>& values);
+std::string formatDescription(std::string description, bool 
supports_expression_language = false);
+std::string formatSeparator(const std::vector<size_t>& widths);
+std::string formatRow(const std::vector<std::string>& items, const 
std::vector<size_t>& widths);

Review Comment:
   fixed in 4a69170c4b1a1a7bb67d9348075d5828c88ac9af
   
   I have only tested the `Table` class and not the free helper functions, 
because I am going to remove or hide those in the follow-up PR #1492.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to