Today we are going to see various techniques for serializing objects, converting them to/from byte streams. This is a common task in concurrent programming.
Links:
GitHub Invitation URL: exercise20
Steps:
file_header.h
declares a shared magic number between reader and writer code.read_file.cpp
reads a file using a QDataStreamwrite_file.cpp
writes a file using a QDataStreamread_file
and write_file
.Build and run the applications (write_file
first). Verify read_file
works.
Modify the programs so they create a QList
of QStrings
and reads/writes from/to a file.
Recompile your applications and verify they can exchange the objects through the file.
Now, use git to commit the source files changed to the local repository.
Finally, use git push to synchronize the repository with that on GitHub.
You have completed the Exercise.