Skip to content

Commit

Permalink
Per #2911, add DataLine::set_item() function to support -set_hdr opti…
Browse files Browse the repository at this point in the history
…ons.
  • Loading branch information
JohnHalleyGotway committed Jun 14, 2024
1 parent 8d10ced commit a8006cd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/basic/vx_util/data_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,33 @@ return;
////////////////////////////////////////////////////////////////////////


void DataLine::set_item(int k, const ConcatString &item_cs)

{

if ( (k < 0) || (k >= N_items) ) {

ConcatString cs = (File ? File->filename() : "");

mlog << Error << "\nDataLine::set_item(int) -> "
<< "range check error setting line number " << LineNumber
<< ", item number " << k+1 << " of " << N_items
<< " from file \"" << cs << "\"\n\n";

exit ( 1 );

}

Items[k] = item_cs;

return;

}


////////////////////////////////////////////////////////////////////////


const char * DataLine::get_item(int k) const

{
Expand Down
6 changes: 6 additions & 0 deletions src/basic/vx_util/data_line.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ class DataLine {

void dump(std::ostream &, int depth = 0) const;

//
// set stuff
//

void set_item(int, const ConcatString &);

//
// retrieve stuff
//
Expand Down

0 comments on commit a8006cd

Please sign in to comment.