本文整理汇总了C++中CSVRow::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ CSVRow::clear方法的具体用法?C++ CSVRow::clear怎么用?C++ CSVRow::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSVRow
的用法示例。
在下文中一共展示了CSVRow::clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: io
int EvalCommand :: Execute( ALib::CommandLine & cmd ) {
GetSkipOptions( cmd );
IOManager io( cmd );
CSVRow row;
mDiscardInput = cmd.HasFlag( FLAG_DISCARD );
GetExpressions( cmd );
while( io.ReadCSV( row ) ) {
if ( Skip( io, row ) ) {
continue;
}
if ( ! Pass( io, row ) ) {
SetParams( row, io );
if ( mDiscardInput ) {
row.clear();
}
Evaluate( row );
}
io.WriteRow( row );
}
return 0;
}
示例2: cr
void PivotCommand :: OutputPivot( IOManager & io ) {
CSVRow r;
r.push_back( "" ); // corresponds to row header
for ( auto col : mCols ) {
r.push_back( col );
}
io.WriteRow( r );
for( auto row : mRows ) {
r.clear();
r.push_back( row );
for ( auto col : mCols ) {
ColRow cr( col, row );
SumCount sc = mColRowValMap[ cr ];
if ( mAction == Action::Average ) {
r.push_back( ALib::Str( sc.mSum / sc.mCount ) );
}
else {
r.push_back( ALib::Str( sc.mSum ) );
}
}
io.WriteRow( r );
}
}
示例3: MakeRow
void ReadFixedCommand :: MakeRow( const string & line, CSVRow & row ) {
row.clear();
unsigned int len = line.size();
for( unsigned int i = 0; i < mFields.size(); i++ ) {
if ( mFields[i].first > len ) {
row.push_back( "" );
}
else {
string val = line.substr( mFields[i].first - 1, mFields[i].second );
row.push_back( mTrim ? ALib::RTrim( val ) : val );
}
}
}
示例4:
void DSVBase :: BuildCSVRow( const CSVRow & in, CSVRow & out ) const {
if ( mFields.size() == 0 ) {
out = in;
}
else {
out.clear();
for ( unsigned int i = 0; i < mFields.size(); i++ ) {
unsigned int f = mFields[ i ];
if ( f < in.size() ) {
out.push_back( in[ f ] );
}
else {
out.push_back( "" );
}
}
}
}