cwCsv.h/cpp : Added has_field().

This commit is contained in:
kevin 2024-01-28 13:20:10 -05:00
parent 40840286cf
commit 3319804d60
2 changed files with 7 additions and 0 deletions

View File

@ -420,6 +420,12 @@ unsigned cw::csv::title_col_index( handle_t h, const char* title )
return _title_to_col_index(p,title);
}
bool cw::csv::has_field( handle_t h, const char* title )
{
csv_t* p = _handleToPtr(h);
return _title_to_col_index(p,title) != kInvalidIdx;
}
cw::rc_t cw::csv::rewind( handle_t h )
{

View File

@ -22,6 +22,7 @@ namespace cw
const char* col_title( handle_t h, unsigned idx );
unsigned title_col_index( handle_t h, const char* title );
bool has_field( handle_t h, const char* title );
// Reset the CSV to make the title line current.
// The next call to 'next_line()' will make the first data row current.