Original Post
Hi, I'm building an IO class based on the one in the Enginuity series but using fstreams instead of the c functions (fopen etc). One thing I would like to do is add in error proofing/checking so that my class will flag up any appropriate problems. I'm trying to decide if its best to this by return types (ie return false or an error code if something goes wrong) or whether to throw an exception. Opinions? The other thing I was wondering is how to check I'm reading the correct data. I can check the length of the file matches what is expected but wondered if there was a better way. I suppose I'm looking for ideas on creating file formats and how to check a particular file i read in is formatted correctly with all the data in the right order. Any references to online articles or books etc would be appreciated. Thanks Jon