Record.h


This is the Record class, which stores the input record from the Web. The method ReadData( ) reads book information from the Web and composes a record for the information. Fields of the composed record are delimited by a bar ‘|’.

 ~wenchen/public_html/cgi-bin/351/week7/Record.h 
#include  <cstring>
  using namespace  std;

class  Record {
  private:
    char   buf[256];
    int    size;
  public:
    int    GetSize ( )  { return size; };
    char*  GetBuf  ( )  { return buf;  };
    void   ReadData( char*, char*, char*, char* );
    void   Append  ( fstream& );
};
void  Record::ReadData( char* a, char* b, char* c, char* d ) {
  strcpy( buf, a );   strcat( buf, "|" );
  strcat( buf, b );   strcat( buf, "|" );
  strcat( buf, c );   strcat( buf, "|" );
  strcat( buf, d );   strcat( buf, "|" );
  size = strlen( buf );
};