static const char* version_id =
  "$Id: misc-io.cc,v 1.1 1999/10/19 20:07:02 v2kea318 Exp $";

// $Log: misc-io.cc,v $
// Revision 1.1  1999/10/19  20:07:02  v2kea318
// Initial revision
//
//***************************************************************************

#include "misc-io.h"
#include <cstring>

//***************************************************************************

static inline void clear_buff(char* buff, const size_t sz)
{
  memset(buff, '\0', sz);
}

void read_all(istream& strm, string& strng)
{
  const size_t sz_buff = 1024;
  static char buffer[sz_buff];

  // read lines until end of file.
  clear_buff(buffer, sz_buff);
  char delim = '\n';
  while (strm.getline(buffer, sz_buff, delim)) {
    strng += buffer;
    if (strm.peek() != EOF) strng += delim;
    clear_buff(buffer, sz_buff);
  }
}
