Completed

small c++ program

******This program was too long to fit in the description. The rest of the code is carried over into to deliverable section.****** Using DelimTextBuffer class and struct Book { char title[21], isbn[15], author[30]; };Read information about books in GSW library from file [url removed, login to view] and display information about each book on the screen. Example: Input file: 45 Using C++ | 123456789 | Hennefeld, Burchard| 36 XML by Example | 12348989| McGrath| On the screen: Title: Using C++ ISBN: 123456789 Author: Hennefeld, Burchard Title: XML by Example ISBN: 12348989 Author: McGrath Press any key to continue Code for DelimTextBuffer: class DelimTextBuffer { public: DelimTextBuffer (char Delim = '|', int maxBytes = 1000); void Clear (); int Read (istream &); int Write (ostream &) const; int Pack (const char *, int size = -1); int Unpack (char *); void Print (ostream &) const; int Init (char delim, int maxBytes = 1000); private: char Delim; char DelimStr[2]; char * Buffer; int BufferSize; int MaxBytes; int NextByte; };DelimTextBuffer :: DelimTextBuffer (char delim, int maxBytes) {Init (delim, maxBytes); }void DelimTextBuffer :: Clear () {NextByte = 0; BufferSize = 0; }int DelimTextBuffer :: Read (istream & stream) {Clear (); stream>>BufferSize; if ([url removed, login to view]()) return false; if (BufferSize > MaxBytes) return false; [url removed, login to view] (Buffer, BufferSize); return stream . good (); }int DelimTextBuffer :: Write (ostream & stream) const {stream<<BufferSize<<' '; [url removed, login to view] (Buffer, BufferSize); return [url removed, login to view] (); }int DelimTextBuffer :: Pack (const char * str, int size) // set the value of the next field of the buffer; // if size = -1 (default) use strlen(str) as Delim of field {short len; // length of string to be packed if (size >= 0) len = size; else len = strlen (str); if (len > strlen(str)) // str is too short! return false; int start = NextByte; // first character to be packed NextByte += len + 1; if (NextByte > MaxBytes) return false; memcpy (&Buffer[start], str, len); Buffer [start+len] = Delim; // add delimeter BufferSize = NextByte; return true; }int DelimTextBuffer :: Unpack (char * str) // extract the value of the next field of the buffer {int len = -1; // length of packed string int start = NextByte; // first character to be unpacked for (int i = start; i < BufferSize; i++) if (Buffer[i] == Delim) {len = i - start; break;} if (len == -1) return false; // delimeter not found

## Deliverables

NextByte += len + 1; if (NextByte > BufferSize) return false; strncpy (str, &Buffer[start], len); str [len] = 0; // zero termination for string return true; }void DelimTextBuffer :: Print (ostream & stream) const {stream << "Buffer has max characters " << MaxBytes << " and Buffer Size " << BufferSize << endl; }// Protected members int DelimTextBuffer :: Init (char delim, int maxBytes) // construct with a maximum of maxFields {Delim = delim; DelimStr[0] = Delim; DelimStr[1] = 0; if (maxBytes < 0) maxBytes = 0; MaxBytes = maxBytes; Buffer = new char[MaxBytes]; BufferSize = 0; return 1;} Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased.

## Platform

Visual C++

## Deadline information

Must have by 10pm on Friday Feb 8, 2002 usa EST

Skills: C Programming, Engineering, MySQL, PHP, Software Architecture, Software Testing

See more: visual c++ programming, usa programming, struct c programming, string library in c, string library c, string in c programming, string c programming, stream programming, rest programming, public programming, programming books, print pack, php programming books, must read programming books, int size c, int i, if else c programming, good programming books, functional programming example, else if c programming

About the Employer:
( 4 reviews ) United States

Project ID: #2838387

Awarded to:

Meg341

See private message.

$12 USD in 14 days
(14 Reviews)
3.5

9 freelancers are bidding on average $10 for this job

deovalente

See private message.

$12.75 USD in 14 days
(15 Reviews)
4.6
vw139994vw

See private message.

$12.75 USD in 14 days
(60 Reviews)
4.5
vw132761vw

See private message.

$12.75 USD in 14 days
(33 Reviews)
4.2
dannynoest

See private message.

$8.5 USD in 14 days
(15 Reviews)
2.7
jaggs83

See private message.

$12.75 USD in 14 days
(6 Reviews)
1.6
thethinkervw

See private message.

$4.25 USD in 14 days
(2 Reviews)
0.2
technonupe

See private message.

$4.25 USD in 14 days
(1 Review)
0.0
vw182605vw

See private message.

$12.75 USD in 14 days
(0 Reviews)
0.0