Beispiel #1
0
void TruncCommand :: ProcessRow( CSVRow & row, unsigned int ncols,
									const ALib::CommaList &  ) {
	if ( ncols < row.size() ) {
		CSVRow nrow( ncols );
		std::copy( row.begin(), row.begin() + ncols, nrow.begin() );
		row.swap( nrow );
	}
}
Beispiel #2
0
void ExcludeCommand :: Exclude(  CSVRow & r ) const {

	CSVRow out;

	if ( mReverse ) {
		std::reverse( r.begin(), r.end() );
	}

	for ( unsigned int i = 0; i < r.size(); i++ ) {
		if ( ! ALib::Contains( mFields, i ) ) {
			out.push_back( r.at( i ) );
		}
	}

	if ( mReverse ) {
		std::reverse( out.begin(), out.end() );
	}

	r.swap( out );
}