本文整理汇总了C++中CSVRow::at方法的典型用法代码示例。如果您正苦于以下问题:C++ CSVRow::at方法的具体用法?C++ CSVRow::at怎么用?C++ CSVRow::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSVRow
的用法示例。
在下文中一共展示了CSVRow::at方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddVars
void AddVars( ALib::Expression & e, const IOManager & io, const CSVRow & row ) {
e.ClearPosParams();
e.AddVar( LINE_VAR, ALib::Str( io.CurrentLine() ));
e.AddVar( FILE_VAR, ALib::Str( io.CurrentFileName()));
e.AddVar( FIELD_VAR, ALib::Str( row.size()));
for ( unsigned int j = 0; j < row.size(); j++ ) {
e.AddPosParam( row.at( j ) );
}
}
示例2: Chop
void TrimCommand :: Chop( CSVRow & row, unsigned int i ) {
if ( mFields.size() == 0 ) {
if ( i < mWidths.size() && i < row.size() ) {
if ( mWidths.at(i) >= 0 ) {
row.at(i) = row.at(i).substr( 0, mWidths.at(i) );
}
}
}
else {
int idx = ALib::IndexOf( mFields, i );
if ( idx >= 0 ) {
if ( idx < (int) mWidths.size() && i < row.size() ) {
if ( mWidths.at(idx) >= 0 ) {
row.at(i) = row.at(i).substr( 0, mWidths.at(idx) );
}
}
}
}
}
示例3: SumRow
static void SumRow( vector <double> & sums, const CSVRow & row,
const FieldList & fl ) {
for ( unsigned int i = 0; i < fl.size(); i++ ) {
unsigned int fi = fl.at(i);
if ( fi >= row.size() ) {
CSVTHROW( "Invalid field index" );
}
sums.at(i) += ALib::ToReal( row.at(fi) );
}
}
示例4: MakeKey
string SummaryCommand :: MakeKey( const CSVRow & row ) const {
string key;
for ( unsigned int i = 0; i < mFields.size(); i++ ) {
if ( mFields.at(i) >= row.size() ) {
key += "";
}
else {
key += row.at( mFields.at(i) );
}
key += '\0';
}
return key;
}
示例5: Exclude
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 );
}