MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / delRows

Method delRows

src/csvtable.cpp:197–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195
196
197void CsvTable::delRows(table_index_t rowFrom, table_index_t rowTo, bool clearFlags, bool doUpdateInternals ) {
198 table_index_t numToDel = rowTo - rowFrom + 1;
199 if( numToDel >= storage.rows() ) // don't delete, if all rows are to be deleted
200 return;
201 if( rowFrom < 0 || rowTo < 0 || rowFrom >= storage.rows() || rowTo >= storage.rows() ) // don't delete if row range is not valid
202 return;
203
204 storage.deleteRows(rowFrom, rowTo);
205
206 // erase flags from rows that are deleted
207 if( clearFlags ) {
208 for( table_index_t r = rowFrom; r <= rowTo; ++r ) {
209 if( flags.find(r) != flags.end() ) {
210 flags.erase(r);
211 }
212 }
213 moveFlags(rowFrom, -numToDel);
214 }
215 if( doUpdateInternals ) {
216 updateInternals();
217 }
218}
219
220
221void CsvTable::delCols(table_index_t colFrom, table_index_t colTo) {

Callers 1

MyMenuCallbackMethod · 0.45

Calls 4

rowsMethod · 0.80
deleteRowsMethod · 0.80
findMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected