void copy(Output_Stream &output) {
   char buffer[256 * 1024];
   size_t number_bytes_read;
   while ((number_bytes_read = read(buffer, sizeof(buffer))) > 0) {
     output.write(buffer, number_bytes_read);
   }
 }
Esempio n. 2
0
  void operator()(Input_Stream &input, Output_Stream &output,
                  const rstd::vector<rel::rlang::token> &tokens) {
    NP1_ASSERT(tokens.size() == 0, "rel.record_count accepts no arguments"); 

    // Read & discard the headings.
    input.parse_headings();

    uint64_t number_records = 0;    
    input.parse_records(record_counter_callback(number_records));
    output.write(str::to_dec_str(number_records).c_str());
  }