Java has file related exception classes.
Do C++ or Qt have similar classes?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The standard library streams have two modes:
State checking – the programmer must call
good(),eof(),fail()orbad()to detect problems.Exception throwing – the programmer calls
exceptions(...)to set an exception mask, see the link for an example.The Qt library typically does not use exceptions, the
QIODeviceclass (and henceQFile) will return aboolfor the success or failure of a call. The error message can be obtained fromQIODevice::errorString().