本文整理汇总了C++中CSVRow::end方法的典型用法代码示例。如果您正苦于以下问题:C++ CSVRow::end方法的具体用法?C++ CSVRow::end怎么用?C++ CSVRow::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSVRow
的用法示例。
在下文中一共展示了CSVRow::end方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: validate
bool CSVTemplate::validate(const CSVRow& row, int startindex) const {
if (!_layout && _count!=row.inRange(startindex, startindex+_count)) {
//printf("%s: count mismatch; _c: %lu inr: %lu\n", __PRETTY_FUNCTION__, _count, row.inRange(startindex, startindex+_count));
return false;
}
if (_layout) {
int index=startindex;
CSVRecordMap::const_iterator iter;
CSVRecordMap::const_iterator end=row.end();
while ((size_t)index<_count) {
iter=row.find(index);
if (iter!=end) {
if (iter->second && !(_layout[index].type&iter->second->getType())) {
//printf("debug: %s: [%d] non-matching type\n", __PRETTY_FUNCTION__, index);
return false;
} else if (!iter->second && !_layout[index].nullable) { // not nullable; is null
//printf("debug: %s: [%d] not nullable; null\n", __PRETTY_FUNCTION__, index);
return false;
}
} else if (!_layout[index].nullable) { // not nullable; is unset
//printf("debug: %s: [%d] not nullable; unset\n", __PRETTY_FUNCTION__, index);
return false;
}
index++;
}
} // else count==rangecount and that's all that the template requires for validation
return true;
}
示例2: display
void AbstractFileSource::display(const CSVRow& row) {
if(!row.size())
return;
CSVRowCI i=row.begin();
std::cout<<*(i++);
for(;i != row.end();++i)
std::cout<<','<<*i;
};
示例3: 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 );
}
示例4: formatRow
void CSVFormatter::formatRow(const CSVRow& row, UnicodeString& result, UChar32 sepchar, unsigned int varformat) {
result.remove();
UnicodeString formatted;
int lastcolumn=0;
CSVRecordMap::const_iterator iter;
for (iter=row.begin(); iter!=row.end(); ++iter) {
for (; lastcolumn<iter->first; ++lastcolumn) {
result.append(sepchar);
}
if (iter->second) {
iter->second->getValueFormatted(formatted, varformat);
// result.append(iter->second->getTypeName());
// result.append(':');
result.append(formatted);
//} else {
// result.append("[null]");
}
}
}