| 1017 | */ |
| 1018 | template<typename T> |
| 1019 | void SetRow(const size_t pRowIdx, const std::vector<T>& pRow) |
| 1020 | { |
| 1021 | const size_t dataRowIdx = GetDataRowIndex(pRowIdx); |
| 1022 | |
| 1023 | while ((dataRowIdx + 1) > GetDataRowCount()) |
| 1024 | { |
| 1025 | std::vector<std::string> row; |
| 1026 | row.resize(GetDataColumnCount()); |
| 1027 | mData.push_back(row); |
| 1028 | } |
| 1029 | |
| 1030 | if (pRow.size() > GetDataColumnCount()) |
| 1031 | { |
| 1032 | for (auto itRow = mData.begin(); itRow != mData.end(); ++itRow) |
| 1033 | { |
| 1034 | if (std::distance(mData.begin(), itRow) >= mLabelParams.mColumnNameIdx) |
| 1035 | { |
| 1036 | itRow->resize(GetDataColumnIndex(pRow.size())); |
| 1037 | } |
| 1038 | } |
| 1039 | } |
| 1040 | |
| 1041 | Converter<T> converter(mConverterParams); |
| 1042 | for (auto itCol = pRow.begin(); itCol != pRow.end(); ++itCol) |
| 1043 | { |
| 1044 | std::string str; |
| 1045 | converter.ToStr(*itCol, str); |
| 1046 | mData.at(dataRowIdx).at(static_cast<size_t>(std::distance(pRow.begin(), |
| 1047 | itCol) + mLabelParams.mRowNameIdx + 1)) = str; |
| 1048 | } |
| 1049 | } |
| 1050 | |
| 1051 | /** |
| 1052 | * @brief Set row by name. |
no test coverage detected