From d4a77e8a1a9bcb778c01738b0dce640ff7d4e8a5 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 6 Sep 2017 19:40:24 -0700 Subject: lshal: remove ListCommand addLine Remove obnoxious addLine(...) in ListCommand.cpp by moving the feature of selecting columns into the "Table" class. Test: lshal Test: lshal -m Test: lshal -d (shows debug info for context hub) Test: lshal_test Bug: 35389839 Change-Id: Ieb4a6e544ef39c9f1a63b046a44b6a8e1416ea62 --- cmds/lshal/TextTable.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmds/lshal/TextTable.cpp') diff --git a/cmds/lshal/TextTable.cpp b/cmds/lshal/TextTable.cpp index a35917c1e6..eca9061034 100644 --- a/cmds/lshal/TextTable.cpp +++ b/cmds/lshal/TextTable.cpp @@ -53,5 +53,15 @@ void TextTable::dump(std::ostream& out) const { } } +void TextTable::addAll(TextTable&& other) { + for (auto&& row : other.mTable) { + if (row.isRow()) { + computeWidth(row.fields()); + } + + mTable.emplace_back(std::move(row)); + } +} + } // namespace lshal } // namespace android -- cgit v1.2.3-59-g8ed1b