class FileError : public StringError
{
public:
+ /** @param m Error message.
+ * @param f Name of the file that this exception concerns.
+ */
FileError (std::string m, std::string f)
: StringError (m)
, _file (f)
virtual ~FileError () throw () {}
+ /** @return name of the file that this exception concerns */
std::string file () const {
return _file;
}
private:
+ /** name of the file that this exception concerns */
std::string _file;
};
{}
};
+
+/** @class ReadFileError.
+ * @brief Indicates that some error occurred when trying to read from a file
+ */
+class ReadFileError : public FileError
+{
+public:
+ /** @param f File that we were trying to read from.
+ * @param e errno value, or 0.
+ */
+ ReadFileError (std::string f, int e = 0)
+ : FileError ("", f)
+ {
+ std::stringstream s;
+ s << "could not read from file " << f;
+ if (e) {
+ s << " (" << strerror (e) << ")";
+ }
+ _what = s.str ();
+ }
+};
+
/** @class WriteFileError.
* @brief Indicates that some error occurred when trying to write to a file
*/
: StringError (s)
{}
};
-
-class PlayError : public StringError
-{
-public:
- PlayError (std::string s)
- : StringError (s)
- {}
-};
-
-class DVDError : public StringError
-{
-public:
- DVDError (std::string s)
- : StringError (s)
- {}
-};