Skip to content

Commit 30d0bc7

Browse files
committed
Small additions to PaddedStringTable
1 parent f07673f commit 30d0bc7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

source/modules/soul_core/utilities/soul_StringUtilities.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ void PaddedStringTable::appendItem (std::string item)
443443
rows.back().push_back (std::move (item));
444444
}
445445

446-
size_t PaddedStringTable::getNumRows() const { return rows.size(); }
446+
size_t PaddedStringTable::getNumColumns (size_t row) const { return rows[row].size(); }
447+
size_t PaddedStringTable::getNumRows() const { return rows.size(); }
447448

448449
std::string PaddedStringTable::getRow (size_t rowIndex) const
449450
{
@@ -461,6 +462,11 @@ std::string PaddedStringTable::getRow (size_t rowIndex) const
461462
return s;
462463
}
463464

465+
std::string& PaddedStringTable::getCell (size_t row, size_t column)
466+
{
467+
return rows[row][column];
468+
}
469+
464470
HashBuilder& HashBuilder::operator<< (char c) noexcept
465471
{
466472
auto n = (uint8_t) c;

source/modules/soul_core/utilities/soul_StringUtilities.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ struct PaddedStringTable
149149
void startRow();
150150
void appendItem (std::string item);
151151
size_t getNumRows() const;
152+
size_t getNumColumns (size_t row) const;
152153
std::string getRow (size_t rowIndex) const;
154+
std::string& getCell (size_t row, size_t column);
153155

154156
template <typename RowHandlerFn>
155157
void iterateRows (RowHandlerFn&& handleRow)

0 commit comments

Comments
 (0)