Skip to content

Commit

Permalink
Small additions to PaddedStringTable
Browse files Browse the repository at this point in the history
  • Loading branch information
julianstorer committed Apr 15, 2020
1 parent f07673f commit 30d0bc7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/modules/soul_core/utilities/soul_StringUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ void PaddedStringTable::appendItem (std::string item)
rows.back().push_back (std::move (item));
}

size_t PaddedStringTable::getNumRows() const { return rows.size(); }
size_t PaddedStringTable::getNumColumns (size_t row) const { return rows[row].size(); }
size_t PaddedStringTable::getNumRows() const { return rows.size(); }

std::string PaddedStringTable::getRow (size_t rowIndex) const
{
Expand All @@ -461,6 +462,11 @@ std::string PaddedStringTable::getRow (size_t rowIndex) const
return s;
}

std::string& PaddedStringTable::getCell (size_t row, size_t column)
{
return rows[row][column];
}

HashBuilder& HashBuilder::operator<< (char c) noexcept
{
auto n = (uint8_t) c;
Expand Down
2 changes: 2 additions & 0 deletions source/modules/soul_core/utilities/soul_StringUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ struct PaddedStringTable
void startRow();
void appendItem (std::string item);
size_t getNumRows() const;
size_t getNumColumns (size_t row) const;
std::string getRow (size_t rowIndex) const;
std::string& getCell (size_t row, size_t column);

template <typename RowHandlerFn>
void iterateRows (RowHandlerFn&& handleRow)
Expand Down

0 comments on commit 30d0bc7

Please sign in to comment.